SUMMARY I traced down to DatabaseInterface::internalTrackIdFromFileName returns zero for track that has no metadata at all. This caused lyric not updated while switching from track has lyric to track that doesn't have any metadata. STEPS TO REPRODUCE 1. One track with lyric, one track with no metadata 2. play track with lyric 3. switch to track with no metadata OBSERVED RESULT the lyric is not updated EXPECTED RESULT lyric should be empty SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
Interesting. Wanna submit a merge request? :)
(In reply to Nate Graham from comment #1) > Interesting. Wanna submit a merge request? :) I'd like to fix it. I found seems like songs without metadata's ID in database is nil. Can you point me to the related files?
Tracks without metadata isn't present in Tracks table but exist in TracksData table. I don't know which class is responsible for insert new tracks to database.
https://invent.kde.org/multimedia/elisa/-/merge_requests/236
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/elisa/-/merge_requests/322
Git commit db4720e7fa9e294a3916941749a83a0c3845e344 by Yerrey Dev. Committed on 27/01/2022 at 12:01. Pushed by ngraham into branch 'master'. Fixes issue of metadata/lyrics not updating when switching tracks The issue is due to TrackMetadataModel::trackData not providing track data for tracks with Database ID of 0, which are tracks that are missing title metadata and are not added into elisaDatabase.db. In the fix, we remove the ID check. This introduces another issue, where in ContextView.qml onDatabaseIdChanged would not update the metadata/lyrics because the ID of tracks without metadata would be 0, and it wouldn't trigger the refresh of tracks changing. To alleviate this, we'll instead monitor the filename of the track playing, and when that changes, we update trackdata by the file URL. M +1 -3 src/models/trackmetadatamodel.cpp M +3 -3 src/qml/ContextView.qml https://invent.kde.org/multimedia/elisa/commit/db4720e7fa9e294a3916941749a83a0c3845e344
Git commit f0d279478935bbda2de2ead40176938cee6d71e1 by Yerrey Dev. Committed on 27/01/2022 at 12:01. Pushed by ngraham into branch 'master'. Fix metadata view not updating when switching tabs We need to check whether to call initializeByUrl or initializeByIdAndUrl based on whether the track has database id, fixes the issue of the metadata view being blank after switching tabs. Also onTrackTypeChanged needs the same check so metadata is properly updated when switching for example from radio to a track without metadata. M +15 -7 src/qml/ContextView.qml https://invent.kde.org/multimedia/elisa/commit/f0d279478935bbda2de2ead40176938cee6d71e1
thanks a lot, I didn't manage to figure out what caused this back then.