INTERACT FORUM

Please login or register.

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

Author Topic: Recorded TV Filename  (Read 2474 times)

muzicman0

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1239
Recorded TV Filename
« on: October 08, 2014, 12:50:56 pm »

Now that the Season and Episode is being used from XMLTV, I have changed my subscription rules so that the filename (name) is tagged as [Series] - S[Season]E[Episode] - [Name]

which renders something like this:

Castle - S7E2 - Montreal

Which is fine...but (and WARNING, I am being VERY nit-picky here!)

If I have the same rule in the rename files option, the filename ends up as:

Castle - S07E02 - Montreal

Which I prefer...is there a way to make the subscription option pad the numbers with a 0 if it is below 10?
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Recorded TV Filename
« Reply #1 on: October 08, 2014, 05:30:14 pm »

You just need to add a test to see if the Season number is less than 10, and if so, append a "0" to the front. I don't know the syntax off the top of my head, but the logic is something like;

IF( [season] < 10 then use "0+[season]", else use [season])

Or actually you may need to test if the length of the number is one or two characters, and add a leading "0" if it is one, because sometimes you may get a two digit number that is less than 10 (i.e. 07) and you don't want to add another zero then (007)!

Look up the MC rules Expression Language syntax here: http://wiki.jriver.com/index.php/Media_Center_expression_language

You may want to test if the program is a series before you apply these rules. You don't want strange stuff happening when naming movies. So you will need nested IF statements.

Plus you will also need to test for the season and episode numbers being empty, and decide how you want to handle that. Normally if a program is an episode of a series, and neither the season or episode is know, a "--" is used instead of a number, as in;

Castle - S--E-- - Montreal

There are a couple of experts on the forum when it comes to the Expression Language. Hopefully they will pop in an help.  :)
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

muzicman0

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1239
Re: Recorded TV Filename
« Reply #2 on: October 08, 2014, 06:19:00 pm »

I'm not horrible with expression language, but I usually work off of an example...so I will just have to look it up.  The tag is applied on subscriptions though, so I already know that it is a series, because I only put the expression on certain subscriptions.
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Recorded TV Filename
« Reply #3 on: October 08, 2014, 08:22:07 pm »

Well that makes it a lot easier.  ;D

Please share the result you come up with.
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

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10862
  • Dogs of the world unite!
Re: Recorded TV Filename
« Reply #4 on: October 09, 2014, 11:57:23 am »

I have incorporated the idea into MC's default behavior.  You can still override it using your own tag expressions.

On start recording a show, the file name will be formatted as follows:

Use user's "Filename (name)" tag expression
or [Series] - S[Season]E[Episode] - [Name]
or [Series] - [Name] yyyy-MM-dd
or [Name] - S[Season]E[Episode]
or [Name] yyyy-MM-dd  (this one being the previous behavior)
depending on availability of data in program entries.

Single-digit episode and season numbers will be padded.
Logged
Yaobing Deng, JRiver Media Center

muzicman0

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1239
Re: Recorded TV Filename
« Reply #5 on: October 09, 2014, 12:17:18 pm »

I also just noticed my rule on subscriptions isn't putting the .ts extension in the filenames...oops!  I am going in and editing my custom tags now to include .ts at the end.
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10862
  • Dogs of the world unite!
Re: Recorded TV Filename
« Reply #6 on: October 09, 2014, 12:30:08 pm »

I also just noticed my rule on subscriptions isn't putting the .ts extension in the filenames...oops!  I am going in and editing my custom tags now to include .ts at the end.

Yes, strictly speaking, you need the extension since you are renaming a file.  When my change is released, MC will add proper extension when recording starts, so it is no longer that critical.
Logged
Yaobing Deng, JRiver Media Center

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Recorded TV Filename
« Reply #7 on: October 09, 2014, 06:54:25 pm »

I have incorporated the idea into MC's default behavior. 

Nice job Yaobing. It is the little things like this that make JRiver and MC a pleasure to use.
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
Pages: [1]   Go Up