I'm writing a source script for TheTVDB. Unfortunately, their API does not allow a search for a specific season. You can search for a show, a specific episode, or all of it.
The docs are a bit unclear on how to use If statements - there is a $if, but not closing $endif for a code block. 'If' is a bit annoying to search for, so I'm sorry if this has been answered already.
Anyway. As with most people, my shows are organized thusly:
W:\_TV\Show
+--Season 1
| +--Show S01E01 - Pilot.m4v
| +--Show S01E02 - Title2.m4v
\--Season 2
+--Show S02E01 - Title1.m4v
+--Show S02E02 - Title2.m4v
As it stands, my source script works fine, but it shows all the episodes ever - as a result, I a) have to manually nudge the files into the appropriate location, and
cannot set the appropriate COVERURL for the season.
My index SearchBy field looks like this:
[SearchBy]=$replace(%_parent_directory%, ,+)+$replace(%_directory%,Season ,)
In the album area, I would like to do this :
FindLine "<Episode>"
Do
JoinUntil "</Episode>"
FindLine "<SeasonNumber>"
FindInLine "<SeasonNumber>"
If $replace(%_directory%,Season ,)
Only do this if the season matches
endif
While blah
Instead of a direct string, that If statement compares the current position with the return value of $Replace. Is that possible at all?