Stable: 2.4.4
Development: 2.5.0-alpha4
Select all tracks, which Genre, for example, equal "Rock"
Submitted by SashaShveik on Thu, 2009-11-19 16:01
Can I select all files from the directory ~/music with Genre=Rock (mp3 tag) and add their to playlist? If yes, then How do it?
Not directly but if you want,
Not directly but if you want, you can use a script:
cd ~/music find ./ -regex '^.*\.mp3$' -exec bash -c "id3v2 -l \"{}\" | grep -i rock && mocp -a \"{}\"" \;This will add all the rock tagged stuff to the playlist. It may take some time if your directory is big.
You may want to use this script as an ExecCommand; you could assign it to F1 for instance.
Name this script findrock.sh and place it in ~/.moc/:
#!/bin/bash if [ -d "$1" ]; then cd "$1" else cd "$(dirname "$1")" fi nohup find ./ -regex '^.*\.mp3$' -exec bash -c "id3v2 -l \"{}\" | grep -i rock && mocp -a \"{}\"" \; > /dev/nullMake it executable:
and edit your ~/.moc/ and add this:
Now, when you press F1 in moc, moc will recursively search the folder you're in for 'rock' files.
I didn't test this so there may be a few mistakes.
(You need id3v2 utility (under debian: sudo apt-get install id3v2))
Thank you very much! You
Thank you very much!
You wrote the good article for the faq.
I slightly modified the script:
#!/bin/bash SEARCH=genre.*ambient if [ -d "$1" ] then cd "$1" else cd "$(dirname "$1")" fi nohup find ./ -regex '^.*\.mp3$' 2>/dev/null | \ sort | \ while read line do eyeD3 "$line" 2>/dev/null | \ grep -i "$SEARCH" && mocp -a "$line" done >/dev/null &Improvements: