INTERACT FORUM

Please login or register.

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

Author Topic: Default file naming convention for recorded movies  (Read 8594 times)

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Logged
Yaobing Deng, JRiver Media Center

atc98092

  • Junior Woodchuck
  • **
  • Posts: 74
Re: Default file naming convention for recorded movies
« Reply #51 on: September 07, 2019, 10:27:46 pm »

https://wiki.jriver.com/index.php/Logging

Perfect. I'll enable logging on Tuesday before the next recording of that show.
Logged

atc98092

  • Junior Woodchuck
  • **
  • Posts: 74
Re: Default file naming convention for recorded movies
« Reply #52 on: September 10, 2019, 08:56:40 pm »

So, that problematic episode will be recorded in a few hours, and logging is enabled. However, I discovered another TV show that the same thing happened on, so now there's two TV show titles that it's happened with. Hopefully the log will help identify the issue.

In the meantime, I discovered a less important bug, but wanted to bring it to your attention. If the TV show has a colon ":" in the show name, the colon is removed (good) but a double underscore takes its place. For example, this show

"<Field Name="Series">NCIS: New Orleans</Field>" is being saved as
"<Field Name="Filename">G:\NCIS_ New Orleans - S05E11 - Vindicta.ts</Field>".

Since spaces are included in the remainder of the file name, and there's still a space after the underscore, I see no reason to use the underscore. Any chance that's a setting I can alter myself, or is in the code somewhere?
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Default file naming convention for recorded movies
« Reply #53 on: September 10, 2019, 09:30:40 pm »

Any illegal characters in a name is replaced with the '_' character.  That is the designed behavior.

You may be able get your desired outcome by using the expression function relpace().  However, it is hard to know how many different illegal characters you may find in a name, so a single Replace() function will not be enough.
Logged
Yaobing Deng, JRiver Media Center

atc98092

  • Junior Woodchuck
  • **
  • Posts: 74
Re: Default file naming convention for recorded movies
« Reply #54 on: September 10, 2019, 10:01:04 pm »

I figured it was something like that. There's only two TV shows that I regularly record that have a colon in the name, NCIS: New Orleans and NCIS: Los Angeles. I can live with changing them manually.

The other show that triggered naming like a movie was Bull. Here's the Sidecar data. That show will record again next Monday, so I'll try to log it as well. Unless we find the issue with tonight's show.

Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<MPL Version="2.0" Title="JRSidecar" PathSeparator="\">
<Item>
<Field Name="Filename">G:\Fool Me Twice (Unknown Year).ts</Field>
<Field Name="Episode">6</Field>
<Field Name="Date Tagged">1568095263</Field>
<Field Name="Compression">ts video (video: mpeg2, audio: ac3)</Field>
<Field Name="Bitrate">13290</Field>
<Field Name="Bit Depth">32</Field>
<Field Name="Rerun">1</Field>
<Field Name="Date Recorded">43717.9166666666569654</Field>
<Field Name="Genre">Other</Field>
<Field Name="Season">3</Field>
<Field Name="Program ID">EP02433697.0051</Field>
<Field Name="FPS">29.9700298309326172</Field>
<Field Name="Tool Name">Media Center</Field>
<Field Name="Artist">7-1 KIRO-DT</Field>
<Field Name="Stack Top">-1</Field>
<Field Name="Channels">6</Field>
<Field Name="Description">Bull and the TAC team must help when Marissa's restaurateur husband is charged with involuntary manslaughter after one of his employees dies, allegedly because of negligence; Bull and Benny aim to select jurors who will believe it was an accident.</Field>
<Field Name="Tool Version">25.0.98</Field>
<Field Name="Stack View">0</Field>
<Field Name="Media Sub Type">TV Show</Field>
<Field Name="Playable">1</Field>
<Field Name="Playback Info">(1:2)(12:DTVProgramID)(1:1)(11:AspectRatio)(30:(1:4)(1:0)(1:0)(1:0)(1:1)(1:0))</Field>
<Field Name="TV Channel">29</Field>
<Field Name="Series">Bull</Field>
<Field Name="Recording Rule ID">1012425891</Field>
<Field Name="Name">Fool Me Twice</Field>
<Field Name="Sample Rate">48000</Field>
<Field Name="Duration">3719</Field>
</Item>
</MPL>
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Default file naming convention for recorded movies
« Reply #55 on: September 10, 2019, 11:06:41 pm »

