Skip to content

Commit

Permalink
fix(jellyfinscanner): assign only 4k available badge for a 4k request…
Browse files Browse the repository at this point in the history
… instead of both badges (#805)

When you have a 4k server setup, and request a 4k item, when it becomes available it also sets the
normal item as available thus not allowing the user to request for the normal item
  • Loading branch information
gauthier-th authored Jun 11, 2024
1 parent 20863d4 commit d31a2c3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/lib/scanners/jellyfin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,17 @@ class JellyfinScanner {
}

const has4k = metadata.MediaSources?.some((MediaSource) => {
return MediaSource.MediaStreams.some((MediaStream) => {
return MediaSource.MediaStreams.filter(
(MediaStream) => MediaStream.Type === 'Video'
).some((MediaStream) => {
return (MediaStream.Width ?? 0) > 2000;
});
});

const hasOtherResolution = metadata.MediaSources?.some((MediaSource) => {
return MediaSource.MediaStreams.some((MediaStream) => {
return MediaSource.MediaStreams.filter(
(MediaStream) => MediaStream.Type === 'Video'
).some((MediaStream) => {
return (MediaStream.Width ?? 0) <= 2000;
});
});
Expand Down

0 comments on commit d31a2c3

Please sign in to comment.