The component gives you several ways of adding stations. Artist stations can be added from the context menu. Your personal stations can be added from the "File/Open Last.fm Radio Station" menu, as can custom stations. The component will also catch Last.fm URIs entered from the "File/Add location..." dialog or command line, but these don't create automatically refreshing playlists.

Thanks to those that answered my questions during development. As usual, all feedback is welcome!

Regarding the future of this componentThe component is still using the old Last.fm Radio API, which was due to be discontinued over half a year ago, and is therefore running on borrowed time. When the new radio API was released I went some way to updating, but hit some problems and then didn't have the time.

However the new radio API requires users to be subscribers in order to listen, and as I expect the continuing popularity of foo_lastfm_radio stems from the fact that you don't need to subscribe, it is unlikely that I'll update to the new API any time soon. This means that if and when the old radio API is deactivated, it will be RIP foo_lastfm_radio.

A note on Love/BanThis functionality is part of a separate API, and additionally requires a corresponding audioscrobbler submission (see http://www.last.fm/api/show?service=260). It therefore won't be implemented in foo_lastfm_radio. Sorry.

Changed in version 0.5.x:

0.5.7d: Removed limit on text length in custom station dialog.

0.5.7c: Can assign keyboard shortcuts to Last.fm Radio contextmenu items.

0.5.6: New technical info field "lastfm:imageURL". Use $info(lastfm:imageurl) to retrieve.

0.5.5: Removed 'fan' custom station as it only returns empty playlists.

0.5.5: New advanced preference: cache album art to a file.

0.5.4: Context menu for opening artist stations now uses %artist% rather than %album artist%. This was causing problems with various artist albums.

0.5.4: Small usability improvements to the Custom Station dialog.

0.5.3: Updated new advanced preference from 0.5.2 to also disable 'Playback Follows Cursor' setting if set.

0.5.2: No longer possible to add non-Last.fm tracks to Last.fm playlists. This includes tracks cut from Last.fm playlists. Prevents reordering playlist contents and potential problems with playlists not refreshing.

0.5.2: New advanced preference: Set playback order to 'Default' when playing Last.fm radio.

0.5.1: Fixed: Custom station dialog OK button would remain disabled when first selecting an item from history.

0.5.1: Adding lastfm:// URLs from the command-line or 'File/Add Location...' dialog creates automatically updating playlists. Note that adding from the command-line halts playback and clears your default or current playlist in the same way adding any other file does.

Option to reuse a single playlist for all stations.

Favourite stations: managed from the preferences page, accessed in the File/Last.fm Radio menu.

Changed in previous versions:

0.4.2: FIX: Using the close button in the custom station dialog doesn't return control to the main window.

0.4.2: FIX?: Rare crash on track selection/playback.

0.4.1: Playlists update silently.

0.4.1: No more obnoxious popups on expired tracks, or empty playlist retrievals.

0.4.1: FIX: On startup, sometimes two lots of tracks will be retrieved for a single playlist.

0.4.1: FIX: $if(%album%,then,else) always returns then, even if album tag is empty.

0.4: Album art support. (Specify a default image in the preferences page.)

0.4: Improved custom station dialog. Now remembers previous entries.

0.4: Last.fm links can be accessed from the context menu.

0.4: Improved error handling.

Fixed crash when attempting to write tags.

Fixed tags disappearing on playback.

Fixed non-ANSI characters not displaying correctly.

Improved auto-refresh playlist logic. Old tracks (tracks retrieved prior to the currently playing item) are removed from all playlists, which refresh when 3 tracks or less are remaining.

Fixed crash when selecting keyboard shortcuts preferences page.

Playlists are given friendlier names and can be renamed.

Fixed escaped characters in tags.

Note: Played tracks are not scrobbled. (Use foo_audioscrobbler with "Only submit tracks from the Media Library" disabled if you want this functionality.)Note 2: Users of foo_playback_custom (or other components which write tags to files during playback) should check "Only tracks in the media library update playback statistics" in that component's options to avoid problems with playback.

Oh my. This is awesome. One thing I would like is the ability to add stations to an existing playlist, as I have an "Internet Radio" playlist, and if I could add last fm stations to it that would be amazing! Also it doesn't seem to be scrobbling what you play, which would be good. Oh and another suggestion, it would be nice if playlists were called something like "TomBarlow's Recommended Station" instead of "lastfm://user/TomBarlow/recommended".

Context menuThe command is shown even though the artist tag is undefined (shows "?'s station"). The description of the command description only shows "Last.fm Radio".

Main menuThe command descriptions should end with a (single) period to be consistent with the style used by foobar2000 itself (core and official components). I also suggest to change the name of the root command to "Open Last.Fm Radio Station" and move it to the file_open section, file_playlist would be my second choice.

PlaylistsIt would be nice if the playlists had friendlier names and could be renamed. If you need to store information associated with a playlist, the best solution is to use a playlist property.

TagsNon-ASCII characters do not display correctly. They look as if the strings had been converted from ISO 8859-1 to UTF-8 while they already where UTF-8 before. XML entities like &_amp_; appear untranslated (underscores added to keep the forum software from translating it).

There are several solutions for the tags-disappearing-on-playback problem:

Provide metadata for titleformatting through a metadb_display_field_provider. This limits you to a fixed set of fields, and components that do not use titleformatting will not be able to use the information (for example the properties window or the selection properties UI element).

Rewrite the URL and implement a "redirecting" input service. The rewritten URL would point to a file in a local cache or would use a custom scheme. Your input service would then internally open the input for the real file and forward all requests to it. For the metadata retrieval methods you would add the cached tag information to the data returned by the real input.

I also frequently get this error when trying to play a song from a previously generated playlist:Unable to open item for playback (Invalid ticket (403)):"http://kingpin6.last.fm/user/c9aba423b670940774b96984f728630e.mp3"

I also frequently get this error when trying to play a song from a previously generated playlist:Unable to open item for playback (Invalid ticket (403)):"http://kingpin6.last.fm/user/c9aba423b670940774b96984f728630e.mp3"

The URLs returned by the last.fm server represent "tickets" which are only good for one use.

Actually, a few minutes after my last post I came to the conclusion that the component currently uses an approach that makes things more complicated than they need to be - both for users and for the implementation. I'm not an expert on Last.fm radio stations, but as far as I know they are conceptually streams that support skipping to the next song as a bonus features.

On the technical side, the server returns XSPF playlists for a given station that contain a few songs in the form of one-use URLs and metadata for the song. The most straightforward way to implement this in foobar2000 would be an input service that acts as a proxy to this "stream". When it is used for playback, it would retrieve the XSPF playlist from the server, open the input for the first track and report the songs metadata as dynamic track metadata (like a regular HTTP stream). When the track ends or playback of the stream is restarted (like when you double-click the playlist entry when it is already playing), it would go to the next. When it runs out of tracks, it would retrieve the XSPF playlist with the next few songs from the server.

There are a few technical issues - for example, the caching and retrieval of the XSPF playlist should not actually be handled by each input instance but by a central module - but overall I think this approach would make it easier to handle Last.fm stations in foobar2000. The current way with automatically updating playlists that contain one-use URLs seems a bit out-of-place.

The URLs returned by the last.fm server represent "tickets" which are only good for one use.

Yes, this is a little unfortunate. When I first started working on the component a few months ago the tickets weren't single use and you could replay tracks and jump around within the playlist (with some limits I believe), so the current method made sense. (I also observed this in other media players with Last.fm functionality.) I just started working on it again the other day and the behaviour had changed.

I still think it makes some sense to have playlists though as it means you can see which tracks are coming, and skip forward as you wish. The logic needs to be changed though, perhaps removing played or skipped tracks as well as adding new ones.

Thanks for the detailed points foosion. Are playlist properties persistent between opening and closing foobar2000?

it's great!!! I was looking for this for a very long time:http://www.hydrogenaudio.org/forums/index....showtopic=54264many thanks btw. does password stored encrypted? I just realized audioscrobbler plugin stores unencrypted password and report it, you plugin seems to encrypt it. Right? and how good this encrypion is? suggestion: auto normalize volume please, some tracks are much more louder than other, I think there is no other sollution cause files are streaming? it just can be normalized on the fly to play all files on same volume

Regarding scrobbling tracks: I've had a look at the documentation for this and although I haven't tried it yet it looks like it may cause conflicts with other programs also retrieving sessions for the same user account (e.g. foo_audioscrobbler), causing both plug-ins to be repeatedly disconnected. This may not be a problem, but we'll see...