Fix saving last playing item when application is shutdown

This commit is contained in:
Bart De Vries 2021-04-12 09:40:18 +02:00
parent 593934bc4f
commit f626cee7af
1 changed files with 2 additions and 0 deletions

View File

@ -136,6 +136,8 @@ void AudioManager::setEntry(Entry* entry)
d->lockPositionSaving = true; d->lockPositionSaving = true;
d->m_entry = entry; d->m_entry = entry;
d->m_player.setMedia(QUrl(QStringLiteral("file://")+d->m_entry->enclosure()->path())); d->m_player.setMedia(QUrl(QStringLiteral("file://")+d->m_entry->enclosure()->path()));
// save the current playing track in the settingsfile for restoring on startup
SettingsManager::self()->setLastPlayingEntry(d->m_entry->id());
qDebug() << "Changed source to" << d->m_entry->title(); qDebug() << "Changed source to" << d->m_entry->title();
qint64 startingPosition = d->m_entry->enclosure()->playPosition(); qint64 startingPosition = d->m_entry->enclosure()->playPosition();