Discussion:
list artists
gt
2011-04-07 13:19:26 UTC
Permalink
Hello list,

Is there a way to export all the artists/albums/tracks etc. to a text
file?
Johannes Weißl
2011-04-07 13:29:02 UTC
Permalink
Post by gt
Hello list,
Is there a way to export all the artists/albums/tracks etc. to a text
file?
You can do that with:
:save -e -l file.txt

This saves all tracks from the library to file.txt (with metadata). If
you remove the `-e', just the filenames (line by line) are written.
Is this what you mean?


Johannes
gt
2011-04-07 14:18:49 UTC
Permalink
Post by Johannes Weißl
:save -e -l file.txt
This saves all tracks from the library to file.txt (with metadata). If
you remove the `-e', just the filenames (line by line) are written.
Is this what you mean?
Johannes
I wanted only the artists, but my cmus v2.3.4 doesn't support the -e
option. So with only the -l switch, the output is the same as that of
the ~/.cmus/lib.pl file.

What i ended up doing was c-a h from inside screen in cmus's library
view. This gave a decent enough output :P

What does the metadata output look like?
Johannes Weißl
2011-04-07 14:40:24 UTC
Permalink
Post by gt
I wanted only the artists, but my cmus v2.3.4 doesn't support the -e
option. So with only the -l switch, the output is the same as that of
the ~/.cmus/lib.pl file.
Then I suggest you upgrade to git master or pu, otherwise you are
missing all the great features added in the last months :-).
Post by gt
What i ended up doing was c-a h from inside screen in cmus's library
view. This gave a decent enough output :P
What does the metadata output look like?
The output looks like this:

file /path/to/file1
duration 260
codec mp3
bitrate 320000
tag artist The Beatles
tag album Abbey Road
tag title Come Together
file /path/to/file2
duration 183
codec mp3
bitrate 320000
tag artist The Beatles
tag album Abbey Road
tag title Something

There are no additional newlines between two tracks (technical reasons),
but the entries can be split on the "^file" line. If you are just
interested in the artists, this would do:
$ cmus-remote -C "save -e -l -" | sed -n "s/^tag artist \(.*\)/\1/p" | sort -u


Hope this helps!


Johannes
gt
2011-04-07 16:44:28 UTC
Permalink
Post by Johannes Weißl
Post by gt
I wanted only the artists, but my cmus v2.3.4 doesn't support the -e
option. So with only the -l switch, the output is the same as that of
the ~/.cmus/lib.pl file.
Then I suggest you upgrade to git master or pu, otherwise you are
missing all the great features added in the last months :-).
Post by gt
What i ended up doing was c-a h from inside screen in cmus's library
view. This gave a decent enough output :P
What does the metadata output look like?
file /path/to/file1
duration 260
codec mp3
bitrate 320000
tag artist The Beatles
tag album Abbey Road
tag title Come Together
file /path/to/file2
duration 183
codec mp3
bitrate 320000
tag artist The Beatles
tag album Abbey Road
tag title Something
There are no additional newlines between two tracks (technical reasons),
but the entries can be split on the "^file" line. If you are just
$ cmus-remote -C "save -e -l -" | sed -n "s/^tag artist \(.*\)/\1/p" | sort -u
Hope this helps!
I had been wanting to try out the latest great stuff that you have
added, but was too lazy to compile cmus myself. Thankfully i found
cmus-git in the arch user repo. I have installed it and will play around
with the great additions you have made. Thanks :)

Loading...