mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-07-10 22:42:55 +01:00
Changed || to ?? to account for 0 values (#851)
Co-authored-by: Alex Kim <alexkim@Alexs-MacBook-Pro.local>
This commit is contained in:
@@ -1,10 +1,7 @@
|
|||||||
import { BITRATES, Bitrate } from "@/components/BitrateSelector";
|
import { type BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||||
import type { Settings } from "@/utils/atoms/settings";
|
|
||||||
import {
|
|
||||||
type BaseItemDto,
|
|
||||||
MediaSourceInfo,
|
|
||||||
} from "@jellyfin/sdk/lib/generated-client";
|
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
|
import { BITRATES } from "@/components/BitrateSelector";
|
||||||
|
import type { Settings } from "@/utils/atoms/settings";
|
||||||
|
|
||||||
// Used only for initial play settings.
|
// Used only for initial play settings.
|
||||||
const useDefaultPlaySettings = (
|
const useDefaultPlaySettings = (
|
||||||
@@ -33,10 +30,10 @@ const useDefaultPlaySettings = (
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
defaultAudioIndex:
|
defaultAudioIndex:
|
||||||
preferedAudioIndex || defaultAudioIndex || firstAudioIndex || undefined,
|
preferedAudioIndex ?? defaultAudioIndex ?? firstAudioIndex ?? undefined,
|
||||||
defaultSubtitleIndex: mediaSource?.DefaultSubtitleStreamIndex || -1,
|
defaultSubtitleIndex: mediaSource?.DefaultSubtitleStreamIndex ?? -1,
|
||||||
defaultMediaSource: mediaSource || undefined,
|
defaultMediaSource: mediaSource ?? undefined,
|
||||||
defaultBitrate: bitrate || undefined,
|
defaultBitrate: bitrate ?? undefined,
|
||||||
};
|
};
|
||||||
}, [
|
}, [
|
||||||
item.MediaSources,
|
item.MediaSources,
|
||||||
|
|||||||
Reference in New Issue
Block a user