Page 1 of 1

Random files

PostPosted: 04 Feb 2014, 19:01
by ejer
Hi, thanks for your great work on this. I was wondering if there is any way now or if it is planned to have a way to add something like 100 random files to the playlist?

I have done this in bash with something like

Code: Select all
shuf -n25 $SONGS | $MPC -q add


I have made a little script which breaks the library into genres (based on folder structure) so you can do 100 random rock songs etc.

Code: Select all
#!/bin/sh
IFS='
'

read -p "You must run mpc update if you want the latest changes to work - CTRL-C now and do that if you need to, otherwise hit enter" NOTHING

GENREDIR="genres"
SONGSFILE="songs.txt"

mpc listall > $SONGSFILE

if [ ! -d $GENREDIR ]; then
        mkdir $GENREDIR
fi

for i in $( cat $SONGSFILE | sed 's#/.*##g' | uniq ); do
        touch "$GENREDIR/$i"
done

for i in $( ls $GENREDIR | sed 's/_/ /g' ); do
        sed -n "/$i//p" $SONGSFILE > "$GENREDIR/$i.1"
        mpc search genre "$i" >> "$GENREDIR/$i.1"
        uniq "$GENREDIR/$i.1" "$GENREDIR/$i"
done

rm $GENREDIR/*.1
exit
this is probably not very useful to you, just for ideas.

Re: Random files

PostPosted: 04 Feb 2014, 19:24
by ejer
hmm I should have put this in feature requests I suppose. Sorry, feel free to move :ugeek:

Re: Random files

PostPosted: 04 Feb 2014, 20:04
by ACX
Hi ejer, don't worry. We were already thinking on a smart way to have a true random playback through the entire database To me it's an essential feature, so we are going to manage it via RuneUI as soon as possible.

Re: Random files

PostPosted: 04 Feb 2014, 20:20
by ejer
Essential feature for me too (although I can make it happen from the backend I am sure - just installed today). The problem is my DB has songs from classical to death metal, so random per genre is a great feature as well. Harder to implement though, it depends on good (standardized) folder structure or genre ID3 tags.

Re: Random files

PostPosted: 04 Feb 2014, 22:29
by ACX
I'm in your same situation :) Random per genre could be a further step of development, but as you say it depends on a good library organization by the user.