Discussion:
[Feature Request] library directory
gt
2011-06-03 07:17:57 UTC
Permalink
Hello list.

When i run update-cache -f command, cmus re-reads the tags of the files
present in library. The problem with this is that, when we rename the
files, they are no longer present in the library, and we have to
manually add them to the library.

I would suggest, that we have an option to specify a "base" folder
for our music collection, and all subdirectories under it are
automatically searched for music, on updating the cache. Like when we use
"a", in browser view to add music to the library.

This way, when we do an update-cache or update-cache -f, the "base"
music directory is searched apart from any other files present in a
different location. So renamed files will also be added to the library.

To make it even better, we can have multiple base directories, specified
in a comma seperated list, and the above could apply to them.

What do you guys think?
Paul van der Walt
2011-06-03 11:03:23 UTC
Permalink
Post by gt
Hello list.
Hello indeed.
Post by gt
[bla bla list of music directories in settings bla]
What do you guys think?
I think great. Fits my use case like a glove.
--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Johannes Weißl
2011-06-03 11:47:57 UTC
Permalink
Post by gt
When i run update-cache -f command, cmus re-reads the tags of the files
present in library. The problem with this is that, when we rename the
files, they are no longer present in the library, and we have to
manually add them to the library.
Hmm, you could use a script for updating:
#!/bin/bash
cmus-remote -C "update-cache $1"
cmus-remote -l /path/to/music/base1
cmus-remote -l /path/to/music/base2
Post by gt
I would suggest, that we have an option to specify a "base" folder
for our music collection, and all subdirectories under it are
automatically searched for music, on updating the cache. Like when we use
"a", in browser view to add music to the library.
This would be equivalent to the script I posted above, wouldn't it?
One thing that couldn't be done via scripting would be a constantly
watched folder (via fanotify/inotify): If you modify / add files to the
watched folder, the files are automatically updated / added to the
library.

Since we support *BSD as well, and inotify is Linux-only, it would be
good to have a replacement for other Unix-like operating systems as well
(kqueue? FEM? ...?). So it might be quite some work (or we use an
already established wrapper library like pnotify). I don't really need
this (since my library changes not so often, and if it does I can easily
do a quick :add ~/music), but if someone codes this we can review it and
eventually include it in cmus (if others are not objected to this whole
thing).


Greetings,
Johannes
gt
2011-06-04 07:02:18 UTC
Permalink
Post by Johannes Weißl
#!/bin/bash
cmus-remote -C "update-cache $1"
cmus-remote -l /path/to/music/base1
cmus-remote -l /path/to/music/base2
Hmm.. this script would do fine for the time being.
Post by Johannes Weißl
One thing that couldn't be done via scripting would be a constantly
watched folder (via fanotify/inotify): If you modify / add files to the
watched folder, the files are automatically updated / added to the
library.
Since we support *BSD as well, and inotify is Linux-only, it would be
good to have a replacement for other Unix-like operating systems as well
(kqueue? FEM? ...?). So it might be quite some work (or we use an
already established wrapper library like pnotify). I don't really need
this (since my library changes not so often, and if it does I can easily
do a quick :add ~/music), but if someone codes this we can review it and
eventually include it in cmus (if others are not objected to this whole
thing).
This sounds like a good idea too. Actually i wasn't really looking
forward to folder monitoring, as my requirements are quite simple. In
fact, i re-tagged all me music library a few weeks ago, and hence
noticed the update-cache limitation. Otherwise i rarely need to re-add
stuff to my library.

But, if someone can implement this, then it would be a welcome feature
to many. Maybe, we can add it to the wishlist over at the wiki.
Jason Woofenden
2011-06-04 15:58:49 UTC
Permalink
I really hate the "auto-scan for new files" feature, and I've
ditched several music players because there was no obvious way to
turn this off, or it started scanning my entire home directory
without asking.

