FireFly Media Server › Firefly Media Server Forums › Firefly Media Server › General Discussion › Audioscrobbler/Last.FM Support with Portable_Player_Logging
- This topic has 5 replies, 4 voices, and was last updated 18 years ago by riro.
-
AuthorPosts
-
03/07/2006 at 3:33 PM #408t0mParticipant
Until Ron implemented audioscrobbler support to firefly, I’d like to share my way of Audioscrobbler Support for Firefly/mt-daapd.
The idea is to use the Portable_Player_logging described here: http://www.audioscrobbler.net/wiki/Portable_Player_Logging
and the Rockscrobbler Perl-Script, that can be found here: http://www.misticriver.net/photos/displayimage.php?album=lastup&cat=22288&pos=0
I wrote a quick ‘n dirty script to create a log .scrobbler, that can be used by rockscrobbler:
#!/bin/bash
DATABASE="/usr/local/var/cache/mt-daapd/songs3.db"
OUTLOG=$HOME/.scrobbler.log
LASTFILE=$HOME/scrobbler.date
SQLITE="sqlite3"
if [ -e $LASTFILE ]
then
. $LASTFILE
else
LASTRUN=0
fi
echo "#AUDIOSCROBBLER/1.0" > $OUTLOG
echo "#TZ/UNKNOWN" >> $OUTLOG
echo "#CLIENT/Firefly svn-1281" >> $OUTLOG
$SQLITE $DATABASE 'SELECT artist,album,title,track,song_length,time_played FROM songs where time_played > '$LASTRUN' ;' | awk -F '|' '{ printf "%st%st%st%st%dtLt%sn",$1,$2,$3,$4,$5/600,$6 }' >> $OUTLOG
echo "LASTRUN="`date +%s` > $LASTFILE
configure your cron to run this script 1st and than rockscrobbler.pl every 30 minute/ hour/ day / etc….
working fine for me…
/t0m
p.s. ” $SQLITE $DATABASE …. >> $OUTLOG is one line!
04/07/2006 at 5:15 AM #5403rpeddeParticipant@t0m wrote:
Until Ron implemented audioscrobbler support to firefly, I’d like to share my way of Audioscrobbler Support for Firefly/mt-daapd.
Nicely done, sir.
05/07/2006 at 11:55 AM #5404t0mParticipantseems the output need to be sorted by date, otherwise last.fm will complain:
Spam protection triggered: You submitted a track dated earlier than your last submission.
so we need to change the line:
$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
/t0m
22/10/2006 at 2:46 PM #5405riroParticipantCan’t get this to work…
The SQL-command looks OK but awk complains on the syntax.
Running:
awk -F '|' '{ printf %st%st%st%st%dtLt%sn",$1,$2,$3,$4,$5/600,$6 }'
Started out with “BusyBox v1.00 (2006.04.11-01:22+0000) multi-call binary” as it came with the unslug and then i get:
awk: cmd. line:1: Unexpected token
And with “GNU Awk 3.1.5” i get:
awk: { printf %st%st%st%st%dtLt%sn",$1,$2,$3,$4,$5/600,$6 }
awk: ^ syntax error
awk: { printf %st%st%st%st%dtLt%sn",$1,$2,$3,$4,$5/600,$6 }
awk: ^ backslash not last character on line
22/10/2006 at 7:46 PM #5406smbrannanParticipantIs it possible for someone to provide step by step instructions for getting firefly to log to last.fm under OS X.
This instructions in this thread are too technical for my little brain.
Anyone willing to try?
15/11/2006 at 9:14 AM #5407riroParticipantOMG.
Mental note: copy/paste… and copy/paste without changing lines.
My problem-code
awk -F '|' '{ printf %st%st%st%st%dtLt%sn",$1,$2,$3,$4,$5/600,$6 }'
The code i should use:
awk -F '|' '{ printf "%st%st%st%st%dtLt%sn",$1,$2,$3,$4,$5/600,$6 }'
I “forgot” the ” right after printf.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.