ifelse (isequal([Media Sub type], TV Show), [filename (name)]=[Series] - S[Season]E[Episode] - [Name]), isequal([MediaSubtype], Movie) [filename (name)]=[Name] - /([year]/)
First, my apologies I put a dash in the movie naming expression example above. That isn't usual. My example output was correct though; "Godzilla (2009).ts".
Next, watch your syntax carefully. You have a space after the "IfElse". You misspelt "Media Sub Type" in the second instance by not leaving spaces. You missed a closing bracket ")" on the whole expression. Count, and match, opening and closing brackets, taking into account any escaped brackets, such as in the movie naming.
Next, you are adding this expression into the "Apply these tags (optional)" rule, so you are writing an expression to evaluate a field. In this case [filename (name)]. So you don't need to include it in the expression as you have. It is already the field to be set, as per the "Apply these tags (optional)" dialogue. I probably should write my example expressions using the format other than "[filename (name)]=[Series] - S[Season]E[Episode] - [Name]", because the equals is implied by selecting the field in the top box. I'll have to improve that in my posting.
Maybe:
Field to be updated: Filename (name)
Expression Value: [Series] - S[Season]E[Episode] - [Name]
So the actual expression you wantto replace the "[Season][Episode]" expression in the image above is:
ifelse(isequal([Media Sub type], TV Show), [Series] - S[Season]E[Episode] - [Name], isequal([Media Sub Type], Movie), [Name] /([year]/))
That expression is easy to test, given that the output of the expression will be written to a field. Just create an Expression column in a View of TV shows and movies (perhaps a copy of the Video > Files View), add columns for all the metadata the expression needs ([Media Sub type], [Series], [Season], [Episode], [Name] and [year]) so you can see any missing metadata and observe the result of the expression.
As mentioned above, if your EPG data doesn't have the appropriate values for TV Shows; [Series], [Season], [Episode], and [Name], and for Movies; [Name] and [year], then you will get gaps in the naming which may cause filename clashes.
i.e.
A movie file name of "Godzilla ().ts" if the Year tag is empty.
A TV show name of "Expedition Unknown - SE - Temple of Doom.ts" if the Season and Episode tags are empty. Or worse, " - SE - Temple of Doom.ts" if the Series, Season and Episode tags are empty. Note that the [Name] field in MC is always populated, so if there is no Season, Episode number and Episode name in your EPG, the Series name will be put in the [Name] field. Then you would get a file name of " - SE - Expedition Unknown.ts"