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.
- 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
Current impl fetches pl, purge pl items, fetch RSS, inserts entries. If the RSS
fetch fails (remote server is temporary unreachable) the playlistitems for that
RSS are all dropped.
This has a side effect that RSS playlists cannot be determined from tracks (see
issue #1126) and thus cannot be deleted.
Simple fix to defer playlist item purge to the point that the RSS fetch is ok
and before the inserts
The artwork db field should only be used to save media file artwork metadata,
which mostly means whether it has embedded artwork or not. It should not be
used to save where we found artwork for the file, since that is not static.
So this commit removes for instance ARTWORK_OWN, ARTWORK_DIR etc., which we
weren't using anyway.
Fixes issue when performing an 'api/rescan' (results in RSS_SCAN_META scan type
in this module) that would result in a library_media_save() -> a readd even for
entries that already exist in db. This would result in dropping db record, incl
play_count etc instead of an update
2.10's mxmlDelete memleaks, and mxml is used in many parts of forked-daapd. So
to avoid that we ship upstream's fixed version of mxmlDelete and use that.
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.
During scanning we might find a new, nested playlist (so inside another m3u),
which we will then save. When the scanner then reaches the actual playlist file,
we must make sure to scan the contents of it. This means the timestamp when
saving the first time has to be set to a dummy value.
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.
ffmpeg parses TDA, TDAT, TYE, TYER and TDR these days, so there is no need
to do that in forked-daapd. Also the parsing of TDA/TDAT was incorrect,
since it is MMDD.