1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-11-24 10:05:17 +00:00

core/RemoteJellyfinPlaybackManager: send media source id

If the mediaSourceId is not sent, Jellyfin Web will simply not take the
audioStreamIndex and subtitleStreamIndex in account when playing the
media.

A bug also surfaced where the application would crash when playing a
video, playing audio afterwards and then clicking on an item in the now
playing queue. This has also been fixed.
This commit is contained in:
Chris Josten 2024-01-02 13:02:59 +01:00
parent 6ed623d0f8
commit 1b27847c94

View file

@ -119,7 +119,12 @@ void RemoteJellyfinPlayback::playItemInList(const QList<QSharedPointer<Item> > &
} }
if (this->resumePlayback()) { if (this->resumePlayback()) {
this->playItemInList(itemIds, index, items.at(index)->userData()->playbackPositionTicks()); QSharedPointer<DTO::UserData> userData = items.at(index)->userData();
if (userData) {
this->playItemInList(itemIds, index, items.at(index)->userData()->playbackPositionTicks());
} else {
this->playItemInList(itemIds, index, 0);
}
} else { } else {
this->playItemInList(itemIds, index); this->playItemInList(itemIds, index);
} }
@ -271,6 +276,7 @@ void RemoteJellyfinPlayback::playItemInList(const QStringList &items, int index,
} }
params.setPlayCommand(DTO::PlayCommand::PlayNow); params.setPlayCommand(DTO::PlayCommand::PlayNow);
params.setItemIds(items); params.setItemIds(items);
params.setMediaSourceId(items.at(index));
params.setStartIndex(index); params.setStartIndex(index);
params.setAudioStreamIndex(this->audioIndex()); params.setAudioStreamIndex(this->audioIndex());
if (this->subtitleIndex() >= 0) { if (this->subtitleIndex() >= 0) {