INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Is there a simple way to change the naming scheme for recorded TV  (Read 2540 times)

jachin99

  • Citizen of the Universe
  • *****
  • Posts: 559

I would like to change how JRiver names each recording.  Instead of the broadcast date at the end of the file name, I would prefer something like Seinfeld S1E2, or similar for series, and Godzilla 2009 or similar for movies.  I need the file names themselves to change so that other programs can easily recognize the name, and lookup the metadata.  For each recording I also cut the commercials using VideoRedo, and move the files so all of my original sidecars are destroyed.  Is there a simple way to configure something like this in JRiver?  Thanks. 
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10949
  • Dogs of the world unite!
Re: Is there a simple way to change the naming scheme for recorded TV
« Reply #1 on: August 21, 2019, 02:59:51 pm »

If guide data contain series and episode numbers, they will be used in the default filename.

You can use "Apply these tags (optional)" rule when setting up a recording.  In particular, you can add a tag for [Filename (name)] to change the way filename is formatted.  You can also add tag for [Filename (path)] to change the folder of recordings.  If you need to do both, then you should just do one for [Filename].

There is a recent thread discussing similar topic:

https://yabb.jriver.com/interact/index.php/topic,121471.0.html

The "Apply these tags (optional)" rule is on Standard view recording wizard.  You can edit your individual recording rules in Standard view.  If you prefer setting up recordings in Theater view, you should run TV options in Standard view once and set "Recording default - Tags to apply when recording is done".  You can use expression language to make it general and applicable for all recordings.  This way all your future recording rules will use this option automatically (but you may still have to edit your existing recording rules in the Standard view).
Logged
Yaobing Deng, JRiver Media Center

jachin99

  • Citizen of the Universe
  • *****
  • Posts: 559
Re: Is there a simple way to change the naming scheme for recorded TV
« Reply #2 on: August 21, 2019, 06:07:06 pm »

There is an option in my guide data to prepend series names with season and episode numbers.  Would that be a good idea or would it throw something off.
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Is there a simple way to change the naming scheme for recorded TV
« Reply #3 on: August 21, 2019, 06:39:07 pm »

It would break things, like "Get Movie & TV Info", plus lots of MC Series management, such as the Series > Season > Episode Views. Lots. Every recording would belong to its own Series if you did that.

Don't do that.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

jachin99

  • Citizen of the Universe
  • *****
  • Posts: 559
Re: Is there a simple way to change the naming scheme for recorded TV
« Reply #4 on: August 21, 2019, 08:21:36 pm »

Alright I gave this a quick try, and attached a screenshot.  I applied the filename (name) tag a long with season and episode numbers.  I'll test this out but does this look like it would result in a file named for instance Expedition Unknown S1E2 or similar?  Will MC stop putting the recording date at the end with these rules?  Thanks for the suggestions. 
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Is there a simple way to change the naming scheme for recorded TV
« Reply #5 on: August 21, 2019, 09:42:26 pm »

That won't work well. You'll get files named like "12.ts".

Where you have [Season][Episode], put;

[Series] - S[Season]E[Episode] - [Name]

That will work for TV Series, giving something like;

Expedition Unknown - S01E02 - Temple of Doom.ts

If your EPG data is good. The thing is, if your EPG data contains the Series name, Season and Episode numbers, and Episode name, that is the way MC names the recordings by default. You don't need to do anything.


If your EPG doesn't include some data, such as Series, Season and Episode, that will be replaced with something like;
Unknown Series - SUnknown SeasonEUnkown Episode - Expedition Unknown
In fact you will get that even if the Series is known, but the Episode title isn't, as in that case MC puts the Series name from the EPG into the [Name] field, as that field must always be filled.

That can be a problem, as you could get duplicate file names. Which is why MC names the shows with the date recorded on the end when it doesn't know some of the above metadata. Of course, MC won't allow duplicate recording names. It will add a suffix of (1), (2), etc. when the filename already exists.


But the above won't work well for recorded movies of course. Movies are best named;

[Name] - ([Year])

Which will give, for example;

Godzilla (2009).ts

So if you are just doing this tagging in individual recording rules, pick the correct one.

But if you are adding this as a default in Options, you need to use a more complex expression to take into account recording both TV Series, and Movies, and also, TV Shows that aren't part of a Series. You could use an IfElse command, or maybe two nested IfElse commands.

Give it a try if you want to set up defaults in Options as Yaobing mentioned. https://wiki.jriver.com/index.php/Conditional_Functions
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Is there a simple way to change the naming scheme for recorded TV
« Reply #6 on: August 21, 2019, 10:12:42 pm »

