Fix library page not displaying all items #183 #182

This commit is contained in:
Prayag Prajapati committed 2023-09-30 19:11:39 +05:30
1 parent 3d75c08979
commit 52faaef201
16 files changed
+1569 -558

No files matched your search

+8 -1
View File
@@ -142,7 +142,7 @@ const PlayButton = ({
return result.data;
},
onSuccess: (item) => {
if (audio) {
if (!!trackIndex) {
setCurrentTrack(trackIndex);
setAudioTracks(item.Items);
setAudioUrl(
@@ -151,6 +151,13 @@ const PlayButton = ({
setAudioItem(item.Items[trackIndex]);
setPlaylistItemId(playlistItemId);
setAudioDisplay(true);
} else if (audio) {
setAudioTracks(item.Items);
setAudioUrl(
`${window.api.basePath}/Audio/${item.Items[0].Id}/universal?deviceId=${window.api.deviceInfo.id}&userId=${userId}&api_key=${window.api.accessToken}`,
);
setAudioItem(item.Items[0]);
setAudioDisplay(true);
} else {
setUrl(
`${window.api.basePath}/Videos/${item.Items[0].Id}/stream.
+1 -1
View File
@@ -30,7 +30,7 @@
display: flex;
position: absolute;
bottom: 1em;
width: calc(100vw - 2em);
width: calc(100vw - 8em);
left: 1em;
right: 1em;
gap: 1em;
+4 -21
View File
@@ -1,5 +1,5 @@
/** @format */
import { useEffect, useState } from "react";
import React, { useEffect, useState } from "react";
import { AnimatePresence, motion } from "framer-motion";
import IconButton from "@mui/material/IconButton";
@@ -96,34 +96,17 @@ const Carousel = ({ content, onChange }) => {
<MdiChevronRight />
</IconButton>
<div className="carousel-indicator-container">
<div
className={
currentSlide == 0
? "carousel-indicator active"
: "carousel-indicator"
}
style={{
background:
currentSlide == 0
? "white"
: "rgb(255 255 255 / 0.5)",
}}
onClick={() => {
setDirection("left");
setCurrentSlide(0);
}}
/>
{content.map((item, index) => (
<div
className={
currentSlide == index + 1
currentSlide == index
? "carousel-indicator active"
: "carousel-indicator"
}
key={index}
style={{
background:
currentSlide == index + 1
currentSlide == index
? "white"
: "rgb(255 255 255 / 0.5)",
}}
@@ -133,7 +116,7 @@ const Carousel = ({ content, onChange }) => {
} else if (currentSlide <= index) {
setDirection("right");
}
setCurrentSlide(index + 1);
setCurrentSlide(index);
}}
/>
))}
+1 -1
View File
@@ -17,7 +17,7 @@ class ErrorBoundary extends React.Component {
// in ErrorBoundary (created by App)
// in div (created by App)
// in App
logErrorToMyService(error, info.componentStack);
console.error(`Err in ${info} - ${error}`);
}
render() {
+4
View File
@@ -370,6 +370,10 @@ const Hero = ({
}}
itemUserData={item.UserData}
audio={audioPlayButton}
playlistItemId={
item.Type == BaseItemKind.Playlist &&
item.Id
}
/>
)}
{!disableLikeButton && (
+13 -2
View File
@@ -1,4 +1,5 @@
/** @format */
import React from "react";
import Typography from "@mui/material/Typography";
import "./musicTrack.module.scss";
import { getRuntimeMusic } from "../../utils/date/time";
@@ -6,6 +7,7 @@ import LikeButton from "../buttons/likeButton";
import TextLink from "../textLink";
import PlayButton from "../buttons/playButton";
import { useAudioPlayback } from "../../utils/store/audioPlayback";
import { MdiMusic } from "../icons/mdiMusic";
/**
* @typedef {Object} Props
@@ -37,6 +39,14 @@ const MusicTrack = ({
return (
<div className={`music-track ${className}`}>
<div className="music-track-image">
<div className="music-track-icon">
<MdiMusic
sx={{
fontSize: "2em !important",
fill: "url(#clr-gradient-default) !important",
}}
/>
</div>
<img
src={window.api.getItemImageUrl(
Object.keys(item.ImageTags).length == 0
@@ -93,13 +103,14 @@ const MusicTrack = ({
{item.ArtistItems.map((artist, index) => (
<>
<TextLink
text={artist.Name}
variant={"subtitle2"}
location={`/artist/${artist.Id}`}
otherProps={{
fontWeight: 400,
}}
/>
>
{artist.Name}
</TextLink>
{index != item.ArtistItems.length - 1 && (
<span
style={{
@@ -7,12 +7,25 @@
align-items: center;
justify-items: center;
width: 100%;
&-icon {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: rgb(255 255 255 / 0.09);
z-index: -1;
}
&-image {
margin: 0.4em;
border-radius: $border-radius-default;
overflow: hidden;
aspect-ratio: 1;
position: relative;
width: 4em;
&-overlay {
position: absolute;
top: 0;
@@ -27,7 +40,7 @@
transition: opacity $transition-time-fast;
}
box-shadow: 0 0 10px rgb(0 0 0 / 0.2);
transition: opacity $transition-time-fast;
transition: opacity $transition-time-default;
}
&-info {
justify-self: start;
-1
View File
@@ -1,5 +1,4 @@
/** @format */
import Typography from "@mui/material/Typography";
import { useNavigate } from "react-router-dom";