[db] Generic fixup + align fixing up between mfi, pli and queue_item

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.
This commit is contained in:
ejurgensen
2018-12-28 19:10:17 +01:00
parent fc5a66f86d
commit 1de8f39264
5 changed files with 361 additions and 292 deletions

View File

@@ -133,9 +133,6 @@ library_add_media(struct media_file_info *mfi)
if (!mfi->media_kind)
mfi->media_kind = MEDIA_KIND_MUSIC; /* music */
unicode_fixup_mfi(mfi);
fixup_tags_mfi(mfi);
if (mfi->id == 0)
db_file_add(mfi);
else