That said, as long as it's off by default (and not automatically
enabled when you add a directory to your library) I don't see how
it would bother me.

I'd also like to note that this feature doesn't seem like it'd be
that light on resources. You can maybe use [ipd]notify while cmus
is running, but you'd have to do a full scan on startup to catch
files added/changed/moved while cmus was not running. This can be
pretty annoying.

That's my $0.02. Happy to hear from others.

Take care, - Jason
Paul van der Walt
2011-06-04 16:20:45 UTC
Permalink
Hi,
Post by Jason Woofenden
I really hate the "auto-scan for new files" feature, and I've
ditched several music players because there was no obvious way to
turn this off, or it started scanning my entire home directory
without asking.
That said, as long as it's off by default (and not automatically
enabled when you add a directory to your library) I don't see how
it would bother me.
I'd also like to note that this feature doesn't seem like it'd be
that light on resources. You can maybe use [ipd]notify while cmus
is running, but you'd have to do a full scan on startup to catch
files added/changed/moved while cmus was not running. This can be
pretty annoying.
That's my $0.02. Happy to hear from others.
Yeah, just to back that, I'd like to have a list of directories
to scan fully when doing update-cache, but the "keep up to date"
thing seems heavy and too-smart to me too.

Paul
--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
gt
2011-06-04 18:25:02 UTC
Permalink
Post by Jason Woofenden
I really hate the "auto-scan for new files" feature, and I've
ditched several music players because there was no obvious way to
turn this off, or it started scanning my entire home directory
without asking.
That said, as long as it's off by default (and not automatically
enabled when you add a directory to your library) I don't see how
it would bother me.
I'd also like to note that this feature doesn't seem like it'd be
that light on resources. You can maybe use [ipd]notify while cmus
is running, but you'd have to do a full scan on startup to catch
files added/changed/moved while cmus was not running. This can be
pretty annoying.
I also think so. So maybe the cmus-remote method johannes mentioned,
could be made the default behaviour for update-cache, instead of doing
this *notify stuff, which is probably overkill for a lightweight console
player.
Jason Woofenden
2011-06-05 06:41:22 UTC
Permalink
Post by gt
Post by Jason Woofenden
I really hate the "auto-scan for new files" feature, and I've
ditched several music players because there was no obvious way to
turn this off, or it started scanning my entire home directory
without asking.
That said, as long as it's off by default (and not automatically
enabled when you add a directory to your library) I don't see how
it would bother me.
I'd also like to note that this feature doesn't seem like it'd be
that light on resources. You can maybe use [ipd]notify while cmus
is running, but you'd have to do a full scan on startup to catch
files added/changed/moved while cmus was not running. This can be
pretty annoying.
I also think so. So maybe the cmus-remote method johannes mentioned,
could be made the default behaviour for update-cache, instead of doing
this *notify stuff, which is probably overkill for a lightweight console
player.
It is important not to do things the user has not asked for. I
would be angry if cmus added tracks from any folder when I didn't
tell it to. Telling it to re-read metadata does not mean it should
add tracks. If you want to add all the tracks in ~/music, then do
:add ~/music. AFAIK we don't have a setting for directories you'd
like auto-added, and I don't really think we should have such. If
you've got to fiddle with the settings to set something like that
up, you might as well set up a binding or a script like Johannes
mentioned.

Take care, - Jason
gt
2011-06-05 07:56:54 UTC
Permalink
Post by Jason Woofenden
It is important not to do things the user has not asked for. I
would be angry if cmus added tracks from any folder when I didn't
tell it to. Telling it to re-read metadata does not mean it should
add tracks. If you want to add all the tracks in ~/music, then do
:add ~/music. AFAIK we don't have a setting for directories you'd
like auto-added, and I don't really think we should have such. If
you've got to fiddle with the settings to set something like that
up, you might as well set up a binding or a script like Johannes
mentioned.
I guess the script is the way to go then. Thanks.

Loading...