[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

@@ -1686,7 +1686,6 @@ queue_add_stream(const char *path, int position, char reshuffle, uint32_t item_i
memset(&mfi, 0, sizeof(struct media_file_info));
scan_metadata_stream(path, &mfi);
unicode_fixup_mfi(&mfi);
map_media_file_to_queue_item(&item, &mfi);

View File

@@ -548,7 +548,6 @@ process_track_file(plist_t trk)
mfi->album_artist = strdup(mfi->artist);
}
unicode_fixup_mfi(mfi);
db_file_update(mfi);
free_mfi(mfi, 0);