Reply To: Inteligent playlists

#7570
riro
Participant

@fizze wrote:

all you’d need is a job that grabs the “now playing” info likewise frmo the mt-daap’s XML file, and populates the DB.

I found a script (on this forum?) that reads the last played info and populates a rockscrobbler-logfile, and then I use rockscrobbler to Audioscrobbel (is that a word? 😕 )my tunes.

A small clip from the bash-script:


$SQLITE $DATABASE ‘SELECT artist,album,title,track,song_length,time_played FROM songs where time_played > ‘$LASTRUN‘ ORDER BY time_played ASC;’ | awk -F ‘|’ ‘{ printf "%st%st%st%st%dtLt%sn",$1,$2,$3,$4,$5/600,$6 }’ >> $OUTLOG

echo "LASTRUN="`date +%s` > $LASTFILE

Not that hard to convert it to first do a select and on the second line a insert into another table.
Just need to figure out an easy way to split time_played into separate date and time-columns.

//riro