Hey, I tested that expression!
But I didn't take into account this issue;
There is another issue with this expression. The expression is used in the program before the recording starts, and before we attempt to format a default format. Therefore I think at that time there is no [filename (name)] value to be used. We need to be more explicit.
Well, I think I tested it, but only on already recorded shows. I see now that it does rename TV Shows as Movies, if I use the full expression in an Expression Column. Could something have changed in the way such an expression is evaluated?
If([Media Sub Type]=movie,1,0) does always evaluate as "1", which means the [Media Sub Type] is movie, which is obviously not the case for the shows I am testing with. It looks like even though the "[Media Sub Type]=movie" is enclosed in an IF statement, it is setting [Media Sub Type] to movie, rather than testing it.
Maybe I just wrote the expression based on other programming experience and didn't test it. ? Sorry.
The above begs the questions though; when does the [Media Sub Type] get set to Movie?
If the EPG includes the Movie tag in one of the forms MC uses, does that get set before the [Filename (name)] field?
If the EPG does not include any tag to indicate the program is a movie, and the length is over an hour, does the [Media Sub Type] get set to "Movie" before the [Filename (name)] field is set?
If the EPG does not include any tag to indicate the program is a movie, and the length is under an hour, does the [Media Sub Type] get set to "TV Show" before the [Filename (name)] field is set?
If the [Media Sub Type] isn't set before this expression runs, then the test will always fail. But I think fields are set from the EPG data before this expression would run. I'm not sure the "over one hour means a movie" logic would run before the expression though.
"If(isequal([Media Sub Type], Movie),If(isempty([Year]), [Filename (name)],[Name] /([Year]/)),[Filename (name)])"
That still may not work, if Yaobing is correct and [Filename (name)] has not been set at the time the expression is run. I was assuming that the code to set the default format of filename had already run when "Tag on import" expressions are run. But [Filename (name)] is a special case as it needs to be set before a recording is started, while all other tagging is done later.
It should still work if the sequence of tasks is;
Set program fields as per EPG data.
Set the default [Filename (name)] field format.
Run any "Tag on import" expression that includes [Filename (name)], or if the [Filename] field is set by an expression, the [Filename (name)] portion of a [Filename] field used in a "Tag on import" expression.
I guess leave it and see what happens.
PS: I usually only set the [Filename (path)] field to move files after a recording, so haven't really used what you are trying to do. I should have been more careful with my advice.