mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-11 07:12:44 +01:00
switched to new playlist w/songs
removed more unused stuff
This commit is contained in:
@@ -1,11 +1,5 @@
|
||||
import { AlbumListItem, AlbumWithSongs, Artist, PlaylistListItem, PlaylistWithSongs, Song } from '@app/models/music'
|
||||
import {
|
||||
AlbumID3Element,
|
||||
ArtistID3Element,
|
||||
ChildElement,
|
||||
PlaylistElement,
|
||||
PlaylistWithSongsElement,
|
||||
} from '@app/subsonic/elements'
|
||||
import { AlbumListItem, Artist, PlaylistListItem, Song } from '@app/models/music'
|
||||
import { AlbumID3Element, ArtistID3Element, ChildElement, PlaylistElement } from '@app/subsonic/elements'
|
||||
import { GetState, SetState } from 'zustand'
|
||||
import { Store } from './store'
|
||||
|
||||
@@ -15,9 +9,7 @@ export type MusicMapSlice = {
|
||||
mapArtistID3toArtist: (artist: ArtistID3Element) => Artist
|
||||
mapAlbumID3toAlbumListItem: (album: AlbumID3Element) => AlbumListItem
|
||||
mapAlbumID3toAlbum: (album: AlbumID3Element) => AlbumListItem
|
||||
mapAlbumID3WithSongstoAlbumWithSongs: (album: AlbumID3Element, songs: ChildElement[]) => Promise<AlbumWithSongs>
|
||||
mapPlaylistListItem: (playlist: PlaylistElement) => PlaylistListItem
|
||||
mapPlaylistWithSongs: (playlist: PlaylistWithSongsElement) => Promise<PlaylistWithSongs>
|
||||
}
|
||||
|
||||
export const createMusicMapSlice = (set: SetState<Store>, get: GetState<Store>): MusicMapSlice => ({
|
||||
@@ -86,13 +78,6 @@ export const createMusicMapSlice = (set: SetState<Store>, get: GetState<Store>):
|
||||
}
|
||||
},
|
||||
|
||||
mapAlbumID3WithSongstoAlbumWithSongs: async (album, songs) => {
|
||||
return {
|
||||
...get().mapAlbumID3toAlbum(album),
|
||||
songs: await get().mapChildrenToSongs(songs),
|
||||
}
|
||||
},
|
||||
|
||||
mapPlaylistListItem: playlist => {
|
||||
return {
|
||||
itemType: 'playlist',
|
||||
@@ -102,12 +87,4 @@ export const createMusicMapSlice = (set: SetState<Store>, get: GetState<Store>):
|
||||
coverArt: playlist.coverArt,
|
||||
}
|
||||
},
|
||||
|
||||
mapPlaylistWithSongs: async playlist => {
|
||||
return {
|
||||
...get().mapPlaylistListItem(playlist),
|
||||
songs: await get().mapChildrenToSongs(playlist.songs),
|
||||
coverArt: playlist.coverArt,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user