Skip to content

Handle invalid bandcamp_item_id files and make ID writes atomic#62

Merged
meeb merged 2 commits into
meeb:mainfrom
calumchisholm:empty_id_file_handling
Mar 14, 2026
Merged

Handle invalid bandcamp_item_id files and make ID writes atomic#62
meeb merged 2 commits into
meeb:mainfrom
calumchisholm:empty_id_file_handling

Conversation

@calumchisholm
Copy link
Copy Markdown
Contributor

#61

Handle invalid bandcamp_item_id.txt files gracefully and make item ID writes more robust.

This changes the local media indexer so empty or non-numeric bandcamp_item_id.txt files no longer abort startup. Invalid files are skipped with a warning, while the enclosing album directory is still tracked by name so already-downloaded media is not immediately re-downloaded.

It also hardens bandcamp_item_id.txt writes by validating the item ID before writing and replacing the file atomically from a temporary file. If writing the ID file fails after media download, sync now logs the error and continues instead of terminating the whole run.

Tests added.

@meeb
Copy link
Copy Markdown
Owner

meeb commented Mar 14, 2026

Yep looks fine, thanks for the PR!

@meeb meeb merged commit 72a6798 into meeb:main Mar 14, 2026
2 checks passed
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