RyanBluth / Bandcamp-Greasy

Download Your Bandcamp Collection
MIT License
255 stars 43 forks source link

DownloadCollection overhaul #22

Closed bb010g closed 3 years ago

bb010g commented 3 years ago

DownloadCollection can now deal with flaky & slow connections and minor Bandcamp errors (without requiring a full refresh & reset), has easier-to-read duplicate listings, doesn't start auto-scanning every single time you open your page if it's left on, and allows for a reset from wherever you are if it somehow messes up.

(The internet was bad when I started messing around with this, so here's the result.)

State is also now stored in the DOM, so bodges on Bandcamp Greasey in your web inspector are simpler & more effective. (For example, you can manually remove a bunch of listed albums from the DOM, and range downloading will still work as if you never removed anything.) Multiple concurrent auto-scans are prevented by disabling the button while an auto-scan is running, which feels nice for this sort of userscript.

A bit longer due to some helper functions for the UI HTML & switching over to proper CSS for styling. Credit to https://webreflection.medium.com/dom-handleevent-a-cross-platform-standard-since-year-2000-5bf17287fd38 for the EventHandler pattern.

I ended up adding semicolons to the ends of lines. I hope that's okay.


This change is Reviewable

RyanBluth commented 3 years ago

Thanks! I've been meaning to make some of these changes for a while now so this is great. I'm fine with the semi-colons and will add them into the download album script unless you want to do that in this PR as well

bb010g commented 3 years ago

Thank you! The major style changes in the overhaul have been split out into preceding commits.

RyanBluth commented 3 years ago

Thanks! This looks great