geigerzaehler / beets-alternatives

Beets plugin to manage external files
MIT License
91 stars 21 forks source link

Feature request: update all #77

Closed fgerent closed 4 months ago

fgerent commented 4 months ago

Hi, would it be possible to add an option to update all the "names" at once? I keep a music folder on my phone synced to a folder on my server, and I use different subfolders under that main folder (each one corresponding to an alt NAME) to create playlists that I can play on my phone. I would like to create a cron job to refresh all these subfolders overnight, but I'm constantly adding/removing subfolders so it would be easier not to have to specifically update each of them (as the list keeps changing). I was thinking that maybe a new command (e.g. beet alt update_all) could be added which would update all of the entries under the alternatives section of the config file. Alternatively, if there was a command that listed all the current "names" in the config file a similar result could be achieved (with some additional scripting). Thanks

geigerzaehler commented 4 months ago

Hi @fgerent. That sounds like a reasonable idea. I’ve implemented this in branch. Could you try it out and confirm that it works for you? You can install the branch with pip using pip install git+https://github.com/geigerzaehler/beets-alternatives.git@update-all and run beet alt update --all.

fgerent commented 4 months ago

That's exactly what I had in mind. I ran a couple of tests and it worked perfectly, thanks!

geigerzaehler commented 4 months ago

Perfect. I’ll release a new version soon

fgerent commented 4 months ago

Sorry, I spoke too soon. It does work, but it looks like every time I run it it re-creates (converts and copies) all of the matching items, instead of only new/changed ones. I believe it wasn't doing that before.

geigerzaehler commented 4 months ago

I’ve tested this locally and wrote some more tests and the feature works as expected for me. @fgerent, to get to the bottom of this, could you try to determine whether this only happens when using the new flag? That is, could you try running beet alt update yourcollection twice to see if on the second time nothing is updated? And then run beet alt update --all to see if nothing is updated either? (Make sure that you can distinguish between all the collections).

Could you run the update against the latest release instead of this feature branch to make sure that it is not some other bug? Are you using a FAT32 filesystem. There seem to be some issues with that as well (#74).

fgerent commented 4 months ago

@geigerzaehler, I ran some additional tests, including going back to the 0.11 release, and I'm (sometimes) actually getting this issue even without the --all flag, but it only seems to impact the name with that has the most items. I had seen issue #74, I'm not using FAT32 but both of my folders (source/destination) are on reiserfs, I'm wondering if that causes the same issue. I'd been meaning to move to a different fs but won't be able to do it for another few months at least. I can work around the issues for now and will report back once I'm able to try on a different fs. Thanks.

fgerent commented 4 months ago

I had a spare partition and decided to test this out, so I moved the entire setup I had (all the the "alternatives" paths) to this new ext4 partition and everything works as expected, even when using the --all flag. I'm closing this as it appears that the issue I was having is not really related to this new feature, which is working as expected. To be clear, it looks like the issue I had was the same as issue #74 as you had suggested, and it also affects reiserfs. Thanks again.

geigerzaehler commented 3 months ago

I’ve published v0.11.1 which includes the --all flag.