[% IF image || plugin_meta.cover || plugin_meta.icon %] [%# Display plugin cover or icon %] [% IF image || plugin_meta.cover %] [% UNLESS image.match('^http'); image = image.replace('^/?', webroot); END %] [% ELSIF plugin_meta.icon %] [% END %] [% ELSE %] [%# fall back to 0 for cover link if itemobj.id isn't going to give us a valid id %] [% coverUrl = "/music/" _ (itemobj.id || 0) _ "/cover" %] [% END %]
[% IF songInfoPlayLinks; songInfoPlayLinks; END %] [%- albumInfo = BLOCK %] [% IF itemobj.album %] [% IF itemobj.album.id %] [% item = BLOCK %][% itemobj.album.title || itemobj.album.name | html %][% END %] [% ELSIF itemobj.album.link %] [% item = BLOCK %] [% itemobj.album.title || itemobj.album.name | html %][% END %] [% ELSE %] [% item = BLOCK %][% itemobj.album.title || itemobj.album.name | html %][% END %] [% END %] [% PROCESS songInfoItem title = "ALBUM" %] [% END %] [% END %] [% IF albumFirst; albumInfo; END %] [% IF plugin_meta.title %] [% item = BLOCK %][% plugin_meta.title | html %][% END %] [% PROCESS songInfoItem title = "TITLE" %] [% END %] [% roles = itemobj.contributorRoles || itemobj.contributors.keys; FOREACH role = roles.sort; IF (itemobj.album.compilation || itemobj.compilation) && role != "ALBUMARTIST"; NEXT; END; %] [% contributors = itemobj.contributors.${role} || itemobj.contributorsOfType(role) || itemobj.album.artistsForRoles(role) %] [% IF contributors %] [% contributorsHTML = [] %] [% FOREACH contributor = contributors %] [% UNLESS notarget; target = "target=\"browser\""; END %] [% htmlArtist = contributor.name | html; IF contributor.link; contributorHTMLFrag = "$htmlArtist"; ELSIF contributor.id; contributorHTMLFrag = BLOCK %][% htmlArtist %][% END; ELSE; contributorHTMLFrag = htmlArtist; END %] [% contributorsHTML.push(contributorHTMLFrag) %] [% END %] [% item = contributorsHTML.join(', ') %] [% title = role | upper; PROCESS songInfoItem %] [% END %] [% END %] [% IF plugin_meta.artist %] [% item = BLOCK %][% plugin_meta.artist | html %][% END %] [% PROCESS songInfoItem title = "ARTIST" %] [% END %] [% IF !albumFirst; albumInfo; END %] [% IF itemobj.genres %] [% genresHTML = [] %] [% FOREACH genre = itemobj.genres %][% UNLESS notarget; target = "target=\"browser\""; END %] [% htmlGenre = genre.name | html %] [% IF genre.id %] [% genreHTMLFrag = BLOCK %][% htmlGenre %][% END %] [% ELSIF genre.link %] [% genreHTMLFrag = "$htmlGenre" %] [% ELSE %] [% genreHTMLFrag = htmlGenre %] [% END %] [% genresHTML.push(genreHTMLFrag) %] [% END %] [% item = genresHTML.join(', ') %] [% PROCESS songInfoItem title = "GENRE" %] [% END %] [% IF itemobj.year %] [% IF itemobj.year.id %] [% item = BLOCK %][% itemobj.year.name| html %][% END %] [% ELSIF itemobj.year.link %] [% item = BLOCK %][% itemobj.year.name| html %][% END %] [% ELSE %] [% item = BLOCK %][% itemobj.year.name| html %][% END %] [% END %] [% PROCESS songInfoItem title = "YEAR" %] [% END %] [% IF albumDuration %] [% item = albumDuration; title = "LENGTH"; PROCESS songInfoItem %] [% ELSIF itemobj.albumlength %] [% item = itemobj.albumlength.name; title = "LENGTH"; PROCESS songInfoItem %] [% END %] [% IF itemobj.release_type %] [% item = itemobj.release_type.name | html; title = "RELEASE_TYPE"; PROCESS songInfoItem %] [% END %] [% IF itemobj.album.compilation || itemobj.compilation %] [% item = "YES" | string; title = "COMPILATION"; PROCESS songInfoItem %] [% END %] [% IF itemobj.album.replay_gain.defined %] [% item = itemobj.album.replay_gain | format('%2.2f') |html; title = "ALBUMREPLAYGAIN"; PROCESS songInfoItem %] [% ELSIF itemobj.albumreplaygain %] [% item = itemobj.albumreplaygain.name |html; title = "ALBUMREPLAYGAIN"; PROCESS songInfoItem %] [% END %]