madmaxoft / SkauTan

Music player for Skautské Tancování
https://skautske-tancovani.cz/
The Unlicense
1 stars 2 forks source link

Do not rescan songs with invalid metadata #74

Closed madmaxoft closed 6 years ago

madmaxoft commented 6 years ago

If a song has invalid metadata, it is rescanned on each program start again and again. This may pose problems if there are more such songs.

madmaxoft commented 6 years ago

After the #94 rewrite, rescans are much better defined, but still upon start about 600 out of 3000 songs trigger a tag rescan, although they have their metadata set.

Assumption: The rescan is triggered if the author is NULL in the DB; rescanning the tags sets the author to an invalid variant if the author cannot be detected. Instead, the author should be set to empty string.

madmaxoft commented 6 years ago

Problem: Qt seems to convert between DB NULLs and empty string variants randomly (?!?)

madmaxoft commented 6 years ago

Found the culprit: QVariant a = QString() creates a NULL variant of type QString; QVariant a = QString("") creates a regular valid variant containing an empty QString.