google-code-export / beets

Automatically exported from code.google.com/p/beets
MIT License
0 stars 0 forks source link

Use paths relative to music directory #432

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
My music collection is in /home/shared/music on my primary workstation. I have 
a symlink in ~/music pointing to that directory. My ~/.beetsconfig (which 
itself is a symlink to ~/music/.beetsconfig) contains:

[beets]
library: ~/music/.beetslibrary.blb
directory: ~/music
...

Problem #1: When I'm importing music, depending on whether I happen to be 
located in ~/music or in /home/shared/music, the database's item.path for the 
imported entries will either start with "/home/johan/music/..." or 
"/home/shared/music/...". This causes problems if I later try to 
re-import/autotag the same music, because it will now try to move it e.g. from 
/home/shared/music/foo/bar/baz.flac to /home/johan/music/foo/bar/baz.flac. 
Since these two path reference the _same_ file, it somehow ends up _deleting_ 
the file!

Problem #2: I'd like to copy (or rather periodically rsync) my entire music 
collection (including the beets database) to my laptop. However, it has a 
different directory structure, so the absolute filenames would not resolve 
there.

Proposed solution for both problems: Would it be possible to store paths in the 
database as relative to the value of the "directory" setting in .beetsconfig? 
Then one copy/move the music folder somewhere else, and beets would still work 
(as long as the beets.directory config was updated accordingly). Also, for the 
above different paths that (via symlinks) actually refer to the same file, 
beets would not attempt to move one to the other, because their relative paths 
(relative to the root of the music collection) would be identical.

Original issue reported on code.google.com by jherl...@gmail.com on 30 Aug 2012 at 12:17

GoogleCodeExporter commented 9 years ago
This does sound like a good idea. I like the idea of being able to seamlessly 
relocate the base library directory.

For the time being, however, consider using the "beet move" command. Without 
the -d option, it can be used for consolidation -- it moves everything 
(possibly matching a query) into the library directory. I'm not sure how this 
will interact with your symlink-y setup, but it's worth a try.

Original comment by adrian.sampson on 30 Aug 2012 at 5:12

untitaker commented 9 years ago

Do not comment here, but on sampsyo/beets#133