I'm working on a filter to reorganise a massive music library, which is currently this (still WIP):
F:\Music\$left($if2(%albumartist%,%artist%),1)\$if2(%albumartist%,%artist%)\\%year%$if(%date%,-$cutLeft(%date%,2)$if($eq($len(%date%),4),-$cutRight(%date%,2),),) ~ %album%\$left(%artist%,1)$left($right(%artist%,$sub($len(%artist%),$strrchr(%artist%, ))),1)[-%year%][$num(%discnumber%,2)-]$num(%track%,2) - %title%
Indented for readability:
F:\Music
\$left($if2(%albumartist%,%artist%),1)
\$if2(%albumartist%,%artist%)
\\%year%$if(%date%,-$cutLeft(%date%,2)$if($eq($len(%date%),4),-$cutRight(%date%,2),),) ~ %album%
\$left(%artist%,1)$left($right(%artist%,$sub($len(%artist%),$strrchr(%artist%, ))),1)[-%year%][$num(%discnumber%,2)-]$num(%track%,2) - %title%
The parts I'm concerned with are these:
%year%$if(%date%,-$cutLeft(%date%,2)$if($eq($len(%date%),4),-$cutRight(%date%,2),),)
Which displays the date as YYYY-MM-DD format (if this looks unnecessarily complicated, read on). %date% here seems to return MMDD from the date.
And this:
$left(%artist%,1)$left($right(%artist%,$sub($len(%artist%),$strrchr(%artist%, ))),1)[-%year%]
Which displays the first letter of the first and last word in the Artist field, followed by year as YYYY.
(E.g. "Arjen Anthony Lucassen", "2012" -> "AL-2012")
My issue is this:
In the first code snippet, %year% returns "2012". In the second one, it returns "2012-04-20", which is what I wrote all that other gobbledigook to display. (It also managed to display exactly the format I didn't want, both times
)
I haven't really tested much to reproduce this behaviour (just writing "[-%year%]" anywhere else doesn't work), but it's very strange.
Can anyone shed light on this issue? Is the %year% field supposed to display YYYY, YYYY-MM-DD or something else? In the documentation it just says "Year".