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