Makes it possible for the caller to request that a previous callback is
replaced, so we don't end up with more and more callbacks. Also add other
options for future use.
Misc refactoring, e.g. alignment of how modules save tracks and playlists, incl
use of mfi and pli. Also try to avoid direct calls between library and player.
This adds a new timestamp value "db_modified" into the admin db table.
In addition to the existing "db_update" admin value, this value is also
updated if rating, play-/skip-count or seek changes for a
media_info_file (files db table).
This should improve the caching behavior in clients of the JSON API
(especially the player web interface) in refreshing its data if some of
this values changes.
The idea here is to make sure the fixing up of tags is done in a consistent
manner. For strings, this means stuff like trimming and empty strings -> null
are applied the same unless there are special exception rules set. It also
means that defaults are applied the same across structs, e.g. "Unknown artist"
for both mfi->artist and queue_item->artist.
The change is also necessary because we want to remove trimming from the sql
query and instead implement it ourselves.
Instead of asking a client to first scan the path into a media_file_info
object and afterwards add it to the queue, we now offer a library
function to directly add a path.
The library-source that can handle the given path translates the path
into new queue item(s) and adds them to the queue.
ANALYZE collects and saves statistics even if there were no database
changes and the last collected data is still good.
According to the sqlite3 documentation, it is recommended to use "PRAGMA
optimize" which will call "ANALYZE" if it is necessary. "PRAGMA
optimize" will run "ANALYZE" based on prior queries on the same database
connection. It is recommended to run optimize before closing the
connection.
(see https://www.sqlite.org/lang_analyze.html)
Thanks to Denis Denisov and cppcheck for notifying about the below. The leaks
are edge cases, but the warning of dereference of avail in alsa.c points at
a bug that could probably cause actual crashes.
[src/evrtsp/rtsp.c:1352]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/httpd_daap.c:228]: (error) Memory leak: s
[src/library.c:280]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/library.c:284]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/library/filescanner_playlist.c:251]: (error) Resource leak: fp
[src/library/filescanner_playlist.c:273]: (error) Resource leak: fp
[src/outputs/alsa.c:143]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/outputs/alsa.c:657]: (warning) Possible null pointer dereference: avail
[src/outputs/dummy.c:75]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/outputs/fifo.c:245]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/outputs/raop.c:1806]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/outputs/raop.c:1371]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/outputs/raop.c:1471]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/outputs/raop_verification.c:705] -> [src/outputs/raop_verification.c:667]: (warning) Either the condition 'if(len_M)' is redundant or there is possible null pointer dereference: len_M.
webinterface
Library now offers the function "library_exec_async". This allows
library sources to offer functions that will be executed in
the library thread. Useful to allow partial scans of only one source.
"library" thread
- Implement filescanner as a library_source
- Add library source implementation for spotify
- Move process_media_info to library with small adjustments:
- Remove dependency to F_SCAN_TYPE defines
- Pass data_kind as parameter
- Pass media_kind and compilation as parameter if a source forces a
specific value for these
- Move declaration of scan_ffmpeg to library; add
library_add_playlist_info to library