INTERACT FORUM

Please login or register.

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

Author Topic: Renumber episode field?  (Read 2570 times)

cron0sRXR8

  • Galactic Citizen
  • ****
  • Posts: 296
Renumber episode field?
« 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!
Logged

adamt

  • Galactic Citizen
  • ****
  • Posts: 447
Re: Renumber episode field?
« Reply #1 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. 
Logged
Adam Thompson, JRiver

cron0sRXR8

  • Galactic Citizen
  • ****
  • Posts: 296
Re: Renumber episode field?
« Reply #2 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!
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: Renumber episode field?
« Reply #3 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, but I always remember this one off the top of my head, without having to consult the wiki.
 
  • I add the whole series to the "Playing Now" view, as this is a list that can be reordered by dragging the items.
  • I drag the items into the order that I want them to be in.
  • I then select all the files, and use the Tools → Library Tools → Fill Track Numbers From List Order command.
  • Now use the Tools → Library Tools → Move/Copy Fields tool, to Move Track # into the Episode field.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Renumber episode field?
« Reply #4 on: June 24, 2014, 12:16:08 pm »

@cron0sRXR8 - where is the sequence number or ordering coming from?
Logged
The opinions I express represent my own folly.

cron0sRXR8

  • Galactic Citizen
  • ****
  • Posts: 296
Re: Renumber episode field?
« Reply #5 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
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Renumber episode field?
« Reply #6 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.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

cron0sRXR8

  • Galactic Citizen
  • ****
  • Posts: 296
Re: Renumber episode field?
« Reply #7 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!!
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Renumber episode field?
« Reply #8 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() function.  Episode is a string value, so you can add 0 padding to the above expression if you want.
Logged
The opinions I express represent my own folly.

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Renumber episode field?
« Reply #9 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).
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10786
Re: Renumber episode field?
« Reply #10 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.
Logged
~ nevcairiel
~ Author of LAV Filters

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Renumber episode field?
« Reply #11 on: June 24, 2014, 12:56:06 pm »

So many good solutions.
Logged
The opinions I express represent my own folly.

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Renumber episode field?
« Reply #12 on: June 24, 2014, 01:31:13 pm »

Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

cron0sRXR8

  • Galactic Citizen
  • ****
  • Posts: 296
Re: Renumber episode field?
« Reply #13 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!
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Renumber episode field?
« Reply #14 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).
Logged
The opinions I express represent my own folly.

cron0sRXR8

  • Galactic Citizen
  • ****
  • Posts: 296
Re: Renumber episode field?
« Reply #15 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
Logged
Pages: [1]   Go Up