diff --git a/packages/web/src/common/store/cache/collections/utils/retrieveCollections.ts b/packages/web/src/common/store/cache/collections/utils/retrieveCollections.ts index bed6de1c44..7e8396c8f6 100644 --- a/packages/web/src/common/store/cache/collections/utils/retrieveCollections.ts +++ b/packages/web/src/common/store/cache/collections/utils/retrieveCollections.ts @@ -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], @@ -215,7 +212,7 @@ export function* retrieveCollectionByPermalink( }, kind: Kind.COLLECTIONS, idField: 'playlist_id', - forceRetrieveFromSource: false, + forceRetrieveFromSource, shouldSetLoading: true, deleteExistingEntry: false }) diff --git a/packages/web/src/common/store/pages/collection/sagas.js b/packages/web/src/common/store/pages/collection/sagas.js index 8acf36adca..326eda0e70 100644 --- a/packages/web/src/common/store/pages/collection/sagas.js +++ b/packages/web/src/common/store/pages/collection/sagas.js @@ -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