mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
various clean up and fixes
This commit is contained in:
parent
01885c1a9b
commit
c84dd648ea
6 changed files with 8 additions and 28 deletions
|
|
@ -221,10 +221,10 @@ export const AlbumDetailContent = ({ background, tableRef }: AlbumDetailContentP
|
|||
(a) => a.id !== detailQuery?.data?.id,
|
||||
).length,
|
||||
loading: relatedAlbumGenresQuery?.isLoading || relatedAlbumGenresQuery.isFetching,
|
||||
title: t('page.albumDetail.moreFromGeneric', {
|
||||
item: detailQuery?.data?.genres?.[0]?.name,
|
||||
title: `${t('page.albumDetail.moreFromGeneric', {
|
||||
item: '',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
})} ${detailQuery?.data?.genres?.[0]?.name}`,
|
||||
uniqueId: 'relatedGenres',
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/li
|
|||
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import { useCallback, useMemo, useRef } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useParams, useSearchParams } from 'react-router-dom';
|
||||
|
||||
import { api } from '/@/renderer/api';
|
||||
|
|
@ -17,7 +16,6 @@ import { usePlayQueueAdd } from '/@/renderer/features/player';
|
|||
import { AnimatedPage } from '/@/renderer/features/shared';
|
||||
import { queryClient } from '/@/renderer/lib/react-query';
|
||||
import { useCurrentServer, useListFilterByKey } from '/@/renderer/store';
|
||||
import { sentenceCase, titleCase } from '/@/renderer/utils';
|
||||
import {
|
||||
AlbumListQuery,
|
||||
GenreListSort,
|
||||
|
|
@ -27,7 +25,6 @@ import {
|
|||
import { Play } from '/@/shared/types/types';
|
||||
|
||||
const AlbumListRoute = () => {
|
||||
const { t } = useTranslation();
|
||||
const gridRef = useRef<null | VirtualInfiniteGridRef>(null);
|
||||
const tableRef = useRef<AgGridReactType | null>(null);
|
||||
const server = useCurrentServer();
|
||||
|
|
@ -135,11 +132,7 @@ const AlbumListRoute = () => {
|
|||
}, [albumArtistId, customFilters, genreId, handlePlay, pageKey]);
|
||||
|
||||
const artist = searchParams.get('artistName');
|
||||
const title = artist
|
||||
? sentenceCase(t('page.albumList.artistAlbums', { artist }))
|
||||
: genreId
|
||||
? sentenceCase(t('page.albumList.genreAlbums', { genre: titleCase(genreTitle) }))
|
||||
: undefined;
|
||||
const title = artist ? artist : genreId ? genreTitle : undefined;
|
||||
|
||||
return (
|
||||
<AnimatedPage>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ interface LibraryHeaderProps {
|
|||
|
||||
export const LibraryHeader = forwardRef(
|
||||
(
|
||||
{ background, blur, children, imageUrl, item, loading, title }: LibraryHeaderProps,
|
||||
{ background, blur, children, imageUrl, item, title }: LibraryHeaderProps,
|
||||
ref: Ref<HTMLDivElement>,
|
||||
) => {
|
||||
const { t } = useTranslation();
|
||||
|
|
@ -107,10 +107,11 @@ export const LibraryHeader = forwardRef(
|
|||
style={{ cursor: 'pointer' }}
|
||||
tabIndex={0}
|
||||
>
|
||||
{!loading && imageUrl && !isImageError && (
|
||||
{!isImageError && (
|
||||
<Image
|
||||
alt="cover"
|
||||
className={styles.image}
|
||||
loading="eager"
|
||||
onError={onImageError}
|
||||
src={imageUrl || ''}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -303,7 +303,6 @@ export const SidebarSharedPlaylistList = () => {
|
|||
|
||||
for (const playlist of data.items) {
|
||||
if (playlist.owner && playlist.owner !== server.username) {
|
||||
console.log(playlist.owner, server.username);
|
||||
shared.push(playlist);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/li
|
|||
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import { useCallback, useMemo, useRef } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useParams, useSearchParams } from 'react-router-dom';
|
||||
|
||||
import { VirtualInfiniteGridRef } from '/@/renderer/components/virtual-grid';
|
||||
|
|
@ -14,12 +13,10 @@ import { SongListContent } from '/@/renderer/features/songs/components/song-list
|
|||
import { SongListHeader } from '/@/renderer/features/songs/components/song-list-header';
|
||||
import { useSongListCount } from '/@/renderer/features/songs/queries/song-list-count-query';
|
||||
import { useCurrentServer, useListFilterByKey } from '/@/renderer/store';
|
||||
import { sentenceCase, titleCase } from '/@/renderer/utils';
|
||||
import { GenreListSort, LibraryItem, SongListQuery, SortOrder } from '/@/shared/types/domain-types';
|
||||
import { Play } from '/@/shared/types/types';
|
||||
|
||||
const TrackListRoute = () => {
|
||||
const { t } = useTranslation();
|
||||
const gridRef = useRef<null | VirtualInfiniteGridRef>(null);
|
||||
const tableRef = useRef<AgGridReactType | null>(null);
|
||||
const server = useCurrentServer();
|
||||
|
|
@ -123,15 +120,7 @@ const TrackListRoute = () => {
|
|||
}, [albumArtistId, customFilters, genreId, handlePlay, pageKey]);
|
||||
|
||||
const artist = searchParams.get('artistName');
|
||||
const title = artist
|
||||
? sentenceCase(t('page.trackList.artistTracks', { artist }))
|
||||
: genreId
|
||||
? sentenceCase(
|
||||
t('page.trackList.genreTracks', {
|
||||
genre: titleCase(genreTitle),
|
||||
}),
|
||||
)
|
||||
: undefined;
|
||||
const title = artist ? artist : genreId ? genreTitle : undefined;
|
||||
|
||||
return (
|
||||
<AnimatedPage>
|
||||
|
|
|
|||
|
|
@ -63,7 +63,5 @@ export const useFastAverageColor = (args: {
|
|||
};
|
||||
}, [algorithm, srcLoaded, src, id]);
|
||||
|
||||
console.log('background :>> ', background);
|
||||
|
||||
return { background, colorId: idRef.current };
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue