mirror of
https://github.com/jellyfin/jellyfin-chromecast.git
synced 2024-11-27 00:00:28 +00:00
Refactor to remove unnecessary property
This commit is contained in:
parent
af3db7603b
commit
64af602572
@ -485,7 +485,7 @@ const requiredItemFields: ItemFields[] = ['MediaSources', 'Chapters'];
|
||||
export function getShuffleItems(
|
||||
item: BaseItemDto
|
||||
): Promise<BaseItemDtoQueryResult> {
|
||||
const query: ItemsApiGetItemsRequest = {
|
||||
let query: ItemsApiGetItemsRequest = {
|
||||
fields: requiredItemFields,
|
||||
filters: ['IsNotFolder'],
|
||||
limit: 50,
|
||||
@ -493,28 +493,26 @@ export function getShuffleItems(
|
||||
sortBy: ['Random']
|
||||
};
|
||||
|
||||
let additionalParams: ItemsApiGetItemsRequest;
|
||||
|
||||
if (item.Type == 'MusicArtist') {
|
||||
additionalParams = {
|
||||
query = {
|
||||
...query,
|
||||
artistIds: item.Id ? [item.Id] : undefined,
|
||||
mediaTypes: ['Audio']
|
||||
};
|
||||
} else if (item.Type == 'MusicGenre') {
|
||||
additionalParams = {
|
||||
query = {
|
||||
...query,
|
||||
genres: item.Name ? [item.Name] : undefined,
|
||||
mediaTypes: ['Audio']
|
||||
};
|
||||
} else {
|
||||
additionalParams = {
|
||||
query = {
|
||||
...query,
|
||||
parentId: item.Id
|
||||
};
|
||||
}
|
||||
|
||||
return getItemsForPlayback({
|
||||
...query,
|
||||
...additionalParams
|
||||
});
|
||||
return getItemsForPlayback(query);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user