FireFly Media Server › Firefly Media Server Forums › Firefly Media Server › Feature Requests › AudioScrobbler / last.fm support
- This topic has 53 replies, 18 voices, and was last updated 14 years, 8 months ago by pcace.
-
AuthorPosts
-
24/10/2008 at 12:04 PM #5264AnonymousInactive
Hi,
I’ve just released the version 0.7b of FireflyClient which includes a last.fm scrobbling support :
https://sourceforge.net/project/showfiles.php?group_id=212642More information available on a thread on this forum about firefly client : http://forums.fireflymediaserver.org/viewtopic.php?t=7198&start=90
I know this is a client-side only solution (compared to a firefly media server plugin) but it may do the trick !
— caribou
14/04/2010 at 1:16 PM #5265pcaceParticipantHey,
i just tried to install lastfm support in my mt-daapd server. BUT i get a strange error: i changed the path names according to my needs but it simply dont works. what i get is:
[: 33: -rw-r--r-- 1 mt-daapd nogroup 19552256 2010-04-14 14:48 /var/cache/mt-daapd/songs3.db: unexpected operator
I tried the script from here: http://www.themaelstrom.co.uk/node/10
I run ubuntu 9.04 Server (mt-daapd version svn-1696, sqlite3 version 3.6.16)Hopefully someone can help me!
Thanks!
Thats the complete output:
user@mashine:~/scripts$ cat lastfmsubmit.sh
#!/bin/bash# fetch newly played songs from fireflydb and write
# into lastfmsubmitd readable format# config
SQLITE=/usr/bin/sqlite3
DATABASE=/var/cache/mt-daapd/songs3.db
LASTFILE=./lastfmsubmit.date
DBLSFILE=./lastfmsubmit.ls# get last run time
if [ -e $LASTFILE ]
then
. $LASTFILE
else
LASTRUN=0
fi# get last database file date
if [ -e $DBLSFILE ]
then
. $DBLSFILE
else
DBLSRUN=
fi# exit when database file unchanged
DBLSNOW=`ls -l $DATABASE`
if [ “$DBLSRUN” == “$DBLSNOW” ]
then
exit
fi# log file date
echo “DBLSRUN=”$DBLSNOW”” > $DBLSFILE# query database
OUTFILE=$(mktemp /tmp/mt-daapd-XXXXXXXX)
$SQLITE $DATABASE ‘SELECT artist,album,title,track,song_length,time_played FROM songs where time_played > ‘$LASTRUN’ ORDER BY time_played ASC;’ | gawk -F ‘|’ ‘{ printf “—nartist: “%s”nalbum: “%s”ntitle: “%s”ntrack: %snlength: %dntime: !timestamp %sn”,$1,$2,$3,$4,$5/1000,strftime(“%Y-%m-%d %T”,$6) }’ > $OUTFILE# Move the file to the daemon spool directory if it is not empty
if [ -s $OUTFILE ]
then
mv $OUTFILE /var/spool/lastfm
fi# log query date
echo “LASTRUN=”`date +%s` > $LASTFILE# make lastfmsubmitd files readable
chmod 664 /var/spool/lastfm/*user@mashine:~/scripts$ sudo sh lastfmsubmit.sh
[: 33: -rw-r–r– 1 mt-daapd nogroup 19552256 2010-04-14 14:52 /var/cache/mt-daapd/songs3.db: unexpected operator
user@mashine:~/scripts$14/04/2010 at 1:17 PM #5266pcaceParticipantHey,
i just tried to install lastfm support in my mt-daapd server. BUT i get a strange error: i changed the path names according to my needs but it simply dont works. what i get is:
[: 33: -rw-r--r-- 1 mt-daapd nogroup 19552256 2010-04-14 14:48 /var/cache/mt-daapd/songs3.db: unexpected operator
I tried the script from here: http://www.themaelstrom.co.uk/node/10
I run ubuntu 9.04 Server (mt-daapd version svn-1696, sqlite3 version 3.6.16)Hopefully someone can help me!
Thanks!
Thats the complete output:
user@mashine:~/scripts$ cat lastfmsubmit.sh
#!/bin/bash# fetch newly played songs from fireflydb and write
# into lastfmsubmitd readable format# config
SQLITE=/usr/bin/sqlite3
DATABASE=/var/cache/mt-daapd/songs3.db
LASTFILE=./lastfmsubmit.date
DBLSFILE=./lastfmsubmit.ls# get last run time
if [ -e $LASTFILE ]
then
. $LASTFILE
else
LASTRUN=0
fi# get last database file date
if [ -e $DBLSFILE ]
then
. $DBLSFILE
else
DBLSRUN=
fi# exit when database file unchanged
DBLSNOW=`ls -l $DATABASE`
if [ “$DBLSRUN” == “$DBLSNOW” ]
then
exit
fi# log file date
echo “DBLSRUN=”$DBLSNOW”” > $DBLSFILE# query database
OUTFILE=$(mktemp /tmp/mt-daapd-XXXXXXXX)
$SQLITE $DATABASE ‘SELECT artist,album,title,track,song_length,time_played FROM songs where time_played > ‘$LASTRUN’ ORDER BY time_played ASC;’ | gawk -F ‘|’ ‘{ printf “—nartist: “%s”nalbum: “%s”ntitle: “%s”ntrack: %snlength: %dntime: !timestamp %sn”,$1,$2,$3,$4,$5/1000,strftime(“%Y-%m-%d %T”,$6) }’ > $OUTFILE# Move the file to the daemon spool directory if it is not empty
if [ -s $OUTFILE ]
then
mv $OUTFILE /var/spool/lastfm
fi# log query date
echo “LASTRUN=”`date +%s` > $LASTFILE# make lastfmsubmitd files readable
chmod 664 /var/spool/lastfm/*user@mashine:~/scripts$ sudo sh lastfmsubmit.sh
[: 33: -rw-r–r– 1 mt-daapd nogroup 19552256 2010-04-14 14:52 /var/cache/mt-daapd/songs3.db: unexpected operator
user@mashine:~/scripts$03/05/2010 at 1:28 PM #5267pcaceParticipant@FrankZabbath wrote:
So here’s my currently running script:
#!/bin/bash
# fetch newly played songs from fireflydb and write
# into lastfmsubmitd readable format
# config
SQLITE=sqlite
DATABASE=/opt/var/mt-daapd/songs.db
LASTFILE=/opt/var/mt-daapd/lastfmsubmit.date
DBLSFILE=/opt/var/mt-daapd/lastfmsubmit.ls
# get last run time
if [ -e $LASTFILE ]
then
. $LASTFILE
else
LASTRUN=0
fi
# get last database file date
if [ -e $DBLSFILE ]
then
. $DBLSFILE
else
DBLSRUN=
fi
# exit when database file unchanged
DBLSNOW=`ls -l $DATABASE`
if [ "$DBLSRUN" == "$DBLSNOW" ]
then
exit
fi
# log file date
echo "DBLSRUN="$DBLSNOW"" > $DBLSFILE
# query database
OUTFILE=$(mktemp /tmp/mt-daapd-XXXXXXXX)
$SQLITE $DATABASE 'SELECT artist,album,title,track,song_length,time_played FROM songs where time_played > '$LASTRUN' ORDER BY time_played ASC;' | gawk -F '|' '{ printf "---nartist: "%s"nalbum: "%s"ntitle: "%s"ntrack: %snlength: %dntime: !timestamp %sn",$1,$2,$3,$4,$5/1000,strftime("%Y-%m-%d %T",$6-3600) }' > $OUTFILE
mv $OUTFILE /var/spool/lastfm
# log query date
echo "LASTRUN="`date +%s` > $LASTFILE
# make lastfmsubmitd files readable
chmod 664 /var/spool/lastfm/*
Be sure to set the paths, the sqlite executable and time offset to your needs. This script needs bash and gawk available via ipkg.
I haven’t tried yet to change the shebang line from bash to sh. Might be better to do so.Hey Thank you a lot! it Works good!
What do i have to do to change the “time played” in last fm? Every Song is shown as played 2 hours later than it originaly is!Any idea what i can do there?
Thanks!
Pcace
-
AuthorPosts
- The forum ‘Feature Requests’ is closed to new topics and replies.