Skip to content

Commit

Permalink
make reported queue info more useful
Browse files Browse the repository at this point in the history
- the queue items now indicate their original queue, which theoretically allows restoring the Next Up queue
  • Loading branch information
Chaphasilor committed Dec 11, 2024
1 parent 7791ee6 commit 804196e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/services/playback_history_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ class PlaybackHistoryService {
}) {
try {
return jellyfin_models.PlaybackProgressInfo(
itemId: item.item.extras?["itemJson"]["Id"] ?? "",
itemId: item.baseItem?.id ?? "",
playSessionId: _queueService.getQueue().id,
isPaused: isPaused,
isMuted: isMuted,
Expand All @@ -532,7 +532,7 @@ class PlaybackHistoryService {
: "DirectPlay",
nowPlayingQueue:
getQueueToReport(includeNowPlayingQueue: includeNowPlayingQueue),
playlistItemId: item.id,
playlistItemId: _queueService.getQueue().source.id,
);
} catch (e) {
_playbackHistoryServiceLogger.warning(e);
Expand Down Expand Up @@ -561,7 +561,7 @@ class PlaybackHistoryService {
}

return jellyfin_models.PlaybackProgressInfo(
itemId: _currentTrack!.item.item.extras?["itemJson"]["Id"],
itemId: _currentTrack!.item.baseItem?.id ?? "",
playSessionId: _queueService.getQueue().id,
canSeek: true,
isPaused: _audioService.paused,
Expand All @@ -575,7 +575,7 @@ class PlaybackHistoryService {
: "DirectPlay",
repeatMode: _toJellyfinRepeatMode(_queueService.loopMode),
nowPlayingQueue: getQueueToReport(),
playlistItemId: _currentTrack?.item.id,
playlistItemId: _queueService.getQueue().source.id,
);
} catch (e) {
_playbackHistoryServiceLogger.warning(e);
Expand All @@ -591,7 +591,7 @@ class PlaybackHistoryService {
.peekQueue(next: _maxQueueLengthToReport)
.map((e) => jellyfin_models.QueueItem(
id: e.item.id,
playlistItemId: e.source.id,
playlistItemId: e.type.name,
))
.toList();
return queue;
Expand Down

0 comments on commit 804196e

Please sign in to comment.