-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Beet update when volume not mounted #1934
Comments
Yep, it's rather unfortunate but expected—the files don't exist from the OS's perspective, so beets removes them from the database. |
hi @sampsyo Thank you for your prompt answer. I understand that you don't have the feature (check if volume is mounted / available). But does closing the issue mean that you do not want the feature to be implemented? If it is an unfortunate bug, which we agree it is, would you consider it in the roadmap? Thank you |
Well, here's the thing: from the perspective of the OS, there is no way to tell why a file is unavailable. A deleted file looks exactly the same as an unmounted file, and unmounting a filesystem leaves behind no "evidence" that it was unmounted. So I'm not sure a fix is possible, alas. |
Yes @sampsyo thank you again for your reply. I understand this might be an edge case but I think it makes sense. I am not saying to check if "a file" is available or not, nor why. That would be useless. But if I know that would be easy with bash and we cannot assume bash, but doing it in python should not be impossible at all. I never worked with python but looks like I did not ask you to fix it, I am just surprised this was closed without further commenting if it is doable or not, approaches, and so on. Thank you again for such a great tool. |
I think checking whether the library directory itself is available is a good idea, as it's unlikely someone would delete the library folder itself and run an update on purpose. |
Maybe we can introduce a config option like |
Yes, unless all the music happens to reside outside of the library directory---for example, if the user imported everything with But yes, perhaps a confirmation wouldn't hurt? |
Hi again people, Thank you for the support on the issue. I deleted all my library by being relaxed, so I think it can happen to more people. What I had in mind is a confirmation if that scenario (library volume unavailable) is in place, but a Do you accept PR's? How do you prepare these kind of changes (how do you run your copy of beets not the pip one)? Also, do you run tests? |
@zigotica I also store my music library on a removable usb hard drive. I use 'autofs' to auto-mount/umount the volume. You can find some information here https://gist.github.com/daks/8030543 if needed. |
Hi @daks I have my library (database) in my hard drive, but the music files in the NAS. For security reasons I don't have my NAS volumes always mounted, so I just mount them (manually) when I want to do something specifically. Thank you for the suggestion anyway, USB might be the case for other people. |
We certainly do accept PRs, @zigotica. Take a look at How do I run the latest source version of beets?, it should help you get set up with a modifiable install of beets. I find the best way to work on the source is a combination of a virtualenv and the third way of doing it ( Here's an example of my workflow (assuming you're on *nix):
I'd suggest forking the repository first and replacing You can then make a new branch, make your changes and make a PR back to this repository. |
Hi @jackwilsdon Thank you for re-opening the issue and for the detailed description of your environment. I will certainly try to fix this soon-ish. |
@zigotica i got the same setup: beets db on HD and music files on USB HD. |
Thanks for looking into it! If you do put together a PR, can I encourage you to first try not adding a configuration option? Wherever it's possible to do something reasonable by default, we should do that—especially in this case, when we're protecting against a surprising case that could be called "user error." |
@sampsyo yes, when i look into it, i will try to use a confirmation in first place. if i end up using a configuration option (ie. does it make sense to you? |
Yep, sounds good. |
Hi
Maybe I'm not using the correct config, but if you
beet update
when your music files volume is not mounted, your library gets all deleted without further prompting.Is that the expected behaviour or is there a way to avoid it?
Thank you
The text was updated successfully, but these errors were encountered: