how to rename only parts of files

All your suggestions, requests and ideas for future development
Post Reply
sanjonny
Posts: 70
Joined: 08 Feb 2012, 02:55

how to rename only parts of files

Post by sanjonny »

one of the best things I like about filebot is the ability to take a list of shows and find out their resolution via the resolution tag. I have two suggestions related to this that I would like to be able to do.
1. Be able to have multiple formats that are easily selectable in say a click list for times when I want to use alternate formatting for a show or movie. In some folders for different reasons, I have filebot put the moviename, year and resolution. On the high def files, I don't do that, so I just have the moviename and the year. What I would like is to have a default of the moviename and year and be able to easily change that on the fly via clicking say one extra step in the right click diaglog or whatever, so I don't have to open the settings and type in the format change and then save it, rename the files and then convert it back the next time I don't want the resolution. This would help for tv files also, if we could have like 3 or four different formats to easily select from, either custom or not, it would sure make management of lots of new files easier.
2. The second problem/feature might just be something I don't understand. I have a recording from the tivo which includes the airdate, but when the matching occurs, if the airdate is attached, most of the time, the matching will not work. I primarily use filebot to find the series and episode numbers as that is not generated by tivo. So I have a file like Modern Family - Fizbo (22-1/12/2012) as the input. Filebot will sometimes work with that file but often not, so I have to use a renamer to strip off the airdate info. I then feed Modern Family - Fizbo and it comes out with the correct Modern Family S01E04 (don't know if that is correct, just using an example) is there some mask or something I can use to not have to rename the files first? Lots of times, if I feed it multiple episodes, it overlooks the airdate anyway, but not always, which is a problem.
3. Going back to my resolution issue, What if I just want to peg on the resolution or strip it off? Say I already have a bunch of files properly named and I don't want them looked up again, because their might be issues I manually corrected or whatever, but I only want to add the resolution to them? Is there a way to do this using the gui? I am not great at command line stuff, but would love to add that in or strip it off as needed.

Don't get me wrong, I love the program and would like to do more with it. Thanks for your help and I am glad you asked for suggestions, as you can see, I have several....
User avatar
rednoah
The Source
Posts: 22987
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: how to rename only parts of files

Post by rednoah »

1. You know about the format history right? Just press DOWN and you'll get a list of previously used formats. What you wanna do is not select the right format, but make your format more smart. Like {if sdhd == 'HD' then resolution} would only add resolution for HD. That way you can do pretty much anything. You have complete access to all movie/episode info, mediainfo, file path/data. Though does require at least minimal scripting. But a few if-else statements probably get you a long way to what you want. People here in the forums can probably help with that.

2. (22-1/12/2012) is probably not recognized as date. 22:00?? I can add that format but i assume this is recording time, which may not be the original airdate. Send me the filenames and i'll have a look at tweaking the matching to make it work.

Anyway, if the title matches (perfect match with db episode name) it should work, otherwise fuzzy logic might get it right. Btw FileBot works better with more data, more episodes all at once = better overall matching.

3. Use {fn} {resolution} format. Just needs some dummy episode data for the format engine to do it's work, but the actually episode data isn't used anyway so you can just add drop all your files on the left side, and then drag the episode objects from some random long running show over from Episodes panel. That's how you can trick the GUI into doing your bidding. ;)

Scripting would be something like:

Code: Select all

args.getFiles{ it.isVideo() }.each {
	println it.moveTo(new File(getMediaInfo(file:it, format:"{fn} [{resolution}].{ext}")))
}
(requires -trust-script for filesystem write access)
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22987
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: how to rename only parts of files

Post by rednoah »

Rename Set 1:
Modern Family - Fizbo (22-1.12.2012)

This is what happens:
1. Modern Family - 1x12 - Not in My House [2010-01-13] because the 1.12 part matches SxE
2. No match via airdate because no episode originally aired on 1.12.2012
3. Modern Family - 1x09 - Fizbo [2009-11-25] because there's a title match in the filename

SxE is in most cases the better match. But not in this one. If the episode was recorded on 2009-11-25 (title+airdate match) it would work of course.

Rename Set 2:
Modern Family - Fizbo (22-1.12.2012)
Modern Family - Not in My House (22-1.12.2012)

Works correctly because there is more data to work out the best matching option.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22987
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: how to rename only parts of files

Post by rednoah »

I can make a special case for '/' i.e. not accept 1/12 as 1x12 but it's kinda wierd you have path separator / as part of the filename...
:idea: Please read the FAQ and How to Request Help.
sanjonny
Posts: 70
Joined: 08 Feb 2012, 02:55

Re: how to rename only parts of files

Post by sanjonny »

Yeah, I screwed that up because I was not at the computer I usually work on, the actual separator is the underscore so they are (22_1_12_2012) The last revision did a good job at the one line renaming fix so now I rarely have to correct for the date.
User avatar
rednoah
The Source
Posts: 22987
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: how to rename only parts of files

Post by rednoah »

Yep, the last revision should hopefully fix all date-pattern related problems. Send me filenames if you find any problems. Also I'll match against a list of known TV shows now, so that's another pillar completely independent from sxe/date pattern matching.
:idea: Please read the FAQ and How to Request Help.
Post Reply