meeb / bandcampsync

Downloads your Bandcamp purchases automatically
BSD 3-Clause "New" or "Revised" License
156 stars 9 forks source link

Handle preordered albums #16

Closed disconnect78 closed 7 months ago

disconnect78 commented 1 year ago

When I synced my library I had an album preordered which had some of the tracks available. These were downloaded and a bandcamp_item_id.txt file was created in the album folder. This means that now the album has been properly released, it's being skipped so I only have the partial album downloaded.

Now that I realise this happens, I can manually delete the bandcamp_item_id.txt from the folder when a preordered album is released; but it may be preferable to simply skip downloading unreleased preorders altogether, eg. in __init__.py:

...
local_path = local_media.get_path_for_purchase(item)
if item.is_preorder == True:
    log.info(f'Item is preorder, skipping: "{item.band_name} / {item.item_title}" '
             f'(id:{item.item_id})')
    continue
elif local_media.is_locally_downloaded(item, local_path):
...
meeb commented 1 year ago

Sounds like a decent addition, thanks! Do you want to create a PR for that?

meeb commented 7 months ago

I've copy/pasted the above and checked it, seems fine.