Check & fix UTF-8 strings before adding/updating files

This commit is contained in:
Julien BLACHE 2010-06-21 17:50:09 +02:00
parent 35d6ac4cfa
commit 3b7a71527a
3 changed files with 6 additions and 0 deletions

View File

@ -284,6 +284,8 @@ process_media_file(char *file, time_t mtime, off_t size, int compilation)
fixup_tags(&mfi);
unicode_fixup_mfi(&mfi);
if (mfi.id == 0)
db_file_add(&mfi);
else

View File

@ -424,6 +424,7 @@ process_track_file(plist_t trk, char *base)
}
}
unicode_fixup_mfi(mfi);
db_file_update(mfi);
free_mfi(mfi, 0);

View File

@ -667,6 +667,9 @@ dacp_propset_userrating(const char *value, struct evkeyvalq *query)
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);
free_mfi(mfi, 0);