Add index.ts for subsonic

This commit is contained in:
simojenki
2022-02-05 10:46:24 +11:00
parent 25857d7e5a
commit ac266a3c46
5 changed files with 111 additions and 105 deletions

22
src/subsonic/navidrome.ts Normal file
View File

@@ -0,0 +1,22 @@
import { ArtistSummary, Sortable } from "../music_service";
import { artistImageURN } from "./generic";
export type NDArtist = {
id: string;
name: string;
orderArtistName: string | undefined;
largeImageUrl: string | undefined;
};
export const artistSummaryFromNDArtist = (
artist: NDArtist
): ArtistSummary & Sortable => ({
id: artist.id,
name: artist.name,
sortName: artist.orderArtistName || artist.name,
image: artistImageURN({
artistId: artist.id,
artistImageURL: artist.largeImageUrl,
}),
});