NCIS: New Orleans and NCIS: Los Angeles. I can live with changing them manually.

Why bother changing them at all? It is only the file name. The [Name] tag retains the colon correctly. I just leave the name as MC creates it, because it does no harm at all.
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

atc98092

  • Junior Woodchuck
  • **
  • Posts: 74
Re: Default file naming convention for recorded movies
« Reply #56 on: September 11, 2019, 02:55:18 pm »

Just for consistency from my past recordings. Nothing major.  ;D

Here's the log from last night's recording. I don't really know what I'm looking for. There's 3090 instances of "The Great British Baking Show", so there's probably a better search phrase that you would know to find the recording. The time of recording was 9:30PM Pacific, if that's of any help finding the entry.

Here's the sidecar data for that recording:
Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<MPL Version="2.0" Title="JRSidecar" PathSeparator="\">
<Item>
<Field Name="Filename">G:\Cake (Unknown Year).ts</Field>
<Field Name="Episode">1</Field>
<Field Name="Date Tagged">1568179923</Field>
<Field Name="Compression">ts video (video: mpeg2, audio: ac3)</Field>
<Field Name="Bitrate">2820</Field>
<Field Name="Bit Depth">32</Field>
<Field Name="Rerun">1</Field>
<Field Name="Date Recorded">43718.8958333333284827</Field>
<Field Name="Genre">Other</Field>
<Field Name="Season">6</Field>
<Field Name="Program ID">EP02073247.0066</Field>
<Field Name="FPS">29.9700298309326172</Field>
<Field Name="Tool Name">Media Center</Field>
<Field Name="Artist">9-3 CREATE</Field>
<Field Name="Stack Top">-1</Field>
<Field Name="Channels">2</Field>
<Field Name="Description">Twelve bakers take on their first signature challenge -- to make a Madeira cake; the classic black forest gateau.</Field>
<Field Name="Tool Version">25.0.98</Field>
<Field Name="Stack View">0</Field>
<Field Name="Media Sub Type">TV Show</Field>
<Field Name="Playable">1</Field>
<Field Name="Playback Info">(1:2)(12:DTVProgramID)(1:5)(11:AspectRatio)(30:(1:4)(1:0)(1:0)(1:0)(1:1)(1:0))</Field>
<Field Name="TV Channel">1</Field>
<Field Name="Series">The Great British Baking Show</Field>
<Field Name="Recording Rule ID">589862463</Field>
<Field Name="Name">Cake</Field>
<Field Name="Sample Rate">48000</Field>
<Field Name="Duration">3839</Field>
</Item>
</MPL>
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Default file naming convention for recorded movies
« Reply #57 on: September 11, 2019, 03:35:55 pm »

Unfortunately the log does not help because there was nothing logged regarding filename formatting.

Can you share your tagging expression in the recording rule?
Logged
Yaobing Deng, JRiver Media Center

atc98092

  • Junior Woodchuck
  • **
  • Posts: 74
Re: Default file naming convention for recorded movies
« Reply #58 on: September 11, 2019, 03:43:27 pm »

This is the only naming rule I am running. The series naming is being done automatically as far as I can see.

Code: [Select]
If([Media Sub Type]=movie,If(isempty([Year]), [Filename (name)],[Name] /([Year]/)),[Filename (name)])
Logging is set on Verbosity 1. Would it help if I bumped it to level 2? The baking show is being recorded again tonight with a different episode.
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Default file naming convention for recorded movies
« Reply #59 on: September 11, 2019, 03:52:59 pm »

This is the only naming rule I am running. The series naming is being done automatically as far as I can see.

Code: [Select]
If([Media Sub Type]=movie,If(isempty([Year]), [Filename (name)],[Name] /([Year]/)),[Filename (name)])

That is the expression suggested by RoderickGI.  I just tried it, it does not work as expected.

I tried this expression on my already recorded shows.  All shows that have non-empty Year field get formatted in movie format.  Only TV Shows that have empty Year field remain original format.

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.

