INTERACT FORUM

More => Old Versions => JRiver Media Center 19 for Windows => Topic started by: cron0sRXR8 on June 24, 2014, 11:53:37 am

Title: Renumber episode field?
Post by: cron0sRXR8 on June 24, 2014, 11:53:37 am
Hi,

How I can rename the episode field?

I would like rename the episode field of some series. I want get this:

01, 02, 03, 04...

I don't want rename the filename. I only want rename (re-number) the espisode field of some video files.

How I can do it?

Thank you!
Title: Re: Renumber episode field?
Post by: adamt on June 24, 2014, 12:01:24 pm
If I understand your question correctly, all you have to do is change the tags.  Select the file you'd like to change and click "Tag" in the lower left.  From there, change the "Episode" field. 
Title: Re: Renumber episode field?
Post by: cron0sRXR8 on June 24, 2014, 12:04:56 pm
Yes I only want change the "episode" tag of some video files (of one serie).

But I have many episodes. I don't want change the episode one by one manually in the tag table. I would like do it automatically. Is it possible?

Like the filename:

filename Math(0 + customdata(#))

filename 1
filename 2
filename 3
...

I want do it this but for the episode tag:

01
02
03
...

how can I do it??  ? ? ?

thank you!
Title: Re: Renumber episode field?
Post by: 6233638 on June 24, 2014, 12:11:52 pm
Here is a trick that I use for this - I know it can be done via Expressions (http://wiki.jriver.com/index.php/Expression_Language), but I always remember this one off the top of my head, without having to consult the wiki.
 
Title: Re: Renumber episode field?
Post by: MrC on June 24, 2014, 12:16:08 pm
@cron0sRXR8 - where is the sequence number or ordering coming from?
Title: Re: Renumber episode field?
Post by: cron0sRXR8 on June 24, 2014, 12:24:52 pm
@cron0sRXR8 - where is the sequence number or ordering coming from?

I have this filenames:

name 1.avi
name 2.avi
name 3.avi
name 4.avi
...
name n.avi

I only want assign episode tag using this sequence:

name 1.avi <== episode tag = 01
name 2.avi <== episode tag = 02
name 3.avi <== episode tag = 03
name 4.avi <== episode tag = 04
...
name n.avi <== episode tag = 0n

sorry for my english!  :P :P :P :-X
Title: Re: Renumber episode field?
Post by: glynor on June 24, 2014, 12:24:56 pm
You don't need to do that Track # trick.

Select the files, open the Tag action window, then type this into the [Episode] field (or whichever tag you want to number):
=Counter()

If you want to start with a different number than 1, you just put the starting digit in the parens in the Counter() command.

So, you just have to get a listing with them in the right order (which can be, if needed, a manual playlist wher you drag them up and down to the right order), and then apply it all at once.  If the file name sorts to the right order, just sort your view by the [Filename] tag.

The Fill Track # from List Order command is just a shortcut for typing =Counter() in the track number field.
Title: Re: Renumber episode field?
Post by: cron0sRXR8 on June 24, 2014, 12:30:02 pm
You don't need to do that Track # trick.

Select the files, open the Tag action window, then type this into the [Episode] field (or whichever tag you want to number):
=Counter()

If you want to start with a different number than 1, you just put the starting digit in the parens in the Counter() command.

So, you just have to get a listing with them in the right order (which can be, if needed, a manual playlist wher you drag them up and down to the right order), and then apply it all at once.  If the file name sorts to the right order, just sort your view by the [Filename] tag.

The Fill Track # from List Order command is just a shortcut for typing =Counter() in the track number field.

thank you for the solution!

only one more thing.

If I do "=Counter()" I only get this sequence: 1, 2, 3...
But I want get this: 01, 02, 03...

How to do it??
Thank you!!
Title: Re: Renumber episode field?
Post by: MrC on June 24, 2014, 12:33:28 pm
The counter() solution is good, but will only work on a single series, since it won't reset per series.

You can use:

   Regex([filename (name)], /#(\d+)\.(.*)$#/, 1)

if you want to grab the digits at the end of your Filename.  Select all the files you want, and enter this into the Episode field (either in the Tag Action Window or in one of the selected Episode cells by pressing F2 after selected the files):

  =Regex([filename (name)], /#(\d+)\.(.*)$#/, 1)


Reagarding the 0 padding, integer fields in MC are not 0 padded.  If you want to see 0 padded results, you have to use an expression that includes the PadNumber() (http://wiki.jriver.com/index.php/Media_Center_expression_language#PadNumber) function.  Episode is a string value, so you can add 0 padding to the above expression if you want.
Title: Re: Renumber episode field?
Post by: glynor on June 24, 2014, 12:41:59 pm
If I do "=Counter()" I only get this sequence: 1, 2, 3...
But I want get this: 01, 02, 03...

This is generally not needed.  If MC ever writes out to filenames, it pads fields like [Episode] to two digits by default.  But, yes, if you want to, you can use =PadNumber(Counter(), 2) as suggested by MrC above.

If it is me, I'd avoid using the RegEx method MrC provided above, because it won't allow you to easily sanity-check your filenames, which could also have bad data.  When I do this, I usually have a view sorted by [Filename].  Then, I select and tag all of the files from a given [Series] at once.  Then, filter the view (with a Category Pane up top) to show only files from that Series, and then sub-select the seasons, and tag them.

Then, lastly, I quickly flip through the individual seasons and do:

1. Control-A
2. Type =Counter() in the [Episode] field.
3. Then, I quickly check and make sure the last Filename number matches the Episode field I just "counted".

When you do step #3, if the filename is "name 24.avi", but the Counter() only counted to episode 22, then you know you have two missing files in there.  Or, if it counts to 26, then you might have some mis-labeled episodes that snuck in, or duplicates or something.

That kind of process doesn't take long at all, and it has saved me a TON of times when an errant duplicate, or mis-numbered file slipped in there.  If you are absolutely, positively, certain that the [Filename] for each file is 100% correct, then the RegEdit trick might be a way to go.  I'm skeptical how often you can be so certain, though.  99.98% isn't good enough, unfortunately, since issues can ripple-effect (and once you look up info in an online database, and then maybe rename the files themselves, there's no way "back" without playing and manually identifying any mis-labeled files).
Title: Re: Renumber episode field?
Post by: Hendrik on June 24, 2014, 12:54:18 pm
If the filename contains the number (and the filename has a predictable pattern), I would always prefer "Fill Properties From Filename" instead of mucking about with the RegEx, it gives you immediate feedback which fields are being set to what without first overwriting them, and is a bit more intuitive, even if not as powerful.
Title: Re: Renumber episode field?
Post by: MrC on June 24, 2014, 12:56:06 pm
So many good solutions.
Title: Re: Renumber episode field?
Post by: glynor on June 24, 2014, 01:31:13 pm
So many good solutions.

+1
Title: Re: Renumber episode field?
Post by: cron0sRXR8 on June 24, 2014, 02:49:35 pm
Wow! thanks everyone for all solutions!

My english is very basic but I think that I can understand.

I try it with "=PadNumber(Counter(),2)" and works very fine.

This expression: "Regex([filename (name)], /#(\d+)\.(.*)$#/, 1)" is for do it the same but is usefull if I select many series at the same time. This code do reset at 1 in the first episode for each serie. is it so?

Thank you!
Title: Re: Renumber episode field?
Post by: MrC on June 24, 2014, 02:52:35 pm
The regex() solution pulls the number from the last portion of the filename, so there is no resetting involved (it takes what is there).
Title: Re: Renumber episode field?
Post by: cron0sRXR8 on June 24, 2014, 02:58:32 pm
The regex() solution pulls the number from the last portion of the filename, so there is no resetting involved (it takes what is there).


aaah ok! the expression take the last number of the filename. So is not possible get error in the episode tag if any file is lost (incomplete serie)

Now I understand, thank you for your patience  :D ;D