fixed loved tracks download
This commit is contained in:
parent
004e0a99be
commit
352a59c291
@ -194,6 +194,7 @@ export default defineComponent({
|
|||||||
favoriteSpotifyPlaylists,
|
favoriteSpotifyPlaylists,
|
||||||
favoritePlaylists,
|
favoritePlaylists,
|
||||||
favoriteTracks,
|
favoriteTracks,
|
||||||
|
lovedTracksPlaylist,
|
||||||
isRefreshingFavorites,
|
isRefreshingFavorites,
|
||||||
refreshFavorites
|
refreshFavorites
|
||||||
} = useFavorites()
|
} = useFavorites()
|
||||||
@ -217,6 +218,7 @@ export default defineComponent({
|
|||||||
artists: favoriteArtists,
|
artists: favoriteArtists,
|
||||||
playlists: favoritePlaylists,
|
playlists: favoritePlaylists,
|
||||||
spotifyPlaylists: favoriteSpotifyPlaylists,
|
spotifyPlaylists: favoriteSpotifyPlaylists,
|
||||||
|
lovedTracks: lovedTracksPlaylist,
|
||||||
refreshFavorites,
|
refreshFavorites,
|
||||||
isRefreshingFavorites
|
isRefreshingFavorites
|
||||||
}
|
}
|
||||||
@ -236,9 +238,12 @@ export default defineComponent({
|
|||||||
const toDownload = this.getActiveRelease()
|
const toDownload = this.getActiveRelease()
|
||||||
|
|
||||||
if (this.activeTab === 'track') {
|
if (this.activeTab === 'track') {
|
||||||
const lovedTracks = this.getLovedTracksPlaylist()
|
if (this.lovedTracks){
|
||||||
|
sendAddToQueue(this.lovedTracks)
|
||||||
sendAddToQueue(lovedTracks.link)
|
} else {
|
||||||
|
const lovedTracks = this.getLovedTracksPlaylist()
|
||||||
|
sendAddToQueue(lovedTracks.link)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sendAddToQueue(aggregateDownloadLinks(toDownload))
|
sendAddToQueue(aggregateDownloadLinks(toDownload))
|
||||||
}
|
}
|
||||||
@ -290,6 +295,7 @@ export default defineComponent({
|
|||||||
if (lovedTracks.length !== 0) {
|
if (lovedTracks.length !== 0) {
|
||||||
return lovedTracks[0]
|
return lovedTracks[0]
|
||||||
} else {
|
} else {
|
||||||
|
toast(this.$t('toasts.noLovedPlaylist'), 'warning', true)
|
||||||
throw new Error('No loved tracks playlist!')
|
throw new Error('No loved tracks playlist!')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,8 @@ const en = {
|
|||||||
loginNeededToDownload: 'You need to log in to download tracks!',
|
loginNeededToDownload: 'You need to log in to download tracks!',
|
||||||
deezerNotAvailable: 'Deezer is not available in your country. You should use a VPN.',
|
deezerNotAvailable: 'Deezer is not available in your country. You should use a VPN.',
|
||||||
startGeneratingItems: 'Processing {n} items...',
|
startGeneratingItems: 'Processing {n} items...',
|
||||||
finishGeneratingItems: 'Generated {n} items.'
|
finishGeneratingItems: 'Generated {n} items.',
|
||||||
|
noLovedPlaylist: 'No loved tracks playlist!'
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
title: 'Settings',
|
title: 'Settings',
|
||||||
|
@ -9,12 +9,13 @@ const favoriteAlbums = ref([])
|
|||||||
const favoriteSpotifyPlaylists = ref([])
|
const favoriteSpotifyPlaylists = ref([])
|
||||||
const favoritePlaylists = ref([])
|
const favoritePlaylists = ref([])
|
||||||
const favoriteTracks = ref([])
|
const favoriteTracks = ref([])
|
||||||
|
const lovedTracksPlaylist = ref('')
|
||||||
const isLoggedWithSpotify = computed(() => store.getters.isLoggedWithSpotify)
|
const isLoggedWithSpotify = computed(() => store.getters.isLoggedWithSpotify)
|
||||||
|
|
||||||
const isRefreshingFavorites = ref(false)
|
const isRefreshingFavorites = ref(false)
|
||||||
|
|
||||||
const setAllFavorites = data => {
|
const setAllFavorites = data => {
|
||||||
const { tracks, albums, artists, playlists } = data
|
const { tracks, albums, artists, playlists, lovedTracks } = data
|
||||||
|
|
||||||
isRefreshingFavorites.value = false
|
isRefreshingFavorites.value = false
|
||||||
|
|
||||||
@ -22,6 +23,7 @@ const setAllFavorites = data => {
|
|||||||
favoriteAlbums.value = albums
|
favoriteAlbums.value = albums
|
||||||
favoritePlaylists.value = playlists
|
favoritePlaylists.value = playlists
|
||||||
favoriteTracks.value = tracks
|
favoriteTracks.value = tracks
|
||||||
|
lovedTracksPlaylist.value = lovedTracks
|
||||||
}
|
}
|
||||||
|
|
||||||
const setSpotifyPlaylists = response => {
|
const setSpotifyPlaylists = response => {
|
||||||
@ -59,6 +61,7 @@ export const useFavorites = () => ({
|
|||||||
favoriteSpotifyPlaylists,
|
favoriteSpotifyPlaylists,
|
||||||
favoritePlaylists,
|
favoritePlaylists,
|
||||||
favoriteTracks,
|
favoriteTracks,
|
||||||
|
lovedTracksPlaylist,
|
||||||
isRefreshingFavorites,
|
isRefreshingFavorites,
|
||||||
refreshFavorites
|
refreshFavorites
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user