mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #14244] [MERGED] fix(Session): don't query DB if queue hasn't changed #13900
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/14244
Author: @Skaytacium
Created: 6/8/2025
Status: ✅ Merged
Merged: 6/10/2025
Merged by: @crobibero
Base:
master← Head:master📝 Commits (4)
3fd5abffix(Session): doesn't query DB if queue hasn't changed4348470fix(Session): properly compares queues9bf3126Update QueueItem.cs6c89445Update QueueItem.cs📊 Changes
2 files changed (+6 additions, -7 deletions)
View changed files
📝
Emby.Server.Implementations/Session/SessionManager.cs(+1 -1)📝
MediaBrowser.Model/Session/QueueItem.cs(+5 -6)📄 Description
Background and additional debugging details are given in the mentioned issue (jellyfin/jellyfin#13628), and jellyfin/jellyfin-mpv-shim#265
Changes
Checks if the session's
nowPlayingQueuehas changed since the lastProgressUpdateevent, and if so, then queries the database for data transfer objects.Issues
fixes #13628
fixes jellyfin/jellyfin-mpv-shim#265
Note
The last time I used C# was 3 years ago, so I don't know how to exactly get around the following.
SequenceEqualuses the equality operator to check each item in anIEnumerable<T>, which compares the references and not the actual values. In this case, the values are more important, not the memory location. ChangingMediaBrowser.Model/Session/QueueItem.csto the following would be ideal:But the project's settings do not allow this. If there is a better way to do this, then it would be ideal, because currently the queues remain unequal sometimes even when the value is the same, due to memory location changes probably. That would also make it possible to get rid of the final
&& updateLastCheckInTimeconditional.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.