refactor: support vtt and ass subtitles
This commit is contained in:
17 files changed
+726
-452
No files matched your search
+399
-296
@@ -159,6 +159,34 @@ function LibraryView() {
|
||||
case CollectionType.Boxsets:
|
||||
result = [{ title: "Collection", value: BaseItemKind.BoxSet }];
|
||||
break;
|
||||
case CollectionType.Music:
|
||||
result = [
|
||||
{
|
||||
title: "Albums",
|
||||
value: BaseItemKind.MusicAlbum,
|
||||
},
|
||||
{
|
||||
title: "Album Artist",
|
||||
value: BaseItemKind.MusicArtist,
|
||||
},
|
||||
{
|
||||
title: "Artist",
|
||||
value: "Artist",
|
||||
},
|
||||
{
|
||||
title: "Playlist",
|
||||
value: BaseItemKind.Playlist,
|
||||
},
|
||||
{
|
||||
title: "Songs",
|
||||
value: BaseItemKind.Audio,
|
||||
},
|
||||
{
|
||||
title: "Genre",
|
||||
value: BaseItemKind.Genre,
|
||||
},
|
||||
];
|
||||
break;
|
||||
default:
|
||||
result = [];
|
||||
}
|
||||
@@ -177,16 +205,57 @@ function LibraryView() {
|
||||
|
||||
const [sortBy, setSortBy] = useState<ItemSortBy>("Name");
|
||||
const [sortAscending, setSortAscending] = useState(true);
|
||||
const disableSort = useMemo(() => {
|
||||
switch (currentViewType) {
|
||||
case BaseItemKind.Genre:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}, [currentViewType]);
|
||||
const sortByOptions: SortByObject[] = useMemo(() => {
|
||||
let result: SortByObject[] = undefined!;
|
||||
switch (currentViewType) {
|
||||
case BaseItemKind.Audio:
|
||||
result = [
|
||||
{
|
||||
title: "Track Name",
|
||||
value: ItemSortBy.Name,
|
||||
},
|
||||
{
|
||||
title: "Album",
|
||||
value: ItemSortBy.Album,
|
||||
},
|
||||
{
|
||||
title: "Album Artist",
|
||||
value: ItemSortBy.AlbumArtist,
|
||||
},
|
||||
{
|
||||
title: "Artist",
|
||||
value: ItemSortBy.Artist,
|
||||
},
|
||||
{
|
||||
title: "Date Added",
|
||||
value: ItemSortBy.DateCreated,
|
||||
},
|
||||
{
|
||||
title: "Date Played",
|
||||
value: ItemSortBy.DatePlayed,
|
||||
},
|
||||
{
|
||||
title: "Play Count",
|
||||
value: ItemSortBy.PlayCount,
|
||||
},
|
||||
{
|
||||
title: "Release Date",
|
||||
value: ItemSortBy.PremiereDate,
|
||||
},
|
||||
{
|
||||
title: "Runtime",
|
||||
value: ItemSortBy.Runtime,
|
||||
},
|
||||
{
|
||||
title: "Random",
|
||||
value: ItemSortBy.Random,
|
||||
},
|
||||
];
|
||||
break;
|
||||
default:
|
||||
result = [];
|
||||
break;
|
||||
}
|
||||
switch (currentLib.data?.CollectionType) {
|
||||
case CollectionType.Movies:
|
||||
result = [
|
||||
@@ -312,13 +381,10 @@ function LibraryView() {
|
||||
},
|
||||
];
|
||||
break;
|
||||
default:
|
||||
result = [];
|
||||
break;
|
||||
}
|
||||
setSortBy(result?.[0]?.value);
|
||||
return result;
|
||||
}, [currentLib.data?.CollectionType]);
|
||||
}, [currentLib.data?.CollectionType, currentViewType]);
|
||||
useLayoutEffect(() => {}, [sortByOptions]);
|
||||
|
||||
const [filters, setFilters] = useState<Record<string, undefined | boolean>>({
|
||||
@@ -361,6 +427,11 @@ function LibraryView() {
|
||||
userId: user.data?.Id,
|
||||
parentId: id,
|
||||
});
|
||||
} else if (currentViewType === "Artist") {
|
||||
result = await getArtistsApi(api).getArtists({
|
||||
userId: user.data?.Id,
|
||||
parentId: id,
|
||||
});
|
||||
} else if (currentViewType === "Person") {
|
||||
result = await getPersonsApi(api).getPersons({
|
||||
userId: user.data?.Id,
|
||||
@@ -460,6 +531,33 @@ function LibraryView() {
|
||||
// gcTime: 0,
|
||||
});
|
||||
|
||||
const disableSort = useMemo(() => {
|
||||
if (items.data?.TotalRecordCount === 0) {
|
||||
return true; // Hide sorting options if library is empty
|
||||
}
|
||||
switch (currentViewType) {
|
||||
case BaseItemKind.MusicArtist:
|
||||
case BaseItemKind.Person:
|
||||
case BaseItemKind.MusicGenre:
|
||||
case BaseItemKind.Genre:
|
||||
case "Artist":
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}, [currentViewType, items.isSuccess]);
|
||||
const disableFilters = useMemo(() => {
|
||||
switch (currentViewType) {
|
||||
case BaseItemKind.Movie:
|
||||
case BaseItemKind.Audio:
|
||||
case BaseItemKind.Series:
|
||||
case BaseItemKind.BoxSet:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}, [currentViewType]);
|
||||
|
||||
const cardSize = useMemo(
|
||||
() =>
|
||||
items.data?.Items?.[0]?.Type === BaseItemKind.MusicAlbum ||
|
||||
@@ -487,23 +585,15 @@ function LibraryView() {
|
||||
const virtualizer = useWindowVirtualizer({
|
||||
count,
|
||||
estimateSize: () => cardSize,
|
||||
overscan: 7,
|
||||
overscan: 1,
|
||||
});
|
||||
|
||||
const disabledSortViews = [
|
||||
"MusicArtist",
|
||||
"Person",
|
||||
"Genre",
|
||||
"MusicGenre",
|
||||
"Studio",
|
||||
];
|
||||
const allowedFilterViews: allowedFilters = [
|
||||
CollectionType.Movies,
|
||||
CollectionType.Tvshows,
|
||||
CollectionType.Music,
|
||||
CollectionType.Books,
|
||||
];
|
||||
const onlyStatusFilterViews = ["books", "music"];
|
||||
const rowVirtualizer = useWindowVirtualizer({
|
||||
count: items.data?.TotalRecordCount ?? 1,
|
||||
estimateSize: () => 80,
|
||||
overscan: 4,
|
||||
});
|
||||
// const onlyStatusFilterViews = ["books", "music"];
|
||||
|
||||
const [filterButtonAnchorEl, setFilterButtonAnchorEl] =
|
||||
useState<HTMLButtonElement | null>(null);
|
||||
@@ -523,26 +613,20 @@ function LibraryView() {
|
||||
threshold: 20,
|
||||
});
|
||||
|
||||
const [backdropItems, setBackdropItems] = useState<BaseItemDto[] | undefined>(
|
||||
[],
|
||||
);
|
||||
useEffect(() => {
|
||||
// Filter all items having backdrop images for library backdrop
|
||||
const backdropItems = useMemo(() => {
|
||||
if (items.isSuccess) {
|
||||
const backdropItemsTemp = items.data.Items?.filter(
|
||||
const temp = items.data.Items?.filter(
|
||||
(item) => item.BackdropImageTags?.length,
|
||||
);
|
||||
const backdropItem = backdropItemsTemp?.[0];
|
||||
// enqueueSnackbar("Running");
|
||||
setBackdrop(
|
||||
api?.getItemImageUrl(backdropItem?.Id ?? "", "Backdrop", {
|
||||
tag: backdropItem?.BackdropImageTags?.[0],
|
||||
api.getItemImageUrl(temp?.[0]?.Id, "Backdrop", {
|
||||
tag: temp?.[0]?.BackdropImageTags?.[0],
|
||||
}),
|
||||
backdropItem?.BackdropImageTags?.[0] ?? "none",
|
||||
temp?.[0]?.BackdropImageTags?.[0] ?? "none",
|
||||
);
|
||||
setBackdropItems(backdropItemsTemp);
|
||||
return temp;
|
||||
}
|
||||
}, [items.isSuccess]);
|
||||
}, [items]);
|
||||
|
||||
useEffect(() => {
|
||||
if (backdropItems?.length) {
|
||||
@@ -657,7 +741,7 @@ function LibraryView() {
|
||||
</IconButton>
|
||||
<TextField
|
||||
select
|
||||
value={sortBy}
|
||||
value={sortBy ?? "Name"}
|
||||
size="small"
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) =>
|
||||
setSortBy(e.target.value)
|
||||
@@ -687,232 +771,236 @@ function LibraryView() {
|
||||
))}
|
||||
</TextField>
|
||||
)}
|
||||
<>
|
||||
<Button
|
||||
startIcon={
|
||||
<span className="material-symbols-rounded">
|
||||
filter_list
|
||||
</span>
|
||||
}
|
||||
size="large"
|
||||
color="white"
|
||||
onClick={handleFilterDropdown}
|
||||
>
|
||||
Filter
|
||||
</Button>
|
||||
<Menu
|
||||
open={filterMenuOpen}
|
||||
anchorEl={filterButtonAnchorEl}
|
||||
onClose={() => setFilterButtonAnchorEl(null)}
|
||||
slotProps={{
|
||||
paper: {
|
||||
style: {
|
||||
width: "28em",
|
||||
maxHeight: "32em",
|
||||
{!disableFilters && (
|
||||
<>
|
||||
<Button
|
||||
startIcon={
|
||||
<span className="material-symbols-rounded">
|
||||
filter_list
|
||||
</span>
|
||||
}
|
||||
size="large"
|
||||
color="white"
|
||||
onClick={handleFilterDropdown}
|
||||
>
|
||||
Filter
|
||||
</Button>
|
||||
<Menu
|
||||
open={filterMenuOpen}
|
||||
anchorEl={filterButtonAnchorEl}
|
||||
onClose={() => setFilterButtonAnchorEl(null)}
|
||||
slotProps={{
|
||||
paper: {
|
||||
style: {
|
||||
width: "28em",
|
||||
maxHeight: "32em",
|
||||
},
|
||||
},
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
variant="h6"
|
||||
fontWeight={600}
|
||||
mx="0.4em"
|
||||
mb={0.5}
|
||||
>
|
||||
Filters
|
||||
</Typography>
|
||||
<FormControl
|
||||
style={{
|
||||
background: "rgb(0 0 0 / 0.4)",
|
||||
width: "100%",
|
||||
padding: "0.4em 1em",
|
||||
borderRadius: "6px",
|
||||
}}
|
||||
>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.isPlayed} />}
|
||||
label="Played"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
isPlayed: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.isUnPlayed} />}
|
||||
label="Unplayed"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
isUnPlayed: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.isResumable} />}
|
||||
label="Resumable"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
isResumable: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.isFavorite} />}
|
||||
label="Favorites"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
isFavorite: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
<Typography
|
||||
variant="h6"
|
||||
fontWeight={600}
|
||||
mx="0.4em"
|
||||
mb={0.5}
|
||||
>
|
||||
Features
|
||||
</Typography>
|
||||
<FormControl
|
||||
style={{
|
||||
background: "rgb(0 0 0 / 0.4)",
|
||||
width: "100%",
|
||||
padding: "0.4em 1em",
|
||||
borderRadius: "6px",
|
||||
}}
|
||||
>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.hasSubtitles} />}
|
||||
label="Subtitles"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
hasSubtitles: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.hasTrailer} />}
|
||||
label="Trailer"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
hasTrailer: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox checked={filters.hasSpecialFeature} />
|
||||
}
|
||||
label="Special Features"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
hasSpecialFeature: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.hasThemeSong} />}
|
||||
label="Theme Song"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
hasThemeSong: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.hasThemeVideo} />}
|
||||
label="Theme Video"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
hasThemeVideo: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
<Typography
|
||||
variant="h6"
|
||||
fontWeight={600}
|
||||
mx="0.4em"
|
||||
mb={0.5}
|
||||
>
|
||||
Video Types
|
||||
</Typography>
|
||||
<FormControl
|
||||
style={{
|
||||
background: "rgb(0 0 0 / 0.4)",
|
||||
width: "100%",
|
||||
padding: "0.4em 1em",
|
||||
borderRadius: "6px",
|
||||
}}
|
||||
>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={videoTypesState.BluRay} />}
|
||||
label="BluRay"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setVideoTypesState((s) => ({
|
||||
...s,
|
||||
BluRay: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={videoTypesState.Dvd} />}
|
||||
label="DVD"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setVideoTypesState((s) => ({
|
||||
...s,
|
||||
Dvd: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.isHD} />}
|
||||
label="HD"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) => {
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
isHD: e.target.checked,
|
||||
}));
|
||||
<Typography
|
||||
variant="h6"
|
||||
fontWeight={600}
|
||||
mx="0.4em"
|
||||
mb={0.5}
|
||||
>
|
||||
Filters
|
||||
</Typography>
|
||||
<FormControl
|
||||
style={{
|
||||
background: "rgb(0 0 0 / 0.4)",
|
||||
width: "100%",
|
||||
padding: "0.4em 1em",
|
||||
borderRadius: "6px",
|
||||
}}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.is4K} />}
|
||||
label="4k"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
is4K: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={false} />}
|
||||
label="SD"
|
||||
disabled
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox value={filters.is3D} />}
|
||||
label="3D"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
is3D: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
</Menu>
|
||||
</>
|
||||
>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.isPlayed} />}
|
||||
label="Played"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
isPlayed: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.isUnPlayed} />}
|
||||
label="Unplayed"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
isUnPlayed: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.isResumable} />}
|
||||
label="Resumable"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
isResumable: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.isFavorite} />}
|
||||
label="Favorites"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
isFavorite: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
<Typography
|
||||
variant="h6"
|
||||
fontWeight={600}
|
||||
mx="0.4em"
|
||||
mb={0.5}
|
||||
>
|
||||
Features
|
||||
</Typography>
|
||||
<FormControl
|
||||
style={{
|
||||
background: "rgb(0 0 0 / 0.4)",
|
||||
width: "100%",
|
||||
padding: "0.4em 1em",
|
||||
borderRadius: "6px",
|
||||
}}
|
||||
>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.hasSubtitles} />}
|
||||
label="Subtitles"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
hasSubtitles: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.hasTrailer} />}
|
||||
label="Trailer"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
hasTrailer: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox checked={filters.hasSpecialFeature} />
|
||||
}
|
||||
label="Special Features"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
hasSpecialFeature: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.hasThemeSong} />}
|
||||
label="Theme Song"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
hasThemeSong: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.hasThemeVideo} />}
|
||||
label="Theme Video"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
hasThemeVideo: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
<Typography
|
||||
variant="h6"
|
||||
fontWeight={600}
|
||||
mx="0.4em"
|
||||
mb={0.5}
|
||||
>
|
||||
Video Types
|
||||
</Typography>
|
||||
<FormControl
|
||||
style={{
|
||||
background: "rgb(0 0 0 / 0.4)",
|
||||
width: "100%",
|
||||
padding: "0.4em 1em",
|
||||
borderRadius: "6px",
|
||||
}}
|
||||
>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox checked={videoTypesState.BluRay} />
|
||||
}
|
||||
label="BluRay"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setVideoTypesState((s) => ({
|
||||
...s,
|
||||
BluRay: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={videoTypesState.Dvd} />}
|
||||
label="DVD"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setVideoTypesState((s) => ({
|
||||
...s,
|
||||
Dvd: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.isHD} />}
|
||||
label="HD"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) => {
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
isHD: e.target.checked,
|
||||
}));
|
||||
}}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={filters.is4K} />}
|
||||
label="4k"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
is4K: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={false} />}
|
||||
label="SD"
|
||||
disabled
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={<Checkbox value={filters.is3D} />}
|
||||
label="3D"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setFilters((s) => ({
|
||||
...s,
|
||||
is3D: e.target.checked,
|
||||
}))
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
</Menu>
|
||||
</>
|
||||
)}
|
||||
</Stack>
|
||||
</div>
|
||||
)}
|
||||
@@ -1036,41 +1124,56 @@ function LibraryView() {
|
||||
) : (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
height: `${rowVirtualizer.getTotalSize()}px`,
|
||||
width: "100%",
|
||||
position: "relative",
|
||||
}}
|
||||
>
|
||||
{items.data.Items.map((item) => (
|
||||
<MusicTrack
|
||||
item={item}
|
||||
key={item.Id}
|
||||
// queryKey={[
|
||||
// "libraryView",
|
||||
// "currentLibItems",
|
||||
// id,
|
||||
// {
|
||||
// currentViewType: currentViewType,
|
||||
// sortAscending: sortAscending,
|
||||
// sortBy: sortBy,
|
||||
// extraFilters: {
|
||||
// hasSubtitles: hasSubtitles,
|
||||
// hasTrailer: hasTrailer,
|
||||
// hasSpecialFeature: hasSpecialFeature,
|
||||
// hasThemeSong: hasThemeSong,
|
||||
// hasThemeVideo: hasThemeVideo,
|
||||
// },
|
||||
// qualityFilters: {
|
||||
// isBluRay: isBluRay,
|
||||
// isDVD: isDVD,
|
||||
// isHD: isHD,
|
||||
// is4K: is4K,
|
||||
// is3D: is3D,
|
||||
// },
|
||||
// },
|
||||
// ]}
|
||||
userId={user.data.Id}
|
||||
/>
|
||||
))}
|
||||
{rowVirtualizer.getVirtualItems().map((virtualRow) => {
|
||||
const item = items.data?.Items?.[virtualRow.index];
|
||||
return (
|
||||
<div
|
||||
key={item.Id}
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
width: "100%",
|
||||
height: `${virtualRow.size}px`,
|
||||
transform: `translateY(${virtualRow.start}px)`,
|
||||
}}
|
||||
>
|
||||
<MusicTrack
|
||||
item={item}
|
||||
// queryKey={[
|
||||
// "libraryView",
|
||||
// "currentLibItems",
|
||||
// id,
|
||||
// {
|
||||
// currentViewType: currentViewType,
|
||||
// sortAscending: sortAscending,
|
||||
// sortBy: sortBy,
|
||||
// extraFilters: {
|
||||
// hasSubtitles: hasSubtitles,
|
||||
// hasTrailer: hasTrailer,
|
||||
// hasSpecialFeature: hasSpecialFeature,
|
||||
// hasThemeSong: hasThemeSong,
|
||||
// hasThemeVideo: hasThemeVideo,
|
||||
// },
|
||||
// qualityFilters: {
|
||||
// isBluRay: isBluRay,
|
||||
// isDVD: isDVD,
|
||||
// isHD: isHD,
|
||||
// is4K: is4K,
|
||||
// is3D: is3D,
|
||||
// },
|
||||
// },
|
||||
// ]}
|
||||
userId={user.data?.Id}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user