mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
fix type errors
This commit is contained in:
parent
bc42329d27
commit
8dbaec3943
8 changed files with 53 additions and 41 deletions
|
|
@ -252,7 +252,10 @@ export const SubsonicController: ControllerEndpoint = {
|
|||
};
|
||||
},
|
||||
getAlbumArtistListCount: (args) =>
|
||||
SubsonicController.getAlbumArtistList(args).then((res) => res!.totalRecordCount!),
|
||||
SubsonicController.getAlbumArtistList({
|
||||
...args,
|
||||
query: { ...args.query, startIndex: 0 },
|
||||
}).then((res) => res!.totalRecordCount!),
|
||||
getAlbumDetail: async (args) => {
|
||||
const { apiClientProps, query } = args;
|
||||
|
||||
|
|
@ -602,7 +605,10 @@ export const SubsonicController: ControllerEndpoint = {
|
|||
};
|
||||
},
|
||||
getArtistListCount: async (args) =>
|
||||
SubsonicController.getArtistList(args).then((res) => res!.totalRecordCount!),
|
||||
SubsonicController.getArtistList({
|
||||
...args,
|
||||
query: { ...args.query, startIndex: 0 },
|
||||
}).then((res) => res!.totalRecordCount!),
|
||||
getDownloadUrl: (args) => {
|
||||
const { apiClientProps, query } = args;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import clsx from 'clsx';
|
||||
import formatDuration from 'format-duration';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { TFunction, useTranslation } from 'react-i18next';
|
||||
import { generatePath } from 'react-router';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ export const ALBUM_CARD_ROWS: { [key: string]: CardRow<Album> } = {
|
|||
property: 'duration',
|
||||
},
|
||||
explicitStatus: {
|
||||
format: (album, t) =>
|
||||
format: (album, t: TFunction) =>
|
||||
album.explicitStatus === ExplicitStatus.EXPLICIT
|
||||
? t('common.explicit', { postProcess: 'sentenceCase' })
|
||||
: album.explicitStatus === ExplicitStatus.CLEAN
|
||||
|
|
@ -250,7 +250,7 @@ export const SONG_CARD_ROWS: { [key: string]: CardRow<Song> } = {
|
|||
property: 'duration',
|
||||
},
|
||||
explicitStatus: {
|
||||
format: (song, t) =>
|
||||
format: (song, t: TFunction) =>
|
||||
song.explicitStatus === ExplicitStatus.EXPLICIT
|
||||
? t('common.explicit', { postProcess: 'sentenceCase' })
|
||||
: song.explicitStatus === ExplicitStatus.CLEAN
|
||||
|
|
|
|||
|
|
@ -129,12 +129,13 @@ export const AlbumListGridView = ({ gridRef, itemCount }: any) => {
|
|||
|
||||
const queryKey = queryKeys.albums.list(server?.id || '', query, id);
|
||||
|
||||
const queriesFromCache: [QueryKey, AlbumListResponse][] = queryClient.getQueriesData({
|
||||
exact: false,
|
||||
fetchStatus: 'idle',
|
||||
queryKey,
|
||||
stale: false,
|
||||
});
|
||||
const queriesFromCache: [QueryKey, AlbumListResponse | undefined][] =
|
||||
queryClient.getQueriesData({
|
||||
exact: false,
|
||||
fetchStatus: 'idle',
|
||||
queryKey,
|
||||
stale: false,
|
||||
});
|
||||
|
||||
const itemData: Album[] = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -45,12 +45,13 @@ export const AlbumArtistListGridView = ({ gridRef, itemCount }: AlbumArtistListG
|
|||
...filter,
|
||||
};
|
||||
|
||||
const queriesFromCache: [QueryKey, AlbumArtistListResponse][] = queryClient.getQueriesData({
|
||||
exact: false,
|
||||
fetchStatus: 'idle',
|
||||
queryKey: queryKeys.albumArtists.list(server?.id || '', query),
|
||||
stale: false,
|
||||
});
|
||||
const queriesFromCache: [QueryKey, AlbumArtistListResponse | undefined][] =
|
||||
queryClient.getQueriesData({
|
||||
exact: false,
|
||||
fetchStatus: 'idle',
|
||||
queryKey: queryKeys.albumArtists.list(server?.id || '', query),
|
||||
stale: false,
|
||||
});
|
||||
|
||||
const itemData: AlbumArtist[] = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -46,12 +46,13 @@ export const ArtistListGridView = ({ gridRef, itemCount }: ArtistListGridViewPro
|
|||
...filter,
|
||||
};
|
||||
|
||||
const queriesFromCache: [QueryKey, ArtistListResponse][] = queryClient.getQueriesData({
|
||||
exact: false,
|
||||
fetchStatus: 'idle',
|
||||
queryKey: queryKeys.artists.list(server?.id || '', query),
|
||||
stale: false,
|
||||
});
|
||||
const queriesFromCache: [QueryKey, ArtistListResponse | undefined][] =
|
||||
queryClient.getQueriesData({
|
||||
exact: false,
|
||||
fetchStatus: 'idle',
|
||||
queryKey: queryKeys.artists.list(server?.id || '', query),
|
||||
stale: false,
|
||||
});
|
||||
|
||||
const itemData: AlbumArtist[] = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -62,12 +62,13 @@ export const GenreListGridView = ({ gridRef, itemCount }: any) => {
|
|||
...filter,
|
||||
};
|
||||
|
||||
const queriesFromCache: [QueryKey, GenreListResponse][] = queryClient.getQueriesData({
|
||||
exact: false,
|
||||
fetchStatus: 'idle',
|
||||
queryKey: queryKeys.genres.list(server?.id || '', query),
|
||||
stale: false,
|
||||
});
|
||||
const queriesFromCache: [QueryKey, GenreListResponse | undefined][] =
|
||||
queryClient.getQueriesData({
|
||||
exact: false,
|
||||
fetchStatus: 'idle',
|
||||
queryKey: queryKeys.genres.list(server?.id || '', query),
|
||||
stale: false,
|
||||
});
|
||||
|
||||
const itemData: Genre[] = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -78,12 +78,13 @@ export const PlaylistListGridView = ({ gridRef, itemCount }: PlaylistListGridVie
|
|||
...filter,
|
||||
};
|
||||
|
||||
const queriesFromCache: [QueryKey, PlaylistListResponse][] = queryClient.getQueriesData({
|
||||
exact: false,
|
||||
fetchStatus: 'idle',
|
||||
queryKey: queryKeys.playlists.list(server?.id || '', query),
|
||||
stale: false,
|
||||
});
|
||||
const queriesFromCache: [QueryKey, PlaylistListResponse | undefined][] =
|
||||
queryClient.getQueriesData({
|
||||
exact: false,
|
||||
fetchStatus: 'idle',
|
||||
queryKey: queryKeys.playlists.list(server?.id || '', query),
|
||||
stale: false,
|
||||
});
|
||||
|
||||
const itemData: Playlist[] = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -140,12 +140,13 @@ export const SongListGridView = ({ gridRef, itemCount }: SongListGridViewProps)
|
|||
|
||||
const queryKey = queryKeys.songs.list(server?.id || '', query, id);
|
||||
|
||||
const queriesFromCache: [QueryKey, SongListResponse][] = queryClient.getQueriesData({
|
||||
exact: false,
|
||||
fetchStatus: 'idle',
|
||||
queryKey,
|
||||
stale: false,
|
||||
});
|
||||
const queriesFromCache: [QueryKey, SongListResponse | undefined][] =
|
||||
queryClient.getQueriesData({
|
||||
exact: false,
|
||||
fetchStatus: 'idle',
|
||||
queryKey,
|
||||
stale: false,
|
||||
});
|
||||
|
||||
const itemData: Song[] = [];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue