Renaming folders only

All about user-defined episode / movie / file name format expressions
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Renaming folders only

Post by part timer »

So my wants for naming scheme have changed a few times as I've played with this program. Right now I'm humming and hawing if I want to change it one more time. In the meantime while I'm considering this I don't want to slow down my progress of sifting through my files though. So my question is this:

1. Can I rename my movie folders only but leave all of my other files intact inside and not change anything else?

Yes, I know i could change my naming scheme and let it loose and it could do my new folder name/fn and keep the video file the way it was already, sure. What I mean though is, leave my nfo with it's name, which could be handled with the next jar I guess, and leave my poster.jpg, fanart.jpg, extrathumbs folder with thumb.jpg's inside it. If I did rename the folder and file and even nfo like that I'd have all these orphaned jpgs left behind that I don't want to manually move.

2. So is there a way to simply get the info from the nfo and rename the parent folder in place without touching anything else?
What I'm hummingi and hawing over, is have [IMDB tt$imdb] added to the end of each folder name. Not really necessary, but can come in handy.


3. Possible after the fact, or only during?
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming folders only

Post by rednoah »

Not really, everything works with files, e.g. MediaInfo bindings wouldn't work with folder neither of course. Obviously things are all there but for this case you'd have add lots of extra logic.

Give me exact details on how it should work and I can help you write a script for that.
:idea: Please read the FAQ and How to Request Help.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: Renaming folders only

Post by part timer »

So, for going back over the folders I did and already added artwork and nfos to and stuff, basically what I'm looking for is a way to run a rename on the folder with the new info I've decided on, but for every file in there, just do a {fn} or even ignore it if possible. I guess if I had to, I could rename the parent folder and then it could create the new folder back in the right spot and put all the files there with it with the same filename and extension they started with.

It's only the folder names I want to modify.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: Renaming folders only

Post by part timer »

If I didn't have the fanart and posters and stuff downloaded already, I'd just throw the files back into filebot gui with the new directory format and {fn} and I'd be set. But this way I'll have to re-download all that stuff again. Frustrating. Or drag and drop the contents of each folder. Also frustrating. Maybe I could modify my jar somehow and let it hardcode the file names kind of and let me process jpgs as well?
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming folders only

Post by rednoah »

Actually I though of a hack that might work. FileBot does have a special case for disk folders (e.g. Avatar (2009)/VIDEO_TS/...) that'll that'll make it not traverse those folders but treat them as media objects. So you could maybe hack that to treat all folders like that.

1. Open the jar
2. Edit /net/sourceforge/filebot/media/ReleaseInfo.properties
3. Lookup this line: pattern.diskfolder.entry: ^BDMV$|^HVDVD_TS$|^VIDEO_TS$|^AUDIO_TS$|^VCD$
4. Change these patterns, e.g. ^.+nfo$ => all folders with nfo files are treated as disk folders
:idea: Please read the FAQ and How to Request Help.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: Renaming folders only

Post by part timer »

1. Oh man this is perfect, thank you. This is exactly what I was looking for. Handles the whole folder and leaves the contents intact. Perfect!! I can't really ask for better than this.

I'll admit though I was a little nervous editing that file in regular notepad, worrying about the encoding of it and messing it up like that, but this is awesome. I copied and pasted the latest jar first, so now I have one that can be for normal use and one that can be for folder use. Love it.

2. Just going to throw this out there, what about a checkbox in the format window for: folder rename only (requires .nfo) and then the user could put in their new format. Very little clutter with a small checkbox. I can see that being useful for TV Shows too, if you decided to change your setup but had nfos and fanart and posters and things you wanted to keep as well.


3. btw I also noticed the next line down ignores trailers and samples and stuff, I'm guessing that's why 'the trailer park boys' didn't get renamed, just greyed out immediately. It thought it was a trailer. Speaking of which, is there a way we could keep the trailers as <moviename>-trailer.ext. Some players htpc setups like xbmc and I'm sure others let you click on a trailer button for each movie and instead of getting it off the net would be able to use the local file for that particular movie. Why not keep it if you had it, as always imo.


Thanks so much for this idea!! You say hack, I say AWESOME.
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming folders only

Post by rednoah »

2. If its not zero-conf it's useless. And without assuming its one NFO per folder it's hard to tell what's a movie folder and what's not.

3. Maybe I should fine tune this. Let me know if you find more things that get wrongfully excluded.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming folders only

Post by rednoah »

Uploaded a new with some tweaks. Exclude rules are now updated from online like release group data.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming folders only

Post by rednoah »

Hey part timer,

I was wondering if I should add movie.nfo as diskfolder entry by default. If you have a movie.nfo then I suppose the folder is probably already processed by ember or xbmc or something, and you'll probably want to move the whole folder. Also wouldn't interfere as normal nfo files are named same as the movie, or info.nfo, never movie.nfo like xmbc does.

I just wonder if people would get that sometimes filebot will add files from folders, but then sometimes for some folders with movie.nfo it won't do that. Bit of an inconsistency I guess.

In anycase you could always rename just files if you wanted by just dropping files and not a folder.

What do you think?
:idea: Please read the FAQ and How to Request Help.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: Renaming folders only

Post by part timer »

rednoah wrote:2. If its not zero-conf it's useless. And without assuming its one NFO per folder it's hard to tell what's a movie folder and what's not.

3. Maybe I should fine tune this. Let me know if you find more things that get wrongfully excluded.
2. Like I say, I think if it's in the format window, a checkbox which says 'Rename Folders Only (*Requires one .nfo per movie)' that would be enough to let people know.

3. Not that I can think of, off the top of my head. Although, for me personally, extra features or special features are few and far between, but when I get them I do want to keep them. Preferably in a 'Special Features' subfolder or something like that.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: Renaming folders only

Post by part timer »

rednoah wrote:Uploaded a new with some tweaks. Exclude rules are now updated from online like release group data.
I think updating it like that is better than static, personally. Nice.
rednoah wrote:I was wondering if I should add movie.nfo as diskfolder entry by default. If you have a movie.nfo then I suppose the folder is probably already processed by ember or xbmc or something, and you'll probably want to move the whole folder. Also wouldn't interfere as normal nfo files are named same as the movie, or info.nfo, never movie.nfo like xmbc does.
Hmm. This is probably true for the most part, but at the same time someone might really want to change the video file name as well. I renamed a folder of 1000 movies already that all had nfo's because I wanted the folder and file names to change and didn't want to keep the clutter files, even the artwork. Is it possible to do this and if someone has the format as folder/file it will change the folder name and the video file and any other file that matches the video file name exactly? That way if they want to change only the folder name they only have the format with folder. If they want to change the folder and files.... You know what, again this might work for a lot of people, but I think it might just be easier to add the checkbox 'Rename Folder Only'
rednoah wrote:I just wonder if people would get that sometimes filebot will add files from folders, but then sometimes for some folders with movie.nfo it won't do that. Bit of an inconsistency I guess.
I don't know what you mean about adding files from folders. Oh you mean sometimes it would show you your files to be renamed and sometimes show you the whole folder instead. Yeah that might be odd.
rednoah wrote:In anycase you could always rename just files if you wanted by just dropping files and not a folder.
Like in the analyze pane that I like so much. I just like that I don't have to worry about which files get included and which excluded. With analyze I get to pick. I like to pick and choose and for me that's probably why I would like the checkbox. I'm in control that way of which folders get folder only.

If only I knew when I started to rename all my folders and files what I know now. Would have saved me so much time.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: Renaming folders only

Post by part timer »

For some reason I never did get notified of those posts you made btw.

Anyways, I have an issue with this renaming now.
I love it, it's awesome... EXCEPT... that somehow the logic it uses is different or something. If I drag in a folder into the original r1145 it matches right away using my nfo. If I drag that same folder into r1145 disk mode it gives me a list of movies and sometimes the movie I want isn't even listed. It's using the folder name for lookup. Not the nfo w/imdb id that is present.

btw I like the pop up window seems to have a more info now. I still wish when I resized it bigger to be able to read the whole line in the top of the window and see more rename options, that next time that window opened it did so at the same size it was when I closed it. I of course have no idea how easy or hard that is, just annoying that it's so small. Even though I really hope to never need it anyways, since I hope for 100% matches.

I need to change this logic. It asks me to confirm every movie and it's not very accurate this way. Seems to trim off most of the title actually, even though they were renamed once already with filebot.
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming folders only

Post by rednoah »

1. An option, especially in the format dialog doesn't make sense, since that option ONLY affects how dropped files are handled. It has nothing to do with matching or formatting. And if there was a checkbox it wouldn't change anything that's already dropped, what's dropped is dropped, only would affect newly dropped files. Anyway I think it's complicated.

2. Like I said, it's so simple, just drop the stuff you wanna rename. If you drop a set of files (e.g. from Windows Search or Analyze) then it'll take it as it is, only folders ever get resolved to files (with the exception of "diskfolders"). So I decided to not resolve folders that contain "movie.nfo". But if someone wanted to rename the files inside, just drop the files instead of the folders. Extra files that match the video files by name are handled accordingly as always.

In some cases not resolving movie.nfo folders might be inconvenient, but working around that by dropping the files takes about 2 seconds. In most cases it's probably want people would want anyway.

3. Did have much special handling folders, it tried looking for sibling nfo files, not files in that folder. Already tweaked lots of things to work better with normal movie folders.
:idea: Please read the FAQ and How to Request Help.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: Renaming folders only

Post by part timer »

I'm at a stand still with my extra renaming until we can figure out, and by we obviously I mean you, ;) why the nfo's aren't being picked up the same way in disk mode as they are in file mode (100% matches). Maybe it's a simple tweak in the r1145 I can change, hopefully, or maybe a new jar?

Thank you so much.
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming folders only

Post by rednoah »

uploading r1167...
:idea: Please read the FAQ and How to Request Help.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: Renaming folders only

Post by part timer »

Awesome, thank you. Renaming now. So far only 2 have popped up to ask, but both had the choice available for me as the number 1, tt0364343 and tt0416449. I still had to edit the jar though, because all of my nfo's match the filename.

Thank you for the update though.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: Renaming folders only

Post by part timer »

Ok, so I've been slowly plodding my way through. Any idea why the regular jar can match files in seconds and the folder disk version generally takes minutes? There can be the odd case where it's seconds, but really it is SLOOOOW. I don't have the patience to wait for large batches, so I've been running 2-3 movies each. TMDB definitely goes a lot faster than imdb does. Would be going a lot smoother if I could be adding more like 30 at a time.

Any suggestions?
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming folders only

Post by rednoah »

I guess since you've been doing lots of renaming lately, lots of data is already cached. The first time will be slow, after that i'll be instant.

btw what are you doing?
Do you run the jar by double-clicking it directly? Then it should create a folder called "cache". If both jars are in the same folder they can use the same cache (but only one instance is allowed to run at a time). If you have each jar in a different folder then they have their own caches.

You could add -DthreadPool=20 system property, that'll make imdb faster cause it'll allow for more parallel connections.

If you wanna see whats going on you can use Fiddler2 Debugging Proxy:
http://www.fiddler2.com/fiddler2/

Just set a proxy for filebot and you'll see all the network requests and what's going on, and how long things are taking:
-Dhttp.proxyHost=localhost
-Dhttp.proxyPort=8888

I can't do anything about slow network requests, but maybe there is a different problem.
:idea: Please read the FAQ and How to Request Help.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: Renaming folders only

Post by part timer »

When I download a new jar it goes into my download folder. They have all been downloaded to that same folder, like 10 maybe. Then I just double click it to open. for a minute I did actually have 2 jars open at the same time, the newest one and the same one modified for the nfos. Didn't seem to have any problems, but was only just long enough to do a match and get a result. Quite fast.

Is that threadpool a value somewhere in the jar? Any idea where? My connection is generally 8mbit/sec.
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming folders only

Post by rednoah »

If you run two instances at the same time, the first one will get the cached data, and the second one can't get a lock and has to start from scratch. So the second will be very slow (or seem slow since the other can skip all network).

8mbit or 100mbit doesn't make a difference, depends on how fast the server can send a response. You can check that with fiddler2 if you wanna look into this.

You can set system properties like this:
java -DthreadPool=8 -jar FileBot.jar

It's easier to just use the portable version which has an .exe and .l4j.ini that'll make it easier to set these options.
:idea: Please read the FAQ and How to Request Help.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: Renaming folders only

Post by part timer »

I still don't get why it asks me which movie it is in disk mode about 30% of the time, when there is an nfo with every movie named the same as the movie and with the imdb id in the nfo. Should it not be a 100% match to that nfo file every time?

PS. I really do like the window with the option to ignore all, imo it really speeds it up and is so much nicer to deal with. I just wish it didn't even show me the window, because it already knew which movie it was. ;)
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming folders only

Post by rednoah »

=> r1974
:idea: Please read the FAQ and How to Request Help.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: Renaming folders only

Post by part timer »

rednoah wrote:=> r1974
I'm assuming you meant 1174, but it seems to be broken for me. Using non disk mode for right now and it matches a few then when the hour glasses pop up before the first one even gives me the new name, all the hour glasses disappear and instead it says [null] in its place.
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming folders only

Post by rednoah »

shit happens :P

=> r1175
:idea: Please read the FAQ and How to Request Help.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: Renaming folders only

Post by part timer »

New issue.
I edited the jar like the rest for disk mode, but it doesn't do disk mode with my nfo's.
movie.nfo works, but when I edit the same way I edited the last 3 with the data you provided in an earlier post it doesn't do disk mode. :(
Post Reply