Commit db4720e7 authored by Yerrey Dev's avatar Yerrey Dev
Browse files

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.

BUG: 436405
parent 17ed3ad6
......@@ -262,9 +262,7 @@ qulonglong TrackMetadataModel::databaseId() const
void TrackMetadataModel::trackData(const TrackMetadataModel::TrackDataType &trackData)
{
if ((mDatabaseId != 0 && trackData.databaseId() != mDatabaseId) ||
(!mFileUrl.isEmpty() && trackData.resourceURI() != mFileUrl) ||
(!mFullData.isEmpty() && trackData.databaseId() != mFullData.databaseId())) {
if (!mFileUrl.isEmpty() && trackData.resourceURI() != mFileUrl) {
return;
}
......
......@@ -351,9 +351,9 @@ Kirigami.Page {
}
}
onDatabaseIdChanged: {
if (ElisaApplication.musicManager && trackType !== undefined && databaseId !== 0) {
metaDataModel.initializeByIdAndUrl(trackType, databaseId, fileUrl)
onFileUrlChanged: {
if (ElisaApplication.musicManager && trackType !== undefined) {
metaDataModel.initializeByUrl(trackType, fileUrl)
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment