mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 16:15:57 -05:00
Check & fix UTF-8 strings before adding/updating files
This commit is contained in:
parent
35d6ac4cfa
commit
3b7a71527a
@ -284,6 +284,8 @@ process_media_file(char *file, time_t mtime, off_t size, int compilation)
|
|||||||
|
|
||||||
fixup_tags(&mfi);
|
fixup_tags(&mfi);
|
||||||
|
|
||||||
|
unicode_fixup_mfi(&mfi);
|
||||||
|
|
||||||
if (mfi.id == 0)
|
if (mfi.id == 0)
|
||||||
db_file_add(&mfi);
|
db_file_add(&mfi);
|
||||||
else
|
else
|
||||||
|
@ -424,6 +424,7 @@ process_track_file(plist_t trk, char *base)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unicode_fixup_mfi(mfi);
|
||||||
db_file_update(mfi);
|
db_file_update(mfi);
|
||||||
|
|
||||||
free_mfi(mfi, 0);
|
free_mfi(mfi, 0);
|
||||||
|
@ -667,6 +667,9 @@ dacp_propset_userrating(const char *value, struct evkeyvalq *query)
|
|||||||
|
|
||||||
mfi->rating = rating;
|
mfi->rating = rating;
|
||||||
|
|
||||||
|
/* We're not touching any string field in mfi, so it's safe to
|
||||||
|
* skip unicode_fixup_mfi() before the update
|
||||||
|
*/
|
||||||
db_file_update(mfi);
|
db_file_update(mfi);
|
||||||
|
|
||||||
free_mfi(mfi, 0);
|
free_mfi(mfi, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user