Commit 41fddfe6 authored by Matthieu Gallien's avatar Matthieu Gallien 🎵

save modified metadata to files

no integrity or verification are being done

expose bugs in the database management
parent c003aabb
......@@ -449,6 +449,17 @@ void ModelDataLoader::databaseAlbumsAdded(const ListAlbumDataType &newData)
}
}
void ModelDataLoader::trackHasBeenModified(const ModelDataLoader::ListTrackDataType &trackDataType, const QHash<QString, QUrl> &covers)
{
Q_UNUSED(covers)
for(const auto &oneTrack : trackDataType) {
if (oneTrack.elementType() == ElisaUtils::Track) {
d->mFileWriter.writeAllMetaDataToFile(oneTrack.resourceURI(), oneTrack);
}
}
}
void ModelDataLoader::updateFileMetaData(const DataTypes::TrackDataType &trackDataType, const QUrl &url)
{
d->mFileWriter.writeAllMetaDataToFile(url, trackDataType);
......
......@@ -118,6 +118,8 @@ public Q_SLOTS:
void updateSingleFileMetaData(const QUrl &url, DataTypes::ColumnsRoles role, const QVariant &data);
void trackHasBeenModified(const ModelDataLoader::ListTrackDataType &trackDataType, const QHash<QString, QUrl> &covers);
private Q_SLOTS:
void databaseTracksAdded(const ModelDataLoader::ListTrackDataType &newData);
......
......@@ -94,6 +94,8 @@ void EditableTrackMetadataModel::initialize(MusicListenersManager *newManager, D
connect(this, &EditableTrackMetadataModel::saveTrackModified,
&modelDataLoader(), &ModelDataLoader::saveTrackModified);
connect(this, &EditableTrackMetadataModel::saveTrackModified,
&modelDataLoader(), &ModelDataLoader::trackHasBeenModified);
connect(this, &EditableTrackMetadataModel::deleteRadioData,
&modelDataLoader(), &ModelDataLoader::removeRadio);
}
......
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