fix(template): add conditional to only insert episode-num if season and episode numbers actually exist
This commit is contained in:
parent
ad4e456d09
commit
d502fa5585
8
tmpl.xsl
8
tmpl.xsl
|
|
@ -24,11 +24,13 @@
|
|||
<xsl:variable name="rest"
|
||||
select="substring-after($raw, '.')"/>
|
||||
|
||||
<xsl:variable name="episode"
|
||||
<xsl:variable name="episode0"
|
||||
select="number(normalize-space(substring-before($rest, '.')))"/>
|
||||
|
||||
<xsl:variable name="season" select="$season0 + 1"/>
|
||||
|
||||
<xsl:variable name="episode" select="$episode0 + 1"/>
|
||||
|
||||
<!-- zero pad -->
|
||||
<xsl:variable name="s2">
|
||||
<xsl:choose>
|
||||
|
|
@ -59,10 +61,12 @@
|
|||
<xsl:apply-templates
|
||||
select="node()[not(self::episode-num[@system='onscreen'])]" />
|
||||
|
||||
<!-- Add the onscreen one at the end -->
|
||||
<!-- Add the onscreen one at the end if the numbers actually exist -->
|
||||
<xsl:if test="$s2 >e; 0 and $e2 >e; 0">
|
||||
<episode-num system="onscreen">
|
||||
<xsl:value-of select="$onscreenValue"/>
|
||||
</episode-num>
|
||||
</xsl:if>
|
||||
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user