I should have mentioned. If I know what the Series is, because I am using the Series name to select what to record, but I'm not sure if both the Series name and Episode name will be in the EPG data, then I explicitly set the [Series] field before setting the [filename (name)] field.

In the example above, I would set;

[Series]=Expedition Unknown
[filename (name)]=[Series] - S[Season]E[Episode] - [Name]

in that sequence in the dialogue box.


Or I might just skip a step and put;
[filename (name)]=Expedition Unknown - S[Season]E[Episode] - [Name]

But usually I want the [Series] field set, so use the first method.


On some of my recordings I just set, for example;
[Series]=Expedition Unknown

Then MC always knows the Series name and uses that in its default naming. So I get;
Expedition Unknown 2019-08-21.ts

Which is better than duplicate names, names with lots of "Unknown" included in them, or names with only the suffix different.


It all comes down to the quality and completeness of your EPG data, which comes from a third-party source, not JRiver, in every case.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

jachin99

  • Citizen of the Universe
  • *****
  • Posts: 559
Re: Is there a simple way to change the naming scheme for recorded TV
« Reply #7 on: August 22, 2019, 07:44:24 am »

For whatever reason the tagging scheme above actually worked.  I'm not sure if MC somehow figured out on its own what I meant or what but I ended up with a file named Expedition Unknown S7E3 - Temple of Doom for example.  I have been using my guide provider for a few years now, and it includes season, and episode information.  Instead of prepending filenames, there is actually an option to prepend the description field with the season and episode numbers so hopefully I can use that as a quick sanity check.  As you mentioned, this won't work out well for movies though so I guess its a great time to figure out conditional logic, and the expression language.  Thanks for your help, and I'll probably be back soon with a few test expressions. 
Logged

jachin99

  • Citizen of the Universe
  • *****
  • Posts: 559
Re: Is there a simple way to change the naming scheme for recorded TV
« Reply #8 on: October 08, 2019, 09:30:40 am »

The tagging above I referenced in my last post works UNTIL I try applying some conditional logic.  I haven't tried this in MC just yet but I came up with this little script a while back, and I was curious to see if its correct before I try it. 

I want TV shows to be named SHOWNAME S1E1 - PILOT

I want movies to be named MOVIENAME (2019)

This is the script I have so far that will hopefully achieve that

if(isequal([Media Sub type], TV Show), [filename (name)]=[Series] - S[Season]E[Episode] - [Name])
else if (isequal([MediaSubtype], Movie) [filename (name)]=[Name] - [(year)] - [Name]
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Is there a simple way to change the naming scheme for recorded TV
« Reply #9 on: October 08, 2019, 04:14:11 pm »

I don't think that syntax (If, else if) actually works in MC. It is just used to explain the IfElse functionality in the Wiki. Use the IfElse command.

Also escape the () around the year in your movie name.
Also you have the brackets wrong around the "year" value. [Name] - /([year]/)
Also what is the additional [Name] after the movie naming for? You don't want to default the filename to [Name], as you will get duplicates. In fact, if the program doesn't match "TV SHow" or "Movie", just let MC use its deafult naming as that will make the filename unique. While it may not be good practice, if your expression to set the [filename (name)] field doesn't result in any contents, MC will use it normal naming.
Also the expression should be all one line when you enter it into MC.

Have another try and see how you go.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

jachin99

  • Citizen of the Universe
  • *****
  • Posts: 559
Re: Is there a simple way to change the naming scheme for recorded TV
« Reply #10 on: October 08, 2019, 06:42:12 pm »

I know it still isn't quite right but will this expression at least attempt to perform some kind of conditional logic?  I took the instructions in the wiki to mean that I place the ifelse at the beginning of the expression, and with the correct placement of commas, MC will find the correct naming sequence according to the media subtype.  I still have to some reading to do.   It will all be one line when I'm done if that doesn't show right on the forums. 

ifelse (isequal([Media Sub type], TV Show), [filename (name)]=[Series] - S[Season]E[Episode] - [Name]), isequal([MediaSubtype], Movie) [filename (name)]=[Name] - /([year]/)
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Is there a simple way to change the naming scheme for recorded TV
« Reply #11 on: October 08, 2019, 09:20:26 pm »

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.  ;D

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"
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

jachin99

  • Citizen of the Universe
  • *****
  • Posts: 559
Re: Is there a simple way to change the naming scheme for recorded TV
« Reply #12 on: October 10, 2019, 08:45:53 am »

Roderick, I owe you again.  I changed my expression, and after some experimentation it seems to be working fine.  I'll still have to look for some other projects in order to really get good at the expression language but my recordings are named exactly how I like them.  Thanks!!
Logged
Pages: [1]   Go Up