phishin icon indicating copy to clipboard operation
phishin copied to clipboard

Download entire shows in a Zip file

Open jamesdaily opened this issue 1 year ago • 3 comments

I prefer to download locally instead of streaming.

It's possible to do this track by track.

It'd be more convenient to be able to download an entire show or set as a Zip file with one click.

jamesdaily avatar Jan 01 '24 18:01 jamesdaily

Possible implementations:

  1. Zip on demand. Benefits: no need to pre-zip nor update zip when tracks change. No need to store zipped shows (which would double storage requirements). Could support dynamic bundling by set or playlist vs just entire show.
  2. Zip ahead of time: Benefits: less compute required over time, easier to cache.

jamesdaily avatar Jan 01 '24 18:01 jamesdaily

Playlists/shows as zipfiles was a feature in the initial release but I dropped it because it was inefficient/slow (it was synchronous) and used infrequently. This could be re-added as an async job but it would require adding Sidekiq or other background task processing, which would also require Redis. Due to these requirements I don't think it belongs on the primary roadmap at this time. Downloading tracks by batch could easily be done via the API and in parallel, obviating the need for zipping/unzipping.

If someone wants to take a crack at a browser-based track download feature, I'd be open to that, but at this point I'm hesitant to add it as a backend feature. Frontend implementation would likely be easier if using React, which is started at https://github.com/jcraigk/phishin/pull/325

It's worth noting that CloudFlare does a ton of heavy lifting as far as caching MP3s at the edge, and for free. This is basically what allows phish.in to keep running, otherwise it would get crushed by traffic or someone would have to pay a big S3/CloudFront bill for file transfers. This edge cache (accessing MP3s directly by their URL) should be utilized as much as possible by all client requests, whether the client is interested in a single file or many.

jcraigk avatar Jan 01 '24 18:01 jcraigk

A "download all" button which effectively just triggered downloads of all individual tracks separately would be just fine.

jamesdaily avatar Jan 01 '24 19:01 jamesdaily