disable play button on series
This commit is contained in:
1 file changed
+30
-3
@@ -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,7 +1017,25 @@ const ItemDetail = () => {
|
|||||||
"Music",
|
"Music",
|
||||||
) && (
|
) && (
|
||||||
<>
|
<>
|
||||||
|
<Tooltip
|
||||||
|
title={
|
||||||
|
item.data
|
||||||
|
.Type ==
|
||||||
|
"Series"
|
||||||
|
? "Work in progress, meanwhile you can play individual episodes by clicking on episode card below"
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<span>
|
||||||
<Button
|
<Button
|
||||||
|
disabled={
|
||||||
|
item
|
||||||
|
.data
|
||||||
|
.Type ==
|
||||||
|
"Series"
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
}
|
||||||
variant="contained"
|
variant="contained"
|
||||||
size="large"
|
size="large"
|
||||||
startIcon={
|
startIcon={
|
||||||
@@ -1072,15 +1094,18 @@ const ItemDetail = () => {
|
|||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{!!item.data
|
{!!item
|
||||||
|
.data
|
||||||
.UserData
|
.UserData
|
||||||
.PlayedPercentage &&
|
.PlayedPercentage &&
|
||||||
item.data.UserData
|
item.data
|
||||||
|
.UserData
|
||||||
.PlayedPercentage >
|
.PlayedPercentage >
|
||||||
0
|
0
|
||||||
? "Resume"
|
? "Resume"
|
||||||
: "Play"}
|
: "Play"}
|
||||||
{!!item.data
|
{!!item
|
||||||
|
.data
|
||||||
.UserData
|
.UserData
|
||||||
.PlayedPercentage && (
|
.PlayedPercentage && (
|
||||||
<LinearProgress
|
<LinearProgress
|
||||||
@@ -1105,6 +1130,8 @@ const ItemDetail = () => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
|
</span>
|
||||||
|
</Tooltip>
|
||||||
|
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={
|
onClick={
|
||||||
|
|||||||
Reference in new issue
Block a user