playlist tab/view

This commit is contained in:
austinried
2021-07-19 13:14:13 +09:00
parent ac1970145f
commit 9d835f04aa
11 changed files with 433 additions and 26 deletions

View File

@@ -6,6 +6,8 @@ import {
ArtistInfoElement,
ChildElement,
DirectoryElement,
PlaylistElement,
PlaylistWithSongsElement,
} from '@app/subsonic/elements'
export type ResponseStatus = 'ok' | 'failed'
@@ -153,3 +155,26 @@ export class GetAlbumList2Response extends BaseGetAlbumListResponse<AlbumID3Elem
super(xml, AlbumID3Element)
}
}
//
// Playlists
//
export class GetPlaylistsResponse {
playlists: PlaylistElement[] = []
constructor(xml: Document) {
const playlistElements = xml.getElementsByTagName('playlist')
for (let i = 0; i < playlistElements.length; i++) {
this.playlists.push(new PlaylistElement(playlistElements[i]))
}
}
}
export class GetPlaylistResponse {
playlist: PlaylistWithSongsElement
constructor(xml: Document) {
this.playlist = new PlaylistWithSongsElement(xml.getElementsByTagName('playlist')[0])
}
}