Quote
Logging is set on Verbosity 1. Would it help if I bumped it to level 2? The baking show is being recorded again tonight with a different episode.

No that will not help because I did not code anything in this regard, at any verbosity level.
Logged
Yaobing Deng, JRiver Media Center

atc98092

  • Junior Woodchuck
  • **
  • Posts: 74
Re: Default file naming convention for recorded movies
« Reply #60 on: September 11, 2019, 04:03:31 pm »

By the way, I love the puppy picture. We had a similar puppy that just passed away at 14 years old. Still miss the guy terribly.

I understand what you're saying, but shouldn't this rule be ignored for recordings labeled TV Show? I thought that was the purpose of the initial If statement (Media Sub Type).
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Default file naming convention for recorded movies
« Reply #61 on: September 11, 2019, 04:21:57 pm »

That expression tries to do this:

if media subtype is movie, and [year] is not empty, use [name] ([year]), otherwise use [filename (name)]

The first issue I found is, [Media Sub type]=Movie does not seem to work.  isequal([Media Sub Type], Movie) seems to work.  For some reason the expression "[Media Sub type]=Movie" seem to always evaluate to TRUE.

The second issue I found is that [Filename (name)] may not exist at the time we try to format the file name.  The expression given by RoderickGI, after changing "[Media Sub type]=Movie" to "isequal([Media Sub Type], Movie)", does work on recordings already done.  I am not sure it will work on future recordings.  We need to use an more explicit expression such as "[series] S[Season]E[Episode] [name]".  It gets more complicated when you also have to account for whether [Season] and [Episode] are empty or not.
Logged
Yaobing Deng, JRiver Media Center

atc98092

  • Junior Woodchuck
  • **
  • Posts: 74
Re: Default file naming convention for recorded movies
« Reply #62 on: September 11, 2019, 06:05:20 pm »

OK, changed the entire rule to "If(isequal([Media Sub Type], Movie),If(isempty([Year]), [Filename (name)],[Name] /([Year]/)),[Filename (name)])". Will be testing that with another baking show tomorrow evening, along with an actual movie. We'll see if that resolves it.

Thanks!
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Default file naming convention for recorded movies
« Reply #63 on: September 11, 2019, 08:50:05 pm »

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.
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: 10926
  • Dogs of the world unite!
Re: Default file naming convention for recorded movies
« Reply #64 on: September 11, 2019, 09:35:14 pm »

Media Sub Type is set for an EPG program at EPG update time.  The EPG program object is passed to the "format filename name" function.  If we have custom expression for [filename (name)], we evaluate it first, without formatting the default filename.  Upon more thinking (without direct verification in the debugger), I think since we use the EPG program object, its [filename (name)] tag does exist, but is not the default file name for a recording.  Instead the program entry's filename is something like "27587397 2019-9-8, 12:30:0.tvgd".  So the [filename (name)] would be "27587397 2019-9-8, 12:30:0" which definitely is not the desired result.  I will use that expression to run a recording to verify.
Logged
Yaobing Deng, JRiver Media Center

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Default file naming convention for recorded movies
« Reply #65 on: September 11, 2019, 09:46:54 pm »

Yup, I just tried making a fresh recording of a TV news program, using the expression "If(isequal([Media Sub Type],Movie),If(isempty([Year]),[Filename (name)],[Name] /([Year]/)),[Filename (name)])" for [filename (name)].  I ended up getting a filename "1998261 2019-9-11, 21_0_0.tvgd.jtv" for my recording.
Logged
Yaobing Deng, JRiver Media Center

atc98092

  • Junior Woodchuck
  • **
  • Posts: 74
Re: Default file naming convention for recorded movies
« Reply #66 on: September 11, 2019, 10:00:17 pm »

Rod, your advice was great, and it's made all my movies come out with perfect file names.  ;D Just this one little bugger to figure out.

Yaobing, should I change my rule back, or is it still going to work correctly with actual movies? If the original script is as close as we can get, I'll live with it. It's correct more than 90% of the time, and I can be a big boy and handle the remaining few. The Sidecar file has everything I need to correct them. :)
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Default file naming convention for recorded movies
« Reply #67 on: September 11, 2019, 10:02:39 pm »

There is a simple solution to this problem:

Instead of this expression: If(isequal([Media Sub Type],Movie),If(isempty([Year]),[Filename (name)],[Name] /([Year]/)),[Filename (name)])" for [filename (name)], which says if the show is not a movie, or if the show does not have the [year] value, use existing [filename (name)], otherwise use [name] ([year]), we should use the following:

Code: [Select]
If(isequal([Media Sub Type],Movie),If(isempty([Year]),,[Name] /([Year]/)),)which means if we are dealing with non-movies, or without [year], we should just output an empty string.  Getting an empty string when trying to evaluate the expression would force MC to format a default filename.  With this expression, I get the correct filename: "WGN News at Nine 2019-09-11.jtv"
Logged
Yaobing Deng, JRiver Media Center

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: Default file naming convention for recorded movies
« Reply #68 on: September 11, 2019, 10:05:06 pm »

Rod, your advice was great, and it's made all my movies come out with perfect file names.  ;D Just this one little bugger to figure out.

Yes! 

Quote
Yaobing, should I change my rule back, or is it still going to work correctly with actual movies? If the original script is as close as we can get, I'll live with it. It's correct more than 90% of the time, and I can be a big boy and handle the remaining few. The Sidecar file has everything I need to correct them. :)

It will still work correctly for movies that do have year tag.  It will not work for non-movies.

You should change it according to my last post.
Logged
Yaobing Deng, JRiver Media Center

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Default file naming convention for recorded movies
« Reply #69 on: September 11, 2019, 11:33:20 pm »

Thanks guys,

Yaobing, after writing the above post I was wondering if just leaving the [Filename (name)] field blank would result in the default naming kicking in. I nearly came back and suggested exactly the expression you have shared.

It looks like you have shown that works. No need for me to test a recording then, which I was planning to do later.
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: 10926
  • Dogs of the world unite!
Re: Default file naming convention for recorded movies
« Reply #70 on: September 12, 2019, 08:03:05 am »

Thanks guys,

Yaobing, after writing the above post I was wondering if just leaving the [Filename (name)] field blank would result in the default naming kicking in. I nearly came back and suggested exactly the expression you have shared.

It looks like you have shown that works. No need for me to test a recording then, which I was planning to do later.

Your hesitation was well founded.  I know my last suggestion works because I know the actual implementation, and did a quick test.  This also depends on whether a user wants to use the default format for non-movie shows.

However it is not a good thing for an expression's viability to depend on internal implementation.  If someone later decides to re-implement the default filename formatting routine, the expression could stop working. 

So treat my "output empty string" suggestion as a quick fix, not as an ideal solution.

A completely fool-proof expression should not depend on internal implementation.  To that goal, we need a couple of more nested If() expression, so that we can take into consideration of whether [Season] is empty or not.  Something like:

Code: [Select]
If(isempty([Season]), [Series] - [Name] FormatDate([Date Recorded,0], yyyy-MM-dd), [Series] - S[Season]E[Episode] - [Name])

where I assume [Series] is not empty.  For the expression to work for single-episode TV shows, one would need another if() clause, etc. etc.
Logged
Yaobing Deng, JRiver Media Center

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Default file naming convention for recorded movies
« Reply #71 on: September 12, 2019, 04:53:21 pm »

Good point.

Trying to cover all the options means almost rewriting the code in expressions. Which is why I don't rename recorded TV files, and just move them. The default naming works well if the EPG has data, and is good enough when the EPG is lacking. If I want to rename files later to keep them a while I just use the RM&CF function.
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

atc98092

  • Junior Woodchuck
  • **
  • Posts: 74
Re: Default file naming convention for recorded movies
« Reply #72 on: September 26, 2019, 10:40:01 pm »

I thought I'd let you know of a solution I came up with. There has only been the two TV shows that for some reason was triggering the movie naming script. They also both happened to be subscription recording, and I discovered in the subscription settings window it listed to run the rule. I just deleted the naming rule from the subscription and now those two TV shows are being named accurately with the default naming function. All is well!  ;D
Logged
Pages: 1 [2]   Go Up