Post by sb on Apr 13, 2021 10:26:27 GMT
hello all,
I hope that you are all well.
three years ago I have posted this addition on the old forum. Since the AudioPlayer*.xsl templates have been updated by the author in new release 9.53 of CATraxx, I have updated them, adding the changes to AudioPlayer_Simple.xsl as well, that I had never updated in the past simply because... I missed it

The purpose of these additions is to show the correct release year:
- If track year is different than album year, the track year is shown
- If track year is equal to album year, the album year is shown
- If track year and album year are undefined (empty), it shows "Unknown"
I hope it could be useful.
Salvatore
AudioPlayer.xsl: New code for track year, album year or unknown
---------------------------------------------------------------
<!-- !SB -->
<!-- ======================================== -->
<!-- Album or track release year -->
<!-- ======================================== -->
<xsl:choose>
<!-- Album and track year unknown -->
<xsl:when test="/data/record/trackdata/released/@year='' and /data/record/albumdata/released/@year=''">
<xsl:text>Unknown year (Track & album)</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<!-- If album and track year are different, show track year... -->
<xsl:when test="/data/record/trackdata/released/@year!=/data/record/albumdata/released/@year and /data/record/trackdata/released/@year!=''">
<xsl:value-of select="/data/record/trackdata/released/@year"/>
<xsl:text> (Track)</xsl:text>
</xsl:when>
<!-- ...otherwise show album year... -->
<xsl:otherwise>
<xsl:value-of select="/data/record/albumdata/released/@year"/>
<xsl:text> (Album)</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<!-- ======================================== -->
<!-- End of addition -->
<!-- ======================================== -->
<!-- SB! -->
insert in original file between row 103 and row 104:
<tr>
<td>
<a href="Track.xsl" target="_blank"><xsl:value-of select="/data/record/trackdata/fulltitle"/></a><xsl:text> </xsl:text>
<a href="TrackList_Songwriter.xsl?Title={/data/record/trackdata/title}@validate=yes,2,3@orderby=artist,title@xslparam:doctitle={/data/fld/track/title/@name}: {/data/record/trackdata/title}" target="_blank">
<img border="0" src="GoToPage.gif"/>
</a>
</td>
</tr>
< insert here >
</table>
================================================================================
AudioPlayer_Simple.xsl: New code for track year, album year or unknown
----------------------------------------------------------------------
<!-- !SB -->
<!-- ======================================== -->
<!-- Album or track release year -->
<!-- ======================================== -->
<xsl:choose>
<!-- Album and track year unknown -->
<xsl:when test="/data/record/trackdata/released/@year='' and /data/record/albumdata/released/@year=''">
<xsl:text>Unknown year (Track & album)</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<!-- If album and track year are different, show track year... -->
<xsl:when test="/data/record/trackdata/released/@year!=/data/record/albumdata/released/@year and /data/record/trackdata/released/@year!=''">
<xsl:value-of select="/data/record/trackdata/released/@year"/>
<xsl:text> (Track)</xsl:text>
</xsl:when>
<!-- ...otherwise show album year... -->
<xsl:otherwise>
<xsl:value-of select="/data/record/albumdata/released/@year"/>
<xsl:text> (Album)</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<br/>
<!-- ======================================== -->
<!-- End of addition -->
<!-- ======================================== -->
<!-- SB! -->
insert in original file between row 74 and row 75:
<tr align="CENTER">
<td valign="top" class="audioplayer_artist_title">
< insert here >
<xsl:call-template name="format-artist">
<xsl:with-param name="artists" select="/data/record/trackdata/artists"/>
<xsl:with-param name="newwindow" select="'True'"/>
<xsl:with-param name="hyperlink" select="'True'"/>
<xsl:with-param name="templatefile" select="'IMAGECAROUSEL'"/>
<xsl:with-param name="favoriteplaylink" select="'True'"/>
<xsl:with-param name="favoriteplaylink_ratingvalue" select="'5'"/>
</xsl:call-template>