fix sorting by season/episode for seasons > 9 and episodes > 99

Patch by Steve Campbell, extended to cover "year as season" and series
with lots of episodes

Fixes #11893