Last.FM Rework and Auto DJ mode (1 Viewer)

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    This build in an update to use the latest last.fm API covering three areas:

    Scrobbling (last.fm account but no subscription)
    So the scrobbling side has been rewritten from scratch
    • Announce now playing track on last.fm website
    • Scrobbling tracks when played
    • Love / Ban functionality
    Last.fm Radio (Last.fm account and subscription)
    I have also added a basic radio functionality based on the new API but this does require a subscription and I do not believe radio is available in all countries
    • Standard last.fm radio stations
    • better integration to the rest of MP
    • Downloading (and deleting) of temporary thumbs for tracks being played if no local thumb exists
    Auto DJ (no last.fm account needed)
    Whilst this does not require a last.fm account scrobbling tracks will feed back and end up in better matches for everyone. This will simply look for similar tracks in your music database (won't work unless you have scanned tracks into the database)
    • Will attempt to keep playing music forever :)
    • Tracks must be scanned into the music database for this to work
     
    Last edited:

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    GIT branch is FEAT_Last.fm_API_2.0

    The changes are too big to post individual binaries so this is a full installer. Latest build is based on 1.3.0 and will allow upgrade from 1.3 RC or earlier. If you want to upgrade from a 1.3 installation this is possible by extracting the the package-mediaportal.exe file from within the installer (7Zip will allow you to do this) but this is not a supported installation method and is not guaranteed to work.

    I realise there are some people who will be very interested in the BASS player rework (WASAPI, Replay Gain etc) so a build is attached including those changes.

    Note for V2: There is a very tiny bug in V2 which is preventing the auto DJ function working. Please replace the databases binary with the attached to make this work (v2 version removed and replaced with v3)

    Changelog
    01
    • Initial version. This is very experimental. Based on 1.3 RC (GIT)
    02
    • A lot of code refinement
    • Authentication now uses mobile settings so should be simpler
    • Workaround for problems when skipping last.fm radio tracks
    • Radio now remember last artist / tag radio station
    • Code now allows for offline scrobbling and multiple users (still needs implementing)
    03
    • Massive rework of the internal code to improve stability and allow future enhancements
    • Fix for auto DJ functionality
    • Tweaks to Titan skin for similar tracks on now playing screen
    • Code to grab artist / track / album info now in place
    04
    • Brought up to date with latest MP code including some bug-fixes around artist / album info scraping and the latest BASS player rework code
    • Ability to toggle Auto DJ mode (This is currently only implemented in Titan and only inside the music browsing screens)
    • Config should now provide feedback that adding a user was successful
    • Playlist items can now be identified if they were added to Auto DJ functionality (no visibility to users yet)
    05
    • Updated to latest MP code (including a few fixes to BASS player code)
    • Added extra settings to control how the AutoDJ deals with the same tracks; you can now control whether you want to allow different versions of the same track (eg. if you have two version of Chasing Rainbows by Adele on different albums these will be treated as different songs or it will pick one) and you can also avoid adding tracks that are already in the playlist again (so will keep trying to add different tracks).
    • Added some extra debugging to try and pin down a few intermittent issues
    • Errors whilst playing radio (eg. no more content / subscription required ...) are prompted to users
    • Where no similar track is found AutoDJ will now attempt to use the artists top tracks and locate these locally (found this a particular issue on brand new albums on release day where there were no similar tracks on last.fm)
    • Some changes in the background to try and move towards a standard base for MP and MP2 (plus others as needed)
    06
    07
    • Fixed issue where last.fm radio playlist was not updated when not in last.fm radio plugin screen
    • Quite a bit of refactoring for Auto DJ to make it easier to tweak the logic
    If you have 1.3 or earlier you can just run the installer and upgrade. If you have 1.4 pre-release installed you need to extract the mediaportal installer (package-mediaportal.exe) and run that

    08
    Added build on 7-9-2013 based on current master (1.5 Pre release) so people should be able to upgrade to this from 1.4 and upgrade to 1.5 (if they want).

    09
    Build added based on current master (1.5 Final)
     
    Last edited by a moderator:

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    TODO list
    • Allow Auto DJ mode to be turned on / off inside of MP
    • Add options to enable announce / scrobble in config
    • Offline scrobbling (eg. if last.fm is down or internet connection not available)
    • Better algorithms to prevent drift in auto DJ mode
    • Easier setup
    • Clean up code (massively....)
    • Separately identify tracks added to playlist by Auto DJ so that can be cleared
    • Multiple last.fm users
    Known Issues
    • Current playing thumb is not updated outside of last.fm radio
    • Skipping tracks in radio causes problems
     
    Last edited:

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Setup

    Use the configuration option of the LastFM Scrobbler Test process plugin (not the last.fm radio window plugin)
    scrobbler.png


    For Auto DJ mode simply make sure the box is ticked, close the form and remember to press OK to close MP config.

    For last.fm account (scrobbling, radio etc) setup press the Add User button. You will be prompted for your last.fm username and password. You will get feedback as to whether the user has been added successfully or not.

    You can choose whether tracks should be announced on last.fm as playback starts and whether tracks should be scrobbled once played.

    Close this form and press OK to close MP config.
     

    Attachments

    • lastfm_setup.png
      lastfm_setup.png
      21.5 KB
    Last edited:

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    As expected really nice Mike !! (y)

    The (i assume updated config) is working well, adding a user also works. The Auto DJ mode works nice, 5 songs added after adding 1 song to playlist, and scrobbling is working just fine!
    LastFMScrobbler.PNG
    Scrobbling OK.PNG

    i don't know if you changed some code regarding the auto DJ mode, but what i noticed with your previous version was the following:
    I have a couple of Christmas albums (for example from Michael Bublé) and i've tagged those as 'Christmas' genre. But 'All i want for Christmas' was added as 2nd song. Could this be because the Artist is tagged als Pop/Rock online? Any thoughts on how to keep those Christmas tagged albums out of the auto DJ mode?
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    As expected really nice Mike !! (y)
    I see you are using the latest code not the version above ;)
    Is this the version built by BOT this morning? (there were some big changes to the scrobbling code and I have not fully tested that yet)

    i don't know if you changed some code regarding the auto DJ mode, but what i noticed with your previous version was the following:
    I have a couple of Christmas albums (for example from Michael Bublé) and i've tagged those as 'Christmas' genre. But 'All i want for Christmas' was added as 2nd song. Could this be because the Artist is tagged als Pop/Rock online? Any thoughts on how to keep those Christmas tagged albums out of the auto DJ mode?
    Quite simply the auto DJ look at
    Code:
    http://ws.audioscrobbler.com/2.0/?method=track.getsimilar&artist=xxx&track=yyy&api_key=f8e41f5535a88b70d78d52157fddd6f9
    (replace xxx and yyy with artist name and track title)

    This returns a list of similar tracks, the auto DJ mode then looks for which of these exist in your local collection and queues them up.

    Are you a subscriber and able to test the last.fm radio part of this?
     
    Last edited:

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    I see you are using the latest code not the version above ;)
    Is this the version built by BOT this morning? (there were some big changes to the scrobbling code and I have not fully tested that yet)
    Nope, Seb has a fork for us which we use on our productive system, and since i love this, we included your branch :) So i also tested with your latest commits, and not with the above posted .zip (hope that's ok!!)

    Quite simply the auto DJ look at
    Code:
    http://ws.audioscrobbler.com/2.0/?method=track.getsimilar&artist=xxx&track=yyy&api_key=f8e41f5535a88b70d78d52157fddd6f9
    (replace xxx and yyy with artist name and track title)

    This returns a list of similar tracks, the auto DJ mode then looks for which of these exist in your local collection and queues them up.
    OK, so not much you can do about that, it's the way the API works.

    Are you a subscriber and able to test the last.fm radio part of this?
    Unfortunately not, hopefully @ronilse can test this for you!

    ** EDIT **
    Checked that API:
    http://ws.audioscrobbler.com/2.0/?method=track.getsimilar&artist=bruno mars&track=when i was your man&api_key=f8e41f5535a88b70d78d52157fddd6f9

    Code:
    <track>
    <name>It's Beginning to Look a lot Like Christmas</name>
    <playcount>347449</playcount>
    <mbid>b8edc416-3eaa-4f21-81c5-8323502e34e3</mbid>
    <match>0.0640092</match>
    <url>http://www.last.fm/music/Michael+Bubl%C3%A9/_/It%27s+Beginning+to+Look+a+lot+Like+Christmas</url>
    <streamable fulltrack="0">0</streamable>
    <duration>31000</duration>
    <artist>
    <name>Michael Bublé</name>
    <mbid>611700cf-27f0-4dc9-ae80-c513a767853e</mbid>
    <url>http://www.last.fm/music/Michael+Bubl%C3%A9</url>
    </artist>
    <image size="small">http://userserve-ak.last.fm/serve/34s/85239863.png</image>
    <image size="medium">http://userserve-ak.last.fm/serve/64s/85239863.png</image>
    <image size="large">http://userserve-ak.last.fm/serve/126/85239863.png</image>
    <image size="extralarge">http://userserve-ak.last.fm/serve/300x300/85239863.png</image>
    </track>
    Unfortunately Last.fm puts the Christmas songs in there.
     
    Last edited:

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    Mike, just found a problem:

    When i disable the LastFM.Radio plugin (since i don't have a subscription) i'm getting an error when i play a CD and hit Skip for the next song. Result is the current track info is gone from NowPlaying, controls aren't responding anymore and playback can't be stopped unless you Exit MP.
    When i enable the plugin and skip a track, all is good!
     

    mbuzina

    Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    I have a little idea for the Auto-DJ / Scrobble feature: Color Code the Current play list to show where what is. Sample:
    - 1 Song played a while ago
    - 2 Song played not so long ago
    - 3 Previous song
    - 4 Song playing right now
    - 5 Next Song, manually added to the play list
    - 6 Another song manually added
    - 7 1st song added by Auto-DJ/scrobble
    - 8 2nd song added by Auto-DJ/scrobble
    - ....

    When I add a new song to the playlist, where will we insert the new song? For play next it should be between 4 - 5. For add to playlist should be between 6 - 7, right?
     

    Users who are viewing this thread

    Top Bottom