@@ -65,16 +65,20 @@ import { albumInfo as albumInfoService, download as downloadService } from '@/se
import router from '@/router'
import { useAlbumAttributes, useSongList } from '@/composables'
-const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/screen-header.vue'))
+const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/ScreenHeader.vue'))
const AlbumInfo = defineAsyncComponent(() => import('@/components/album/AlbumInfo.vue'))
const SoundBar = defineAsyncComponent(() => import('@/components/ui/sound-bar.vue'))
const AlbumThumbnail = defineAsyncComponent(() => import('@/components/ui/AlbumArtistThumbnail.vue'))
const CloseModalBtn = defineAsyncComponent(() => import('@/components/ui/close-modal-btn.vue'))
+const props = defineProps<{ album: Album }>()
+const { album } = toRefs(props)
+
const {
SongList,
SongListControls,
ControlsToggler,
+ songs,
songList,
selectedSongs,
showingControls,
@@ -83,10 +87,7 @@ const {
playAll,
playSelected,
toggleControls
-} = useSongList()
-
-const props = defineProps<{ album: Album }>()
-const { album } = toRefs(props)
+} = useSongList(ref(album.value.songs))
const { length, fmtLength } = useAlbumAttributes(album.value)
diff --git a/resources/assets/js/components/screens/artist-list.vue b/resources/assets/js/components/screens/artist-list.vue
index 040a1ecc..3a61745d 100644
--- a/resources/assets/js/components/screens/artist-list.vue
+++ b/resources/assets/js/components/screens/artist-list.vue
@@ -28,7 +28,7 @@ const {
makeScrollable
} = useInfiniteScroll(9)
-const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/screen-header.vue'))
+const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/ScreenHeader.vue'))
const ArtistCard = defineAsyncComponent(() => import('@/components/artist/card.vue'))
const ViewModeSwitch = defineAsyncComponent(() => import('@/components/ui/view-mode-switch.vue'))
diff --git a/resources/assets/js/components/screens/artist.vue b/resources/assets/js/components/screens/artist.vue
index 7ebbc0f0..f03ae7a7 100644
--- a/resources/assets/js/components/screens/artist.vue
+++ b/resources/assets/js/components/screens/artist.vue
@@ -9,26 +9,26 @@
-
+
{{ pluralize(artist.albums.length, 'album') }}
•
- {{ pluralize(artist.songs.length, 'song') }}
+ {{ pluralize(songs.length, 'song') }}
•
{{ fmtLength }}
•
- Info
+ Info
•
Download All
@@ -38,17 +38,17 @@
-
+
@@ -70,12 +70,15 @@ import { artistInfo as artistInfoService, download as downloadService } from '@/
import router from '@/router'
import { useArtistAttributes, useSongList } from '@/composables'
+const props = defineProps<{ artist: Artist }>()
+const { artist } = toRefs(props)
+
const {
SongList,
SongListControls,
ControlsToggler,
songList,
- state,
+ songs,
meta,
selectedSongs,
showingControls,
@@ -84,13 +87,11 @@ const {
playAll,
playSelected,
toggleControls
-} = useSongList()
+} = useSongList(ref(artist.value.songs))
-const props = defineProps<{ artist: Artist }>()
-const { artist } = toRefs(props)
const { length, fmtLength, image } = useArtistAttributes(artist.value)
-const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/screen-header.vue'))
+const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/ScreenHeader.vue'))
const ArtistInfo = defineAsyncComponent(() => import('@/components/artist/info.vue'))
const SoundBar = defineAsyncComponent(() => import('@/components/ui/sound-bar.vue'))
const ArtistThumbnail = defineAsyncComponent(() => import('@/components/ui/AlbumArtistThumbnail.vue'))
@@ -112,7 +113,6 @@ watch(() => artist.value.albums.length, newAlbumCount => newAlbumCount || router
watch(artist, () => {
showing.value = false
- // @ts-ignore
songList.value?.sort()
})
diff --git a/resources/assets/js/components/screens/favorites.vue b/resources/assets/js/components/screens/favorites.vue
index 7298d808..09eddce5 100644
--- a/resources/assets/js/components/screens/favorites.vue
+++ b/resources/assets/js/components/screens/favorites.vue
@@ -9,9 +9,9 @@
{{ pluralize(meta.songCount, 'song') }}
•
{{ meta.totalLength }}
-
+
•
-
+
Download All
@@ -20,17 +20,17 @@
-
+
@@ -38,8 +38,8 @@
No favorites yet.
- Click the
-
+ Click the
+
icon to mark a song as favorite.
@@ -51,15 +51,16 @@ import { pluralize } from '@/utils'
import { favoriteStore, sharedStore } from '@/stores'
import { download as downloadService } from '@/services'
import { useSongList } from '@/composables'
-import { defineAsyncComponent, reactive } from 'vue'
+import { defineAsyncComponent, toRef } from 'vue'
-const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/screen-header.vue'))
+const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/ScreenHeader.vue'))
const ScreenPlaceholder = defineAsyncComponent(() => import('@/components/ui/screen-placeholder.vue'))
const {
SongList,
SongListControls,
ControlsToggler,
+ songs,
songList,
meta,
selectedSongs,
@@ -69,10 +70,9 @@ const {
playAll,
playSelected,
toggleControls
-} = useSongList()
+} = useSongList(toRef(favoriteStore.state, 'songs'))
-const state = reactive(favoriteStore.state)
-const sharedState = reactive(sharedStore.state)
+const allowDownload = toRef(sharedStore.state, 'allowDownload')
const download = () => downloadService.fromFavorites()
diff --git a/resources/assets/js/components/screens/home.vue b/resources/assets/js/components/screens/home.vue
index 348eb33f..fba50ba5 100644
--- a/resources/assets/js/components/screens/home.vue
+++ b/resources/assets/js/components/screens/home.vue
@@ -89,7 +89,7 @@ import router from '@/router'
import { useInfiniteScroll } from '@/composables'
import { computed, defineAsyncComponent, reactive, ref } from 'vue'
-const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/screen-header.vue'))
+const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/ScreenHeader.vue'))
const AlbumCard = defineAsyncComponent(() => import('@/components/album/card.vue'))
const ArtistCard = defineAsyncComponent(() => import('@/components/artist/card.vue'))
const SongCard = defineAsyncComponent(() => import('@/components/song/card.vue'))
diff --git a/resources/assets/js/components/screens/playlist.vue b/resources/assets/js/components/screens/playlist.vue
index 8e7d1c3b..06752ee1 100644
--- a/resources/assets/js/components/screens/playlist.vue
+++ b/resources/assets/js/components/screens/playlist.vue
@@ -1,5 +1,5 @@
-
+
{{ playlist.name }}
@@ -33,11 +33,11 @@
@@ -62,23 +62,24 @@
diff --git a/resources/assets/js/components/screens/recently-played.vue b/resources/assets/js/components/screens/recently-played.vue
index 5ed833e9..adde75e6 100644
--- a/resources/assets/js/components/screens/recently-played.vue
+++ b/resources/assets/js/components/screens/recently-played.vue
@@ -10,26 +10,24 @@
-
+
No songs recently played.
-
- Start playing to populate this playlist.
-
+ Start playing to populate this playlist.
@@ -38,16 +36,17 @@
import { eventBus, pluralize } from '@/utils'
import { recentlyPlayedStore } from '@/stores'
import { useSongList } from '@/composables'
-import { defineAsyncComponent, reactive } from 'vue'
+import { defineAsyncComponent, reactive, toRef } from 'vue'
import { playback } from '@/services'
-const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/screen-header.vue'))
+const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/ScreenHeader.vue'))
const ScreenPlaceholder = defineAsyncComponent(() => import('@/components/ui/screen-placeholder.vue'))
const {
SongList,
SongListControls,
ControlsToggler,
+ songs,
songList,
meta,
selectedSongs,
@@ -56,11 +55,9 @@ const {
isPhone,
playSelected,
toggleControls
-} = useSongList()
+} = useSongList(toRef(recentlyPlayedStore.state, 'songs'))
-const state = reactive(recentlyPlayedStore.state)
-
-const playAll = () => playback.queueAndPlay(state.songs)
+const playAll = () => playback.queueAndPlay(songs.value)
eventBus.on({
'LOAD_MAIN_CONTENT': (view: MainViewName) => view === 'RecentlyPlayed' && recentlyPlayedStore.fetchAll()
diff --git a/resources/assets/js/components/screens/search/excerpts.vue b/resources/assets/js/components/screens/search/excerpts.vue
index a3fda276..a5f1d5e8 100644
--- a/resources/assets/js/components/screens/search/excerpts.vue
+++ b/resources/assets/js/components/screens/search/excerpts.vue
@@ -65,7 +65,7 @@ import { eventBus } from '@/utils'
import { searchStore } from '@/stores'
import router from '@/router'
-const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/screen-header.vue'))
+const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/ScreenHeader.vue'))
const ScreenPlaceholder = defineAsyncComponent(() => import('@/components/ui/screen-placeholder.vue'))
const SongCard = defineAsyncComponent(() => import('@/components/song/card.vue'))
const ArtistCard = defineAsyncComponent(() => import('@/components/artist/card.vue'))
diff --git a/resources/assets/js/components/screens/search/song-results.vue b/resources/assets/js/components/screens/search/song-results.vue
index 7a6e6cbc..1f07e871 100644
--- a/resources/assets/js/components/screens/search/song-results.vue
+++ b/resources/assets/js/components/screens/search/song-results.vue
@@ -10,34 +10,37 @@
-
+
-