Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
[C-2844] Ensure all tracks fetched on collection page (#3734)
Browse files Browse the repository at this point in the history
  • Loading branch information
amendelsohn authored Jul 12, 2023
1 parent be5a951 commit e6e59f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,13 @@ function* selectEntriesTimestamp(ids: (ID | string)[]) {

export function* retrieveCollectionByPermalink(
permalink: string,
/**
* whether or not to fetch the tracks inside the playlist
*/
fetchTracks = false,
/**
* whether or not fetching this collection requires it to have all its tracks.
* In the case where a collection is already cached with partial tracks, use this flag to refetch from source.
*/
requiresAllTracks = false
config?: RetrieveCollectionsConfig
) {
const {
fetchTracks = false,
requiresAllTracks = false,
forceRetrieveFromSource = false
} = config ?? {}
// @ts-ignore retrieve should be refactored to ts first
const { entries, uids } = yield* call(retrieve, {
ids: [permalink],
Expand Down Expand Up @@ -215,7 +212,7 @@ export function* retrieveCollectionByPermalink(
},
kind: Kind.COLLECTIONS,
idField: 'playlist_id',
forceRetrieveFromSource: false,
forceRetrieveFromSource,
shouldSetLoading: true,
deleteExistingEntry: false
})
Expand Down
9 changes: 6 additions & 3 deletions packages/web/src/common/store/pages/collection/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ function* watchFetchCollection() {
retrievedCollections = yield call(
retrieveCollectionByPermalink,
permalink,
/* fetchTracks */ false,
/* requiresAllTracks */ true
{
requiresAllTracks: true
}
)
} else {
retrievedCollections = yield call(retrieveCollections, [collectionId])
retrievedCollections = yield call(retrieveCollections, [collectionId], {
requiresAllTracks: true
})
}

const { collections, uids: collectionUids } = retrievedCollections
Expand Down

0 comments on commit e6e59f6

Please sign in to comment.