Skip to content

Some small proposed improvements#67

Merged
meeb merged 3 commits into
meeb:mainfrom
padenot:fixes
May 25, 2026
Merged

Some small proposed improvements#67
meeb merged 3 commits into
meeb:mainfrom
padenot:fixes

Conversation

@padenot
Copy link
Copy Markdown
Contributor

@padenot padenot commented Apr 29, 2026

Thanks for the great program. I've implemented two small features (with tests), for my own use, I wonder if they would be of interest for others:

  • ability to stop downloading after a certain point, that can be a regexp over artist - release name, or a purchase date -- I implemented this to make it easier to perform the initial sync in batches, my collection is fairly large. Also adds a dry run mode that was helpful for debugging
  • ability to store some state at the root of the download folder to speed up subsequent use of the program (e.g. when running periodically off a cron)

In addition, fixing a small bug: downloading a release that consists in a single file (e.g. the excellent https://mala-music.bandcamp.com/album/militant-don) didn't work, the program was expecting a zip. This caused the second feature to error out and not write its state file in my case.

@meeb
Copy link
Copy Markdown
Owner

meeb commented Apr 29, 2026

Thanks for the PR.

There's already a --skip-item-index from #55 - do you need a separate state cache for some reason in addition to this?

Given the entire point of bandcampsync is to sync your bandcamp purchases I'm not really sure how in demand a "stop downloading at" cut-off option is likely to be, but if I were to merge one it would probably be the purchased date based stop.

With your edge case, this is an item that is listed as an album type that downloads as an uncompressed single track, correct?

@meeb
Copy link
Copy Markdown
Owner

meeb commented May 25, 2026

Hi, please could you update the issue?

@padenot
Copy link
Copy Markdown
Contributor Author

padenot commented May 25, 2026

Apologies, I had addressed the comments but failed to push them, here they are, updated (and commit messages).

Commit 2 isn't similar to --skip-item-index, I added more info to the commit message and a benchmark on my big collection, it yields a 10x speed-up.

Commit 1 now only has date, not regexp, and I confirm your understanding for commit 3 (which is a bug fix, not a feature).

@meeb
Copy link
Copy Markdown
Owner

meeb commented May 25, 2026

Fair enough, thanks for the update. I've just been working on this for a new release so if you could tweak those merge conflicts I'll give your PR a full review. Cheers.

padenot added 3 commits May 25, 2026 15:55
Add CLI and service controls for stopping collection processing at a purchase date, plus dry-run support for previewing downloads. This allows syncing in batches without downloading or writing files during a preview.

The cutoff is applied both during pagination and again during sync selection so the date boundary is handled consistently, including physical-only collection entries.
Persist the newest seen collection token and use it on later runs to stop Bandcamp pagination once previously synced items are reached.

This is not the same as the existing skip-item-index path: that only avoids building the local media index when ignored IDs make it safe, while the checkpoint limits remote collection pagination and still lazily verifies candidate new items against their expected local path.

On my ~1200-item collection, a dry-run benchmark that made the old path maximally favorable with --skip-item-index and an ignore file still fetched 13 collection pages and averaged 12.8s, while the checkpoint path fetched 1 page, saw 2 newer items before the saved token, and averaged 1.2s.
Accept non-zip downloads when Bandcamp returns an audio content type,
even if the collection item is not classified as a track.

This fixes single-release album downloads that are served as one MP3 or
other audio file instead of an archive.

Example: https://mala-music.bandcamp.com/album/militant-don
@padenot
Copy link
Copy Markdown
Contributor Author

padenot commented May 25, 2026

Rebased, sorry I should have done it earlier today.

@meeb
Copy link
Copy Markdown
Owner

meeb commented May 25, 2026

Yep looks fine, thanks. I'm going to tidy the project up a bit before the next release as a few AI-sourced PRs have made the structure a little chaotic, then I'll bundle this into the next release. Thanks for the contribution!

@meeb meeb merged commit d456fa5 into meeb:main May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants