[% origlastfm = lastfm;
origlastfmp1 = lastfmp1;
IF origlastfm != 'browse';
lastfm = '';
lastfmp1 = '';
END;
sas = 'PLUGIN_LASTFM_SIMILAR_ARTISTS' | string;
pagetitle = 'PLUGIN_LASTFM_MODULE_NAME' | string; pageicon = 'RADIO';
pwd_list = BLOCK -%]
[% "PLUGIN_LASTFM_MODULE_NAME" | string %]
[% IF origlastfm == 'browse' %]
[% crumbSeparator || '/' %]
[% origlastfmp1 %]
[% END;
END;
IF !ajaxUpdate;
IF origlastfm == 'browse';
pagetitle = origlastfmp1;
homeString = 'Favourites';
command = ''; type = ''; noAjax = 1;
goHomeURI = PROCESS href lastfm="$type" lastfmp1="$command";
END;
pageHeaderInfo = BLOCK;
IF user;
anchorcontrols = 'stationanchor';
user %]'s [% "PLUGIN_LASTFM_MODULE_NAME" | string;
END;
END;
PROCESS pageheader.html bodyscript="onLoad='self.focus();document.station.lastfmp1.focus();globalOnload();'"; %]
[% ELSE %] [%# ajaxUpdate %]
[% END %]
[%- BLOCK href -%]
[%- IF !noHref %]href="[% END %][% IF !noAjax %]javascript:ajaxRequest('[% END %][% webroot %][% path %][% IF !noAjax %]', '[% END %]?lastfm=[% lastfm | uri %]&lastfmp1=[% lastfmp1 | uri %][% IF !noAjax %]');aReload();[% END %][% IF !noHref %]"[% END -%]
[%- END -%]
[% BLOCK lastfmLink;
IF !noHref;
WRAPPER $link noTarget=1;
PROCESS href;
END;
ELSE;
PROCESS href;
END;
END;
BLOCK simfav;
PROCESS lastfmLink noHref=0 lastfm="addlfm" lastfmp1="artist/$simartist/similarartists" link="favaddlink";
END;
BLOCK simplay;
PROCESS lastfmLink noHref=1 lastfm="playlfm" lastfmp1="artist/$simartist/similarartists" link="nolink";
END;
BLOCK simplayIcon;
PROCESS lastfmLink noHref=0 lastfm="playlfm" lastfmp1="artist/$simartist/similarartists" link="playlink";
END;
BLOCK ccontrols;
PROCESS lastfmLink lastfm="$type" lastfmp1="$command";
END;
BLOCK stationanchor %]
[% END;
BLOCK startanchor %]
[% PROCESS cmdToTop %]
[% END;
WRAPPER contentcontainer;
IF player == '';
'
'; 'PLUGIN_LASTFM_CHOOSE_PLAYER' | string; '
';
ELSIF user == '';
'
'; 'PLUGIN_LASTFM_SETUP_LOGIN' | string; '
';
ELSE;
IF lastfmplaying;
# anchorcontrols = 'stationanchor';
# WRAPPER contentanchor; 'NOW_PLAYING' | string; END;
anchorcontrols = '';
WRAPPER contentitem %]
[% IF track.image %]
[% END %]
[% END;
IF station_url;
type = 'addlfm';
command = station_url;
link = 'favaddlink';
WRAPPER contentitem leftcontrols='ccontrols' rightcontrols = 'dummylink' %]
[% station %]
[% END;
ELSE;
WRAPPER contentitem %]
[% station %]
[% END;
END;
simartist = track.creator;
textlink = PROCESS simplay;
WRAPPER contentitem leftcontrols='simfav' noHref=0 lineclass = " ";
track.creator;
END;
textlink = ""; lineclass = "";
END;
IF status;
'
';
IF status == 'FAILEDLOGIN';
'PLUGIN_LASTFM_SESSION_ERROR' | string;
ELSIF status == 'FAILEDCONNECT';
'PLUGIN_LASTFM_CONNECTION_ERROR' | string;
ELSIF status == 'STARTING';
'PLUGIN_LASTFM_WAIT' | string;
ELSIF status == 'WARN';
'PLUGIN_LASTFM_WARNING' | string;
ELSIF status == 'NOCONTENT';
'PLUGIN_LASTFM_NO_TRACKS' | string;
END;
'
';
END;
# myClientState.playmode;
IF lastfmplaying;
WRAPPER contentanchor; END; #'Commands';
link = 'playlink';
type = 'command';
textlink = "";
controls = "";
leftcontrols = "";
rightcontrols = "";
WRAPPER contentitem %]
[% END;
excludecmds = { love = 0, ban = 0, skip = 0 };
textlink = "";
controls = "";
leftcontrols ="";
rightcontrols = "";
noHref=0;
FOREACH command = commands;
IF !excludecmds.keys.grep(command).size;
IF command == 'rtp';
BLOCK rstate -%]
[% 'ON' | string %]
[% 'OFF' | string %]
[%- END;
textlink = ''; controls = '';
WRAPPER contentitem lineclass = " " %]
[% "PLUGIN_LASTFM_RTP" | string; "COLON" | string; %]
[%- PROCESS rstate -%]
[% END;
ELSIF command == 'discovery';
BLOCK dstate -%]
[% 'ON' | string %]
[% 'OFF' | string %]
[%- END;
textlink = ''; controls = '';
WRAPPER contentitem lineclass = " " %]
[% "PLUGIN_LASTFM_DISCOVERY" | string; "COLON" | string; %]
[%- PROCESS dstate -%]
[% END;
ELSE;
textlink = PROCESS ccontrols noHref=1 lastfm="$type" lastfmp1="$command";
WRAPPER contentitem lineclass = " ";
command;
END;
END;
textlink = ""; controls = ""; noHref=0; lineclass = "";
END;
END;
command = 0;
END;
IF history.size > 0;
anchorcontrols = 'stationanchor';
WRAPPER contentanchor; 'Recently Played'; END;
anchorcontrols = '';
FOREACH htrack = history;
simartist = htrack.0;
textlink = PROCESS simplay;
WRAPPER contentitem leftcontrols='simfav' %]
[% htrack.1 %]
[% htrack.0 %]
[% IF htrack.2 %]
[% htrack.2 %]
[% END;
END;
END;
END;
anchorcontrols = 'startanchor';
IF lastfmplaying;
WRAPPER contentanchor; 'PLUGIN_LASTFM_CHANGE_STATION' | string; END;
ELSE;
WRAPPER contentanchor; 'PLAY' | string; 'PLUGIN_LASTFM_MODULE_NAME' | string; END;
END;
anchorcontrols = '';
IF origlastfm != 'browse';
type = 'browse';
link = 'descendlink';
noAjax = 1;
command = 'Neighbours';
WRAPPER contentitem controls='ccontrols' lineclass = " " %]
Browse Neighbours
[%- END;
command = 'Friends';
WRAPPER contentitem controls='ccontrols' lineclass = " " %]
Browse Friends
[%- END;
noAjax = 0 %]
[%- BLOCK ldcontrol -%]
[%- END -%]
[%- BLOCK rdcontrol -%]
[%- END -%]
[%- END -%]
[% BLOCK myfavdel;
PROCESS lastfmLink lastfm="delete" lastfmp1="$stationlink" link="favdellink";
END;
loop = 0;
WHILE loop < stationnames.size;
station = stationnames.$loop;
stationlink = stationlinks.$loop;
textlink = PROCESS lastfmLink noHref=1 lastfm="playlfm" lastfmp1="$stationlink" link="playlink";
WRAPPER contentitem leftcontrols='myfavdel' noHref=0 rightcontrols="dummylink";
station;
END;
loop = loop + 1;
END;
END;
END; # contentcontainer %]
[% IF !ajaxUpdate %]
[% PROCESS pagefooter.html %]
[% END %]