Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support STRM files in library as available content #1004

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
1 change: 1 addition & 0 deletions server/api/jellyfin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export interface JellyfinMediaSource {
Path: string;
Type: string;
VideoType: string;
Container?: string;
MediaStreams: JellyfinMediaStream[];
}

Expand Down
31 changes: 14 additions & 17 deletions server/lib/scanners/jellyfin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class JellyfinScanner {
(MediaStream) => MediaStream.Type === 'Video'
).some((MediaStream) => {
return (MediaStream.Width ?? 0) <= 2000;
});
}) || MediaSource.Container === 'strm';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By doing this, all STRM media will be considered non-4k media. Right now I don't know what method to use, but you have to find a way to retrieve the media definition.

Copy link
Author

@alanmilinovic alanmilinovic Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, I also have no idea.

});

await this.asyncLock.dispatch(newMedia.tmdbId, async () => {
Expand Down Expand Up @@ -370,18 +370,18 @@ class JellyfinScanner {
newSeasons.filter(
(season) => season.status === MediaStatus.AVAILABLE
).length +
(media?.seasons.filter(
(season) => season.status === MediaStatus.AVAILABLE
).length ?? 0) >=
(media?.seasons.filter(
(season) => season.status === MediaStatus.AVAILABLE
).length ?? 0) >=
alanmilinovic marked this conversation as resolved.
Show resolved Hide resolved
filteredSeasons.length;

const isAll4kSeasons =
newSeasons.filter(
(season) => season.status4k === MediaStatus.AVAILABLE
).length +
(media?.seasons.filter(
(season) => season.status4k === MediaStatus.AVAILABLE
).length ?? 0) >=
(media?.seasons.filter(
(season) => season.status4k === MediaStatus.AVAILABLE
).length ?? 0) >=
alanmilinovic marked this conversation as resolved.
Show resolved Hide resolved
filteredSeasons.length;

if (media) {
Expand All @@ -404,8 +404,7 @@ class JellyfinScanner {
// the lastSeasonChange field so we can trigger notifications
if (newStandardSeasonAvailable > currentStandardSeasonAvailable) {
this.log(
`Detected ${
newStandardSeasonAvailable - currentStandardSeasonAvailable
`Detected ${newStandardSeasonAvailable - currentStandardSeasonAvailable
alanmilinovic marked this conversation as resolved.
Show resolved Hide resolved
} new standard season(s) for ${tvShow.name}`,
'debug'
);
Expand All @@ -415,8 +414,7 @@ class JellyfinScanner {

if (new4kSeasonAvailable > current4kSeasonAvailable) {
this.log(
`Detected ${
new4kSeasonAvailable - current4kSeasonAvailable
`Detected ${new4kSeasonAvailable - current4kSeasonAvailable
alanmilinovic marked this conversation as resolved.
Show resolved Hide resolved
} new 4K season(s) for ${tvShow.name}`,
'debug'
);
Expand Down Expand Up @@ -444,8 +442,8 @@ class JellyfinScanner {
isAllStandardSeasons || shouldStayAvailable
? MediaStatus.AVAILABLE
: media.seasons.some(
(season) => season.status !== MediaStatus.UNKNOWN
)
(season) => season.status !== MediaStatus.UNKNOWN
)
alanmilinovic marked this conversation as resolved.
Show resolved Hide resolved
? MediaStatus.PARTIALLY_AVAILABLE
: MediaStatus.UNKNOWN;
media.status4k =
Expand All @@ -472,8 +470,8 @@ class JellyfinScanner {
status: isAllStandardSeasons
? MediaStatus.AVAILABLE
: newSeasons.some(
(season) => season.status !== MediaStatus.UNKNOWN
)
(season) => season.status !== MediaStatus.UNKNOWN
)
alanmilinovic marked this conversation as resolved.
Show resolved Hide resolved
? MediaStatus.PARTIALLY_AVAILABLE
: MediaStatus.UNKNOWN,
status4k:
Expand All @@ -495,8 +493,7 @@ class JellyfinScanner {
}
} catch (e) {
this.log(
`Failed to process Jellyfin item. Id: ${
jellyfinitem.SeriesId ?? jellyfinitem.SeasonId ?? jellyfinitem.Id
`Failed to process Jellyfin item. Id: ${jellyfinitem.SeriesId ?? jellyfinitem.SeasonId ?? jellyfinitem.Id
alanmilinovic marked this conversation as resolved.
Show resolved Hide resolved
}`,
'error',
{
Expand Down