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

[C-1987][C-1936][C-2009] Queue for collection downloads#2751

Merged
amendelsohn merged 15 commits into
mainfrom
amendel-offline-collection-queue
Feb 1, 2023
Merged

[C-1987][C-1936][C-2009] Queue for collection downloads#2751
amendelsohn merged 15 commits into
mainfrom
amendel-offline-collection-queue

Conversation

@amendelsohn

Copy link
Copy Markdown
Contributor

Description

Changes:

  1. Queue for collections download
  2. Added download status for collections
  3. Collection tracks process in order one by one
  4. Separated DownloadStatusIndicator into Collection vs Tracks components
  5. Fixed tracks list skeleton count for collection details page
  6. Cleaned up selectors for offline mode
  7. Added new queued state to collection header

Notable change is the decision to include a component-specific selector in CollectionDownloadStatusIndicator.

Dragons

Nope

@amendelsohn amendelsohn requested review from a team and raymondjacobson February 1, 2023 05:52
Co-authored-by: Dylan Jeffers <dylan@audius.co>

@raymondjacobson raymondjacobson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏆

import { makeStyles, flexRowCentered } from 'app/styles'
import { useThemeColors } from 'app/utils/theme'

import { CollectionDownloadStatusIndicator } from '../offline-downloads/CollectionDownloadStatusIndicator'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

absolute imports probs

size: 18,
[isCollection ? 'collectionId' : 'trackId']: id.toString()
}
const downloadStatusIndicator = isCollection ? (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love this change

dispatch(
completeCollectionDownload({
collectionId,
isFavoritesDownload: false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has always kind of confused me -- we are downloading the 'favorites' collection, but it's not the favorites download?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a special case because the favorites collection itself is not a collection within favorites, so we track it at the top level with collections that were individually marked for download. Kinda confusing though =\ Adding a comment at least

empty: 'This playlist is empty.',
privatePlaylist: 'Private Playlist',
publishing: 'Publishing...',
queued: 'Download Queued',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reminder to check on copy. i think maybe just "Downloading" would also suffice here

payloadsToCancel,
(payload) => payload.trackId
)
queue.stop()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why move this up? just to make sure we don't accidentally push something in after we've canceled?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's so we don't let the workers pick up new jobs while we're deciding which ones to cancel (the inactive ones still in the queue)


if (!collectionFromApi) {
throw failJob(
`collection to download not found on discovery - ${collectionFromApi}`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heads up, i am working on a PR to throw custom typed error messages here, so we can do different things on different kinds of errors

})

export const {
// TODO: don't name these the same thing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wdym?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startDownload and batchStartDownload don't actually use the same states. They should be named differently so they don't sound like the single vs batch of the same action.

queue.start()
}

export const cancelQueuedCollectionDownloads = async (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this called anywhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooh yep we missed that. Added the call in removeCollectionDownload

@amendelsohn amendelsohn changed the title [C-1987] Queue for collection downloads [C-1987][C-1936] Queue for collection downloads Feb 1, 2023
@amendelsohn amendelsohn changed the title [C-1987][C-1936] Queue for collection downloads [C-1987][C-1936][C-1959] Queue for collection downloads Feb 1, 2023
@amendelsohn amendelsohn changed the title [C-1987][C-1936][C-1959] Queue for collection downloads [C-1987][C-1936][C-2009] Queue for collection downloads Feb 1, 2023
@amendelsohn amendelsohn merged commit b771776 into main Feb 1, 2023
@amendelsohn amendelsohn deleted the amendel-offline-collection-queue branch February 1, 2023 19:44
audius-infra pushed a commit that referenced this pull request Feb 4, 2023
[45f122f] [C-2015] Debounce the callbacks for the download toggles for favorites and collections (#2766) Kyle Shanks
[e0cafef] [C-2034] Cancel all download jobs on log out (#2775) Andrew Mendelsohn
[ab581b1] C-2022 C-1970 Fix for: When offline and not fully downloaded, queued jobs keep running and fail (#2773) nicoback2
[1c674a9] C-1958 Show # of downloaded tracks in collection card instead of actual # of tracks in collection when offline (#2757) nicoback2
[014afaa] [C-2036] Fix modals not closing on click outside (#2776) Marcus Pasell
[07b7961] [DMs] Redo create chat modal (#2706) Marcus Pasell
[8b89acf] [C-1994] Add download indicator to the track screen (#2774) Kyle Shanks
[70619cd] Improve download toggle, download progress and fetch (#2772) Raymond Jacobson
[860291d] [C-1941] Refresh queue when download toggle is flipped (#2770) Raymond Jacobson
[3e8e33b] Fix CI (#2771) Michael Piazza
[f94bcc9] [C-2012] [C-1999] [C-1734] Fix collection image loading (#2769) Sebastian Klingler
[80da94c] Consume .env.git to properly tag Sentry release (#2767) Michael Piazza
[b2f96f6] [C-1974] Add batch remove downloads (#2764) Dylan Jeffers
[5ff30b4] [C-1921] Make sure to download local saves (#2763) Raymond Jacobson
[de5d5fd] [C-2006] Fix download toggle when offline (#2762) Raymond Jacobson
[66449a1] [PAY-868] Handle follow and tip send states across (#2756) Saliou Diallo
[171e46e] [PAY-866] Add new remix settings - Part 1 (#2708) Saliou Diallo
[90579c5] Refactor lineup hooks (#2760) Sebastian Klingler
[5bfa0dc] C-2002 Un-download deleted playlists on sync (#2759) nicoback2
[1dd8b68] [C-2001] Remove queued downloads if deleted/unlisted/etc (#2761) Raymond Jacobson
[265e666] [C-1968] Fix dequeue track (#2758) Dylan Jeffers
[fbaf5c0] [C-1992] Fix unfavorite downloaded track (#2755) Dylan Jeffers
[73563f8] [C-1957] [C-1929] Improve TrackList and offline mode performance (#2753) Sebastian Klingler
[b771776] [C-1987][C-1936][C-2009] Queue for collection downloads (#2751) Andrew Mendelsohn
[016342d] [C-1985] Remove collection tracks when removing favorites (#2749) Dylan Jeffers
[5b675c8] [PAY-881] Mobile messages (chats) list screen (#2742) Reed
[d2b1c4c] C-1989 Fix "Download is not re-starting even though there are still many tracks that need to be downloaded" (#2746) nicoback2
[fec0134] [PAY-872][PAY-873][PAY-874] More premium content QA fixes (#2741) Saliou Diallo
[9530cae] Hide buttons on profiles when offline and remove timeout (#2750) Raymond Jacobson
[d658e3e] [C-1952] Show download successful when offline in status indicator (#2733) Raymond Jacobson
[bbb58e8] [C-1950] Smooth offline<>online playback (#2748) Raymond Jacobson
[059f79e] Hide share/repost when offline C-1942 (#2747) nicoback2
[6458512] [C-2000] Fix collections not downloading on favorites download (#2745) Dylan Jeffers
[4ba882c] Do not write subscribe to discovery on auto-subscribe after follow (#2562) Michelle Brier
[e21edc7] Fix download counter in error state (#2744) Raymond Jacobson
[3ad7a55] [PAY-777] Add premium content track upload on mobile - Part 3 (#2721) Saliou Diallo
[ad3b6d2] Update undownload favorites to hide progress earlier (#2743) Kyle Shanks
[16a45f5] [C-1938] Remove tracks within collections when toggling off favorites (#2737) Raymond Jacobson
[5e008a3] [C-1977] Hide more by this artist when offline (#2734) Raymond Jacobson
[b1d261f] Improve useFetchAllFavoritedTracks fetch (#2740) Dylan Jeffers
[a39f874] [C-1993 C-1995] Refactor download switch, improve collection header (#2739) Dylan Jeffers
[36687e5] [C-1937, C-1964] Add pagination to the mobile favorites screen and fix the title width for deleted track list items (#2738) Kyle Shanks
[adc74fa] [C-1976] Hide/disable overflow menus when offline (#2735) Raymond Jacobson
[18e63ff] [C-1938] Disable downloading from toggle when offline (#2736) Raymond Jacobson
[a0d3097] [C-1991] Fix downloading rive animation location (#2732) Raymond Jacobson
[1e8d9d5] [C-1960] Do not show favorite/repost on own (#2723) Raymond Jacobson
[563842e] [C-1930] Prevent self favorite/repost/follow (#2724) Raymond Jacobson
[4975945] [C-1916 C-1982 QA-328] Fix smart-collection artwork (#2731) Dylan Jeffers
[bbc2477] [C-1963] Add download progress bar (#2730) Raymond Jacobson
[5ef3d06] [C-1782] Use proxy for sentry dsn (#2684) Raymond Jacobson
[2c2cd82] [C-1962] Update offline icons/animations (#2725) Raymond Jacobson
[8607f9c] Fix crash on favorites screen if you start the app offline C-1943 C-1951 (#2726) nicoback2
[74c9324] [C-1986] Use RNFetchBlob for offline mode (#2728) Sebastian Klingler
[3084ea9] Refactor ArtistChip (#2715) Marcus Pasell
[7a9cec6] [C-1973] Improve offline image downloading (#2720) Sebastian Klingler
[075aa5b] Fix some web premium content bugs (#2709) Saliou Diallo
@AudiusProject AudiusProject deleted a comment from linear Bot Sep 11, 2023
@AudiusProject AudiusProject deleted a comment from linear Bot Sep 11, 2023
@AudiusProject AudiusProject deleted a comment from linear Bot Sep 11, 2023
@AudiusProject AudiusProject deleted a comment from linear Bot Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants