feat: add playing status on sidebar playlists (#1517)

* udpate playing status on sidebar playlists

* update player mode logic & delete unused codes

* change sidebar svg to volume-half

* format code and relevant optimizations

* justify-between

* change object visit mode to dot.

* delete duplited `flex` class

* add playlist id check
in case playlist id conflicts with album.
This commit is contained in:
L.Ryland 2022-04-12 22:18:37 +08:00 committed by GitHub
parent 1591586735
commit 3626095d97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 73 additions and 16 deletions

View file

@ -13,7 +13,7 @@ import { fetchPlaylistWithReactQuery } from '@/renderer/hooks/usePlaylist'
import { fetchAlbumWithReactQuery } from '@/renderer/hooks/useAlbum'
type TrackID = number
enum TrackListSourceType {
export enum TrackListSourceType {
ALBUM = 'album',
PLAYLIST = 'playlist',
}
@ -269,7 +269,9 @@ export class Player {
if (this.fmTrackList.length === 0) await this._loadMoreFMTracks()
this._playTrack()
this.fmTrackList.length <= 1 ? await this._loadMoreFMTracks() : this._loadMoreFMTracks()
this.fmTrackList.length <= 1
? await this._loadMoreFMTracks()
: this._loadMoreFMTracks()
prefetchNextTrack()
}