fix: blink not launching or rendering on opening
This commit is contained in:
31 files changed
+546
-279
No files matched your search
@@ -50,9 +50,10 @@ import { useBackdropStore } from "@/utils/store/backdrop";
|
||||
import "./album.scss";
|
||||
|
||||
import TagChip from "@/components/tagChip";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import { Link, createFileRoute } from "@tanstack/react-router";
|
||||
import lyricsIcon from "../../../assets/icons/lyrics.svg";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
@@ -302,10 +303,14 @@ function MusicAlbumTitlePage() {
|
||||
<img
|
||||
className="item-info-sidebar-image"
|
||||
alt={item.data.Name ?? "Album"}
|
||||
src={api.getItemImageUrl(item.data.Id, "Primary", {
|
||||
tag: item.data.ImageTags.Primary,
|
||||
quality: 90,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id,
|
||||
"Primary",
|
||||
{
|
||||
tag: item.data.ImageTags.Primary,
|
||||
quality: 90,
|
||||
},
|
||||
)}
|
||||
/>
|
||||
) : (
|
||||
<div className="item-info-sidebar-icon">
|
||||
@@ -333,9 +338,13 @@ function MusicAlbumTitlePage() {
|
||||
<img
|
||||
className="item-info-sidebar-artist-image"
|
||||
alt={artist.Name ?? "Artist"}
|
||||
src={api.getItemImageUrl(artist.Id, "Primary", {
|
||||
quality: 90,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
artist.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 90,
|
||||
},
|
||||
)}
|
||||
/>
|
||||
<span className="material-symbols-rounded">artist</span>
|
||||
</div>
|
||||
|
||||
@@ -36,8 +36,9 @@ import "./artist.scss";
|
||||
|
||||
import IconLink from "@/components/iconLink";
|
||||
import { getTypeIcon } from "@/components/utils/iconsCollection";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
@@ -219,9 +220,13 @@ function ArtistTitlePage() {
|
||||
<div className="item-hero-backdrop-container">
|
||||
<motion.img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id,
|
||||
"Backdrop",
|
||||
{
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
},
|
||||
)}
|
||||
className="item-hero-backdrop"
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
@@ -249,10 +254,14 @@ function ArtistTitlePage() {
|
||||
/>
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Primary", {
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
},
|
||||
)}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
@@ -269,11 +278,15 @@ function ArtistTitlePage() {
|
||||
{Object.keys(item.data.ImageTags).includes("Logo") ? (
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Logo", {
|
||||
quality: 90,
|
||||
fillWidth: 592,
|
||||
fillHeight: 592,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id,
|
||||
"Logo",
|
||||
{
|
||||
quality: 90,
|
||||
fillWidth: 592,
|
||||
fillHeight: 592,
|
||||
},
|
||||
)}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
|
||||
@@ -39,8 +39,9 @@ import "./boxset.scss";
|
||||
|
||||
import IconLink from "@/components/iconLink";
|
||||
import { getTypeIcon } from "@/components/utils/iconsCollection";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
@@ -179,9 +180,13 @@ function BoxSetTitlePage() {
|
||||
{item.data.BackdropImageTags?.length ? (
|
||||
<motion.img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id,
|
||||
"Backdrop",
|
||||
{
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
},
|
||||
)}
|
||||
className="item-hero-backdrop"
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
@@ -222,10 +227,14 @@ function BoxSetTitlePage() {
|
||||
/>
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Primary", {
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
},
|
||||
)}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
@@ -242,11 +251,15 @@ function BoxSetTitlePage() {
|
||||
{Object.keys(item.data.ImageTags).includes("Logo") ? (
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Logo", {
|
||||
quality: 90,
|
||||
fillWidth: 592,
|
||||
fillHeight: 592,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id,
|
||||
"Logo",
|
||||
{
|
||||
quality: 90,
|
||||
fillWidth: 592,
|
||||
fillHeight: 592,
|
||||
},
|
||||
)}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
|
||||
@@ -64,8 +64,9 @@ import sdrIcon from "@/assets/icons/sdr.svg";
|
||||
import type MediaQualityInfo from "@/utils/types/mediaQualityInfo";
|
||||
|
||||
import IconLink from "@/components/iconLink";
|
||||
import { Link, createFileRoute } from "@tanstack/react-router";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import { Link, createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
@@ -350,7 +351,7 @@ function EpisodeTitlePage() {
|
||||
{item.data.ParentBackdropImageTags?.length ? (
|
||||
<motion.img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.ParentBackdropItemId,
|
||||
"Backdrop",
|
||||
{
|
||||
@@ -397,10 +398,14 @@ function EpisodeTitlePage() {
|
||||
/>
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Primary", {
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
},
|
||||
)}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
@@ -428,11 +433,15 @@ function EpisodeTitlePage() {
|
||||
{item.data.ParentLogoItemId?.length > 0 ? (
|
||||
<img
|
||||
alt={item.data.SeriesName}
|
||||
src={api.getItemImageUrl(item.data.ParentLogoItemId, "Logo", {
|
||||
quality: 90,
|
||||
fillWidth: 592,
|
||||
fillHeight: 592,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.ParentLogoItemId,
|
||||
"Logo",
|
||||
{
|
||||
quality: 90,
|
||||
fillWidth: 592,
|
||||
fillHeight: 592,
|
||||
},
|
||||
)}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
@@ -838,11 +847,15 @@ function EpisodeTitlePage() {
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
@@ -884,11 +897,15 @@ function EpisodeTitlePage() {
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
@@ -930,11 +947,15 @@ function EpisodeTitlePage() {
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
@@ -976,11 +997,15 @@ function EpisodeTitlePage() {
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
|
||||
@@ -23,6 +23,7 @@ import { createFileRoute, useNavigate } from "@tanstack/react-router";
|
||||
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||
|
||||
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import {
|
||||
@@ -176,7 +177,7 @@ function Home() {
|
||||
if (latestMedia.isSuccess && latestMedia.data.length > 0) {
|
||||
if (latestMedia.data[now]?.ParentBackdropImageTags) {
|
||||
setBackdrop(
|
||||
api.getItemImageUrl(
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
latestMedia.data[now].Id,
|
||||
"Backdrop",
|
||||
{
|
||||
@@ -189,7 +190,7 @@ function Home() {
|
||||
);
|
||||
} else {
|
||||
setBackdrop(
|
||||
api.getItemImageUrl(
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
latestMedia.data[now].Id,
|
||||
"Backdrop",
|
||||
{
|
||||
|
||||
@@ -68,8 +68,9 @@ import type MediaQualityInfo from "@/utils/types/mediaQualityInfo";
|
||||
|
||||
import IconLink from "@/components/iconLink";
|
||||
import { queryClient } from "@/main";
|
||||
import { Link, createFileRoute } from "@tanstack/react-router";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import { Link, createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
@@ -372,9 +373,13 @@ function ItemDetail() {
|
||||
{item.data.BackdropImageTags?.length ? (
|
||||
<motion.img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id,
|
||||
"Backdrop",
|
||||
{
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
},
|
||||
)}
|
||||
className="item-hero-backdrop"
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
@@ -415,10 +420,14 @@ function ItemDetail() {
|
||||
/>
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Primary", {
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
},
|
||||
)}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
@@ -435,12 +444,16 @@ function ItemDetail() {
|
||||
{item.data.ImageTags?.Logo ? (
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Logo", {
|
||||
quality: 90,
|
||||
fillWidth: 592,
|
||||
fillHeight: 592,
|
||||
tag: item.data.ImageTags.Logo,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id,
|
||||
"Logo",
|
||||
{
|
||||
quality: 90,
|
||||
fillWidth: 592,
|
||||
fillHeight: 592,
|
||||
tag: item.data.ImageTags.Logo,
|
||||
},
|
||||
)}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
@@ -829,11 +842,15 @@ function ItemDetail() {
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
@@ -872,11 +889,15 @@ function ItemDetail() {
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
@@ -918,11 +939,15 @@ function ItemDetail() {
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
@@ -964,11 +989,15 @@ function ItemDetail() {
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
|
||||
@@ -50,9 +50,10 @@ import { useWindowVirtualizer } from "@tanstack/react-virtual";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import "./library.scss";
|
||||
import LibraryItemsSkeleton from "@/components/skeleton/libraryItems";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
type SortByObject = { title: string; value: ItemSortBy };
|
||||
type ViewObject = { title: string; value: BaseItemKind | "Artist" };
|
||||
@@ -692,7 +693,7 @@ function LibraryView() {
|
||||
);
|
||||
if (temp?.[0]?.Id) {
|
||||
setBackdrop(
|
||||
api.getItemImageUrl(temp?.[0]?.Id, "Backdrop", {
|
||||
getImageUrlsApi(api).getItemImageUrlById(temp?.[0]?.Id, "Backdrop", {
|
||||
tag: temp?.[0]?.BackdropImageTags?.[0],
|
||||
}),
|
||||
temp?.[0]?.BackdropImageTags?.[0] ?? "none",
|
||||
@@ -709,9 +710,13 @@ function LibraryView() {
|
||||
const backdropItem = backdropItems[itemIndex];
|
||||
// enqueueSnackbar("Running");
|
||||
setBackdrop(
|
||||
api?.getItemImageUrl(backdropItem.Id ?? "", "Backdrop", {
|
||||
tag: backdropItem.BackdropImageTags?.[0],
|
||||
}),
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
backdropItem.Id ?? "",
|
||||
"Backdrop",
|
||||
{
|
||||
tag: backdropItem.BackdropImageTags?.[0],
|
||||
},
|
||||
),
|
||||
backdropItem.BackdropImageTags?.[0] ?? "none",
|
||||
);
|
||||
}, 14000); // Update backdrop every 14s
|
||||
|
||||
@@ -34,8 +34,9 @@ import ShowMoreText from "@/components/showMoreText";
|
||||
import "./person.scss";
|
||||
|
||||
import IconLink from "@/components/iconLink";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
@@ -311,10 +312,14 @@ function PersonTitlePage() {
|
||||
/>
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Primary", {
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
},
|
||||
)}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
|
||||
@@ -17,6 +17,7 @@ import PlayNextButton from "@/components/buttons/playNextButton";
|
||||
import PlayPreviousButton from "@/components/buttons/playPreviousButtom";
|
||||
import QueueTrack from "@/components/queueTrack";
|
||||
import { getRuntimeMusic, secToTicks, ticksToSec } from "@/utils/date/time";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { getLyricsApi } from "@jellyfin/sdk/lib/utils/api/lyrics-api";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
@@ -84,9 +85,13 @@ function AudioPlayerRoute() {
|
||||
{item?.ImageTags?.Primary ? (
|
||||
<img
|
||||
alt={item.Name ?? "Music"}
|
||||
src={api.getItemImageUrl(item.Id, "Primary", {
|
||||
tag: item.ImageTags.Primary,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.Id,
|
||||
"Primary",
|
||||
{
|
||||
tag: item.ImageTags.Primary,
|
||||
},
|
||||
)}
|
||||
className="audio-info-image"
|
||||
/>
|
||||
) : (
|
||||
|
||||
@@ -10,6 +10,7 @@ import brokenImage from "/assetsStatic/broken-image.png?url";
|
||||
import { save } from "@tauri-apps/plugin-dialog";
|
||||
|
||||
import "./photos.scss";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import {
|
||||
Button,
|
||||
CircularProgress,
|
||||
@@ -48,7 +49,7 @@ function PhotosPlayer() {
|
||||
<img
|
||||
src={
|
||||
item.Id
|
||||
? api.getItemImageUrl(item.Id, "Primary", {
|
||||
? getImageUrlsApi(api).getItemImageUrl(item.Id, "Primary", {
|
||||
// width: 250,
|
||||
fillWidth: 250,
|
||||
quality: 70,
|
||||
@@ -90,8 +91,6 @@ function PhotosPlayer() {
|
||||
setContextMenu(null);
|
||||
}, []);
|
||||
|
||||
const [downloadProgress, setDownloadProgress] = useState(0);
|
||||
|
||||
const handleImageDownload = useCallback(async () => {
|
||||
const pathToSave = await save({
|
||||
filters: [
|
||||
@@ -107,7 +106,7 @@ function PhotosPlayer() {
|
||||
`${api.basePath}/Items/${currentPhoto?.Id}/Download?api_key=${api.accessToken}`,
|
||||
pathToSave,
|
||||
);
|
||||
enqueueSnackbar("Image downloaded!", { variant: "success" });
|
||||
enqueueSnackbar("Image download queued.", { variant: "info" });
|
||||
}
|
||||
}, [currentIndex]);
|
||||
|
||||
|
||||
@@ -59,9 +59,10 @@ import { setBackdrop, useBackdropStore } from "@/utils/store/backdrop";
|
||||
|
||||
import IconLink from "@/components/iconLink";
|
||||
import EpisodeSkeleton from "@/components/skeleton/episode";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import { createFileRoute, useNavigate } from "@tanstack/react-router";
|
||||
import { Link } from "@tanstack/react-router";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
@@ -228,13 +229,13 @@ function SeriesTitlePage() {
|
||||
useLayoutEffect(() => {
|
||||
if (item.isSuccess) {
|
||||
// setBackdropImage({
|
||||
// url: api.getItemImageUrl(item.data?.Id, "Backdrop", {
|
||||
// url: getImageUrlsApi(api).getItemImageUrlById(item.data?.Id, "Backdrop", {
|
||||
// tag: item.data?.BackdropImageTags[0],
|
||||
// }),
|
||||
// key: item.data?.BackdropImageTags[0],
|
||||
// });
|
||||
// setBackdrop(
|
||||
// api.getItemImageUrl(item.data?.Id, "Backdrop", {
|
||||
// getImageUrlsApi(api).getItemImageUrlById(item.data?.Id, "Backdrop", {
|
||||
// tag: item.data?.BackdropImageTags[0],
|
||||
// }),
|
||||
// item.data.Id,
|
||||
@@ -275,31 +276,43 @@ function SeriesTitlePage() {
|
||||
) {
|
||||
sessionStorage.setItem(
|
||||
`backdrop-${item.data?.Id}`,
|
||||
api.getItemImageUrl(currentSeasonItem.data.Id, "Backdrop", {
|
||||
tag: currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
}),
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
currentSeasonItem.data.Id,
|
||||
"Backdrop",
|
||||
{
|
||||
tag: currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
},
|
||||
),
|
||||
);
|
||||
sessionStorage.setItem(
|
||||
`backdrop-${item.data?.Id}-key`,
|
||||
currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
);
|
||||
setBackdropImage({
|
||||
url: api.getItemImageUrl(currentSeasonItem.data.Id, "Backdrop", {
|
||||
tag: currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
}),
|
||||
url: getImageUrlsApi(api).getItemImageUrlById(
|
||||
currentSeasonItem.data.Id,
|
||||
"Backdrop",
|
||||
{
|
||||
tag: currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
},
|
||||
),
|
||||
key: currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
});
|
||||
setBackdrop(
|
||||
api.getItemImageUrl(currentSeasonItem.data.Id, "Backdrop", {
|
||||
tag: currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
}),
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
currentSeasonItem.data.Id,
|
||||
"Backdrop",
|
||||
{
|
||||
tag: currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
},
|
||||
),
|
||||
currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
);
|
||||
setBackdropImageLoaded(false);
|
||||
} else if (item.isSuccess && item.data?.BackdropImageTags?.length > 0) {
|
||||
sessionStorage.setItem(
|
||||
`backdrop-${item.data?.Id}`,
|
||||
api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
getImageUrlsApi(api).getItemImageUrlById(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags?.[0],
|
||||
}),
|
||||
);
|
||||
@@ -311,13 +324,17 @@ function SeriesTitlePage() {
|
||||
setBackdropImageLoaded(false); // Reset Backdrop image load status if previous image is diff then new image
|
||||
}
|
||||
setBackdropImage({
|
||||
url: api.getItemImageUrl(item.data?.Id, "Backdrop", {
|
||||
tag: item.data?.BackdropImageTags?.[0],
|
||||
}),
|
||||
url: getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data?.Id,
|
||||
"Backdrop",
|
||||
{
|
||||
tag: item.data?.BackdropImageTags?.[0],
|
||||
},
|
||||
),
|
||||
key: item.data?.BackdropImageTags?.[0],
|
||||
});
|
||||
setBackdrop(
|
||||
api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
getImageUrlsApi(api).getItemImageUrlById(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags?.[0],
|
||||
}),
|
||||
item.data.BackdropImageTags?.[0],
|
||||
@@ -430,10 +447,14 @@ function SeriesTitlePage() {
|
||||
/>
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Primary", {
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
},
|
||||
)}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
@@ -450,11 +471,15 @@ function SeriesTitlePage() {
|
||||
{Object.keys(item.data.ImageTags).includes("Logo") ? (
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Logo", {
|
||||
quality: 90,
|
||||
fillWidth: 592,
|
||||
fillHeight: 592,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id,
|
||||
"Logo",
|
||||
{
|
||||
quality: 90,
|
||||
fillWidth: 592,
|
||||
fillHeight: 592,
|
||||
},
|
||||
)}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
@@ -664,11 +689,15 @@ function SeriesTitlePage() {
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
@@ -712,11 +741,15 @@ function SeriesTitlePage() {
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
@@ -760,11 +793,15 @@ function SeriesTitlePage() {
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
@@ -808,11 +845,15 @@ function SeriesTitlePage() {
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
@@ -1035,10 +1076,14 @@ function SeriesTitlePage() {
|
||||
</div>
|
||||
<img
|
||||
alt={episode.Name}
|
||||
src={api.getItemImageUrl(episode.Id, "Primary", {
|
||||
tag: episode.ImageTags.Primary,
|
||||
fillHeight: 300,
|
||||
})}
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
episode.Id,
|
||||
"Primary",
|
||||
{
|
||||
tag: episode.ImageTags.Primary,
|
||||
fillHeight: 300,
|
||||
},
|
||||
)}
|
||||
className="item-detail-episode-image"
|
||||
onLoad={(e) => {
|
||||
e.target.style.opacity = 1;
|
||||
|
||||
Reference in new issue
Block a user