Also introduce default output format and selected device format, should the
user want another format.
As part of this, change enum player_format in player.h to enum media_format in
misc.h so that it is akin to struct media_quality.
Modify json API to support this.
Automatically read/write ratings to files in the library, if options read_rating/
write_rating are enabled. Also adds a max_rating so the user can set the rating
scale.
Doesn't sync automatic rating updates, because that could lead to whole-playlist
file rewriting.
Closes#1678
---------
Co-authored-by: whatdoineed2do/Ray <whatdoineed2do@nospam.gmail.com>
Co-authored-by: ejurgensen <espenjurgensen@gmail.com>
(db upgrade to v22.00)
`scan_kind` identifies the library "scanner" component that created the
item and is responsible to keep it up to date (rescan).
The library update now supports passing a `scan_kind` to update only the
items of one particular "scanner". This allows e. g. to only update the
item from the Spotify library or only update the RSS feeds.
The OwnTone database is upgraded to v22.00 and the `scan_kind` columns
in `files`, `playlists`, `directories` are identified by:
1. Check if item is part of a RSS playlist (podcast RSS feed), they
belong to the "rssscanner"
2. Check if item has a Spotify `virtual_path`, they belong to the
"spotifyscanner"
3. Remaining items belong to the "filescanner"
Caused by queue_item_add returning >0 as success, but caller is expecting ==0.
Try to avoid other occurancess of this issue by generally checking for error
("ret < 0") instead.
Before the value in the db was not read straight into mfi->disabled and
pli->disabled, instead it was evaluated as != 0, so the ->disabled field
would just be true or false. This was also necessary when INOTIFY_FAKE_COOKIE
(1 << 32) was written to the DB, because it could not fit in the uint32 of
mfi->disabled/pli->disabled.
I consider this juggling poor practice, so with this change it is read straight
in and out, always as a int64.
- Use prepared statements
- Add qi_mfi_map that defines mapping between mfi, dbmfi and qi
- Use qi_cols_map/qi_mfi_map for iteration (avoid duplicating field references)
- Stick to "qi" as name for a queue_item in db.c (more similar to mfi/pli/gri)
- Some renaming and other minor stuff in db.c's queue code
This commit also changes db.c's sort_tag_create to always recreate sort tags,
so that they match source tags, should they have changed. Unclear to me why
the previous solution didn't do that, so will probably regret this change when
it dawns on me.