Add Starred albums

This commit is contained in:
simojenki
2021-04-09 10:56:19 +10:00
parent efe4b4238b
commit a08e92fb35
3 changed files with 60 additions and 6 deletions

View File

@@ -94,7 +94,7 @@ export const asResult = <T>([results, total]: [T[], number]) => ({
export type ArtistQuery = Paging;
export type AlbumQueryType = 'alphabeticalByArtist' | 'byGenre' | 'random' | 'recent' | 'frequent' | 'newest';
export type AlbumQueryType = 'alphabeticalByArtist' | 'byGenre' | 'random' | 'recent' | 'frequent' | 'newest' | 'starred';
export type AlbumQuery = Paging & {
type: AlbumQueryType;

View File

@@ -419,6 +419,7 @@ function bindSmapiSoapServiceToExpress(
container({ id: "albums", title: "Albums" }),
container({ id: "genres", title: "Genres" }),
container({ id: "randomAlbums", title: "Random" }),
container({ id: "starredAlbums", title: "Starred" }),
container({
id: "recentlyAdded",
title: "Recently Added",
@@ -433,7 +434,7 @@ function bindSmapiSoapServiceToExpress(
}),
],
index: 0,
total: 7,
total: 8,
});
case "artists":
return musicLibrary.artists(paging).then((result) => {
@@ -451,15 +452,20 @@ function bindSmapiSoapServiceToExpress(
...paging,
});
}
case "genre":
return albums({
type: "byGenre",
genre: typeId,
...paging,
});
case "randomAlbums":
return albums({
type: "random",
...paging,
});
case "genre":
case "starredAlbums":
return albums({
type: "byGenre",
genre: typeId,
type: "starred",
...paging,
});
case "recentlyAdded":