Merge pull request #737 from ineentho/fix/refresh-playlist-cache

Fix bug with refreshing playlists where only the first page would be refreshed
This commit is contained in:
James Barnsley
2021-04-29 19:34:16 +12:00
committed by GitHub

View File

@ -940,7 +940,7 @@ export function getArtist(uri, { full, forceRefetch } = {}) {
.then((response) => {
albums = [...albums, ...formatAlbums(response.items)];
if (response.next) {
fetchAlbums(response.next);
fetchAlbums(`${response.next}${forceRefetch ? `&refetch=${Date.now()}` : ''}`);
} else {
dispatch(coreActions.itemLoaded({
uri,
@ -1057,7 +1057,7 @@ export function getUser(uri, { full, forceRefetch } = {}) {
.then((response) => {
playlists = [...playlists, ...formatPlaylists(response.items)];
if (response.next) {
fetchPlaylists(response.next);
fetchPlaylists(`${response.next}${forceRefetch ? `&refetch=${Date.now()}` : ''}`);
} else {
dispatch(coreActions.itemLoaded({
uri,
@ -1110,7 +1110,7 @@ export function getAlbum(uri, { full, forceRefetch } = {}) {
(response) => {
tracks = [...tracks, ...formatTracks(response.items)];
if (response.next) {
fetchTracks(response.next);
fetchTracks(`${response.next}${forceRefetch ? `&refetch=${Date.now()}` : ''}`);
} else {
dispatch(coreActions.itemLoaded({
uri,
@ -1284,7 +1284,7 @@ export function getPlaylistTracks(uri, { forceRefetch, callbackAction } = {}) {
.then((response) => {
tracks = [...tracks, ...formatTracks(response.items)];
if (response.next) {
fetchTracks(response.next);
fetchTracks(`${response.next}${forceRefetch ? `&refetch=${Date.now()}` : ''}`);
} else {
dispatch(coreActions.itemLoaded({
uri,