Commit e87e2c60 authored by Matthieu Gallien's avatar Matthieu Gallien

as requested during review, put back extra parameter in TracksListener::trackByFileNameInList

parent 0c22a3e6
......@@ -437,6 +437,10 @@ void TrackMetadataModel::initialize(MusicListenersManager *newManager, DatabaseI
if (mManager) {
mDataLoader.setDatabase(mManager->viewDatabase());
connect(this, &TrackMetadataModel::needDataByUrl,
mManager->tracksListener(), &TracksListener::trackByFileNameInList);
connect(mManager->tracksListener(), &TracksListener::trackHasChanged,
this, &TrackMetadataModel::trackData);
} else if (trackDatabase) {
mDataLoader.setDatabase(trackDatabase);
}
......@@ -463,8 +467,6 @@ void TrackMetadataModel::initialize(MusicListenersManager *newManager, DatabaseI
this, &TrackMetadataModel::radioData);
connect(&mDataLoader, &ModelDataLoader::radioModified,
this, &TrackMetadataModel::radioData);
connect(this, &TrackMetadataModel::needDataByUrl,
&mDataLoader, &ModelDataLoader::loadDataByUrl);
}
void TrackMetadataModel::fetchLyrics()
......
......@@ -155,8 +155,10 @@ void TracksListener::trackByNameInList(const QVariant &title, const QVariant &ar
}
}
void TracksListener::trackByFileNameInList(const QUrl &fileName)
void TracksListener::trackByFileNameInList(ElisaUtils::PlayListEntryType type, const QUrl &fileName)
{
Q_UNUSED(type)
if (fileName.isLocalFile() || fileName.scheme().isEmpty()) {
auto newTrackId = d->mDatabase->trackIdFromFileName(fileName);
if (newTrackId == 0) {
......@@ -246,7 +248,7 @@ void TracksListener::newUrlInList(const QUrl &entryUrl, ElisaUtils::PlayListEntr
if (!newDatabaseId)
{
trackByFileNameInList(entryUrl);
trackByFileNameInList(databaseIdType, entryUrl);
return;
}
......
......@@ -69,7 +69,7 @@ public Q_SLOTS:
const QString &entryTitle,
ElisaUtils::PlayListEntryType databaseIdType);
void trackByFileNameInList(const QUrl &fileName);
void trackByFileNameInList(ElisaUtils::PlayListEntryType type, const QUrl &fileName);
void newUrlInList(const QUrl &entryUrl,
ElisaUtils::PlayListEntryType databaseIdType);
......
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