Audioscrobbler/Last.FM Support with Portable_Player_Logging

FireFly Media Server Firefly Media Server Forums Firefly Media Server General Discussion Audioscrobbler/Last.FM Support with Portable_Player_Logging

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #408
    t0m
    Participant

    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!

    #5403
    rpedde
    Participant

    @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.

    #5404
    t0m
    Participant

    seems 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

    #5405
    riro
    Participant

    Can’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
    #5406
    smbrannan
    Participant

    Is 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?

    #5407
    riro
    Participant

    OMG.

    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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.