disable play button on series
This commit is contained in:
1 file changed
+111
-84
+111
-84
@@ -34,6 +34,7 @@ import { useParams, useNavigate, Link as RouterLink } from "react-router-dom";
|
|||||||
import {
|
import {
|
||||||
BaseItemKind,
|
BaseItemKind,
|
||||||
ItemFields,
|
ItemFields,
|
||||||
|
LocationType,
|
||||||
MediaStreamType,
|
MediaStreamType,
|
||||||
SortOrder,
|
SortOrder,
|
||||||
} from "@jellyfin/sdk/lib/generated-client";
|
} from "@jellyfin/sdk/lib/generated-client";
|
||||||
@@ -66,6 +67,7 @@ import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
|||||||
import { ArtistAlbum } from "../../components/layouts/artist/artistAlbum";
|
import { ArtistAlbum } from "../../components/layouts/artist/artistAlbum";
|
||||||
import { MdiMusic } from "../../components/icons/mdiMusic";
|
import { MdiMusic } from "../../components/icons/mdiMusic";
|
||||||
import { usePlaybackStore } from "../../utils/store/playback";
|
import { usePlaybackStore } from "../../utils/store/playback";
|
||||||
|
import { Tooltip } from "@mui/material";
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
@@ -168,6 +170,7 @@ const ItemDetail = () => {
|
|||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getTvShowsApi(window.api).getSeasons({
|
const result = await getTvShowsApi(window.api).getSeasons({
|
||||||
seriesId: item.data.Id,
|
seriesId: item.data.Id,
|
||||||
|
isSpecialSeason: false,
|
||||||
});
|
});
|
||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
@@ -200,6 +203,7 @@ const ItemDetail = () => {
|
|||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
parentId: seasons.data.Items[currentSeason].Id,
|
parentId: seasons.data.Items[currentSeason].Id,
|
||||||
fields: [ItemFields.SeasonUserData, "Overview"],
|
fields: [ItemFields.SeasonUserData, "Overview"],
|
||||||
|
excludeLocationTypes: [LocationType.Virtual],
|
||||||
});
|
});
|
||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
@@ -1013,98 +1017,121 @@ const ItemDetail = () => {
|
|||||||
"Music",
|
"Music",
|
||||||
) && (
|
) && (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Tooltip
|
||||||
variant="contained"
|
title={
|
||||||
size="large"
|
item.data
|
||||||
startIcon={
|
.Type ==
|
||||||
<MdiPlayOutline />
|
"Series"
|
||||||
|
? "Work in progress, meanwhile you can play individual episodes by clicking on episode card below"
|
||||||
|
: ""
|
||||||
}
|
}
|
||||||
sx={{
|
>
|
||||||
position:
|
<span>
|
||||||
"relative",
|
<Button
|
||||||
overflow:
|
disabled={
|
||||||
"hidden",
|
|
||||||
}}
|
|
||||||
onClick={() => {
|
|
||||||
if (
|
|
||||||
!!item
|
|
||||||
.data
|
|
||||||
.VideoType
|
|
||||||
) {
|
|
||||||
setUrl(
|
|
||||||
`${window.api.basePath}/Videos/${item.data.Id}/stream.${item.data.MediaSources[0].Container}?Static=true&mediaSourceId=${item.data.Id}&deviceId=${window.api.deviceInfo.id}&api_key=${window.api.accessToken}&Tag=${item.data.MediaSources[0].ETag}`,
|
|
||||||
);
|
|
||||||
setPosition(
|
|
||||||
item
|
|
||||||
.data
|
|
||||||
.UserData
|
|
||||||
.PlaybackPositionTicks,
|
|
||||||
);
|
|
||||||
setItemName(
|
|
||||||
item
|
item
|
||||||
.data
|
.data
|
||||||
.Type ==
|
.Type ==
|
||||||
"Episode"
|
"Series"
|
||||||
? `${item.data.SeriesName} S${item.data.ParentIndexNumber}:E${item.data.IndexNumber} ${item.data.Name}`
|
? true
|
||||||
: item
|
: false
|
||||||
.data
|
}
|
||||||
.Name,
|
variant="contained"
|
||||||
);
|
size="large"
|
||||||
setItemId(
|
startIcon={
|
||||||
item
|
<MdiPlayOutline />
|
||||||
.data
|
|
||||||
.Id,
|
|
||||||
);
|
|
||||||
setDuration(
|
|
||||||
item
|
|
||||||
.data
|
|
||||||
.RunTimeTicks,
|
|
||||||
);
|
|
||||||
setSubtitleTracksStore(
|
|
||||||
subtitleTracks,
|
|
||||||
);
|
|
||||||
setSelectedSubtitleTrack(
|
|
||||||
currentSubTrack,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
navigate(
|
|
||||||
`/player`,
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{!!item.data
|
|
||||||
.UserData
|
|
||||||
.PlayedPercentage &&
|
|
||||||
item.data.UserData
|
|
||||||
.PlayedPercentage >
|
|
||||||
0
|
|
||||||
? "Resume"
|
|
||||||
: "Play"}
|
|
||||||
{!!item.data
|
|
||||||
.UserData
|
|
||||||
.PlayedPercentage && (
|
|
||||||
<LinearProgress
|
|
||||||
variant="determinate"
|
|
||||||
value={
|
|
||||||
item
|
|
||||||
.data
|
|
||||||
.UserData
|
|
||||||
.PlayedPercentage
|
|
||||||
}
|
}
|
||||||
color="white"
|
|
||||||
sx={{
|
sx={{
|
||||||
position:
|
position:
|
||||||
"absolute",
|
"relative",
|
||||||
height: "100%",
|
overflow:
|
||||||
width: "100%",
|
"hidden",
|
||||||
background:
|
|
||||||
"transparent",
|
|
||||||
zIndex: "0",
|
|
||||||
opacity: 0.2,
|
|
||||||
}}
|
}}
|
||||||
/>
|
onClick={() => {
|
||||||
)}
|
if (
|
||||||
</Button>
|
!!item
|
||||||
|
.data
|
||||||
|
.VideoType
|
||||||
|
) {
|
||||||
|
setUrl(
|
||||||
|
`${window.api.basePath}/Videos/${item.data.Id}/stream.${item.data.MediaSources[0].Container}?Static=true&mediaSourceId=${item.data.Id}&deviceId=${window.api.deviceInfo.id}&api_key=${window.api.accessToken}&Tag=${item.data.MediaSources[0].ETag}`,
|
||||||
|
);
|
||||||
|
setPosition(
|
||||||
|
item
|
||||||
|
.data
|
||||||
|
.UserData
|
||||||
|
.PlaybackPositionTicks,
|
||||||
|
);
|
||||||
|
setItemName(
|
||||||
|
item
|
||||||
|
.data
|
||||||
|
.Type ==
|
||||||
|
"Episode"
|
||||||
|
? `${item.data.SeriesName} S${item.data.ParentIndexNumber}:E${item.data.IndexNumber} ${item.data.Name}`
|
||||||
|
: item
|
||||||
|
.data
|
||||||
|
.Name,
|
||||||
|
);
|
||||||
|
setItemId(
|
||||||
|
item
|
||||||
|
.data
|
||||||
|
.Id,
|
||||||
|
);
|
||||||
|
setDuration(
|
||||||
|
item
|
||||||
|
.data
|
||||||
|
.RunTimeTicks,
|
||||||
|
);
|
||||||
|
setSubtitleTracksStore(
|
||||||
|
subtitleTracks,
|
||||||
|
);
|
||||||
|
setSelectedSubtitleTrack(
|
||||||
|
currentSubTrack,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
navigate(
|
||||||
|
`/player`,
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{!!item
|
||||||
|
.data
|
||||||
|
.UserData
|
||||||
|
.PlayedPercentage &&
|
||||||
|
item.data
|
||||||
|
.UserData
|
||||||
|
.PlayedPercentage >
|
||||||
|
0
|
||||||
|
? "Resume"
|
||||||
|
: "Play"}
|
||||||
|
{!!item
|
||||||
|
.data
|
||||||
|
.UserData
|
||||||
|
.PlayedPercentage && (
|
||||||
|
<LinearProgress
|
||||||
|
variant="determinate"
|
||||||
|
value={
|
||||||
|
item
|
||||||
|
.data
|
||||||
|
.UserData
|
||||||
|
.PlayedPercentage
|
||||||
|
}
|
||||||
|
color="white"
|
||||||
|
sx={{
|
||||||
|
position:
|
||||||
|
"absolute",
|
||||||
|
height: "100%",
|
||||||
|
width: "100%",
|
||||||
|
background:
|
||||||
|
"transparent",
|
||||||
|
zIndex: "0",
|
||||||
|
opacity: 0.2,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Button>
|
||||||
|
</span>
|
||||||
|
</Tooltip>
|
||||||
|
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={
|
onClick={
|
||||||
|
|||||||
Reference in new issue
Block a user