Media Companion
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Media Companion

Discussion and development board for the program Media Companion.
 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

 

 Basic Movie Renamer program based on nfo contents...

Go down 
3 posters
AuthorMessage
StormyKnight
VIP
VIP



Posts : 556
Join date : 2008-10-08
Location : Australia

Basic Movie Renamer program based on nfo contents... Empty
PostSubject: Basic Movie Renamer program based on nfo contents...   Basic Movie Renamer program based on nfo contents... Icon_minitimeSat Aug 01, 2009 4:25 pm

Ok I have whipped up this program over the last week or so & I thought some others may want to use it.

How it works...

You select YES or NO to if you want to rename or not. Basically if you say NO it goes thru the whole process but doesn't rename anything.
You select a Folder
The program searches for nfo files.
If found it gets the TITLE & YEAR info from the nfo
It renames any matching files in the folder

i.e. If it finds BOLT.nfo

It will rename the BOLT.avi to Bolt (2008).avi

it will also rename any files ending in mpg,mkv,-fanart.jpg,nfo,tbn (You can add others easily to...)

So all the associated files should now have the new correct name & year

The whole program is infact a Mortscript script file, i.e. a text file so you can edit it as you see fit. I have provided some rudementary comments in the file that may help.

Download Movie Renamer.zip

Just extract the zip contents in a folder & run the Movie Renamer.exe

I suggest you test on a dummy folder first with a copy of some of your files to confirm correct operation.

The status window will show you the progress if you have many files, & the log file will be opened at the end so you can review the results.

Remember that you need to do a REBUILD MOVIES in Media Companion so that Media Companion can see the newly renamed files.

Cheers
StormyKnight
Back to top Go down
billyad2000
Admin
billyad2000


Posts : 1326
Join date : 2008-09-20

Basic Movie Renamer program based on nfo contents... Empty
PostSubject: Re: Basic Movie Renamer program based on nfo contents...   Basic Movie Renamer program based on nfo contents... Icon_minitimeSun Aug 02, 2009 12:14 pm

A media renamer has always been on my wishlist for MC.

The biggest thing that has been stopping me was the risk that some files associated with an nfo are missed and become disassociated with the nfo, fanart, posters, and other related media files.

For example.

moviename-cd1.avi
moviename-cd2.avi
moviename-fanart.jpg or moviename-cd1-fanart.jpg
moviename.tbn or moviename-cd1.tbn
moviename-cd1.sub
moviename-cd1.srt
moviename-cd2.sub
moviename-cd2.srt
or perhaps moviename-cd1.rar has the subs, anyway, and this is just a small selection of examples, you can see the problem i've had.

May I ask how your renamer deals with this problem.
Back to top Go down
http://billyad2000.co.uk
StormyKnight
VIP
VIP



Posts : 556
Join date : 2008-10-08
Location : Australia

Basic Movie Renamer program based on nfo contents... Empty
PostSubject: Re: Basic Movie Renamer program based on nfo contents...   Basic Movie Renamer program based on nfo contents... Icon_minitimeSun Aug 02, 2009 1:22 pm

It relies on the fact that Media Companion creates the correct files to start with albeit without using the actual Title of the movie. So all associated files have the same base component in their filename. e.g. moviename

So basically it finds a nfo file, e.g. moviename.nfo, chops off the .nfo & adds the extension i.e. .avi, .tbn, -fanart.jpg

It then searches for that file, if it exists exactly then it is renamed using the TITLE & (YEAR) from the nfo information + the extension component. Any information in the nfo can be added of course such as the tt number. It will just require an extra section to read it out of the nfo & add it correctly to create the new base filename.

The "-cd1.avi", "-cd2.avi", "-cd1.rar" etc would be treated the same as the "-fanart.jpg" currently is.

The thing to remember is that "-fanart.jpg" is treated as being different to ".jpg" as it is the whole string that has to match & they are different extensions as far as my program is concerned.

Those additional searches just need to be added at the top of the script.

So from your reply the following would need to be added to the program to handle those files...

-cd1.avi
-cd2.avi
-cd1-fanart.jpg
-cd1.tbn
-cd1.srt
-cd2.sub
-cd2.srt
-cd1.rar

Cheers
Back to top Go down
StormyKnight
VIP
VIP



Posts : 556
Join date : 2008-10-08
Location : Australia

Basic Movie Renamer program based on nfo contents... Empty
PostSubject: Re: Basic Movie Renamer program based on nfo contents...   Basic Movie Renamer program based on nfo contents... Icon_minitimeSun Aug 02, 2009 1:47 pm

Further to your question Billy, I think I would need to modify the program to search for each of the different .nfos first & lastly for the basic .nfo.


So I would need to add the code to search for several different types of nfos....
i.e. ending in...
-cd1.nfo
-cd2.nfo

& lastly
.nfo

If found we can then strip off the front bit which will be the moviename, from here we can find the others such as moviename-cd1.tbn OR moviename-cd2.rar & rename them as appropriate.

Once found they can be renamed as we wish.

Looks like I need to do a little more work on the script to handle these multipart movies....
Back to top Go down
billyad2000
Admin
billyad2000


Posts : 1326
Join date : 2008-09-20

Basic Movie Renamer program based on nfo contents... Empty
PostSubject: Re: Basic Movie Renamer program based on nfo contents...   Basic Movie Renamer program based on nfo contents... Icon_minitimeSun Aug 02, 2009 2:01 pm

That was just some of the obvious problems,

Some of the less obvious have people keeping trailers and subs in subfolder and the such.

I'll have to think about it some more.
Back to top Go down
http://billyad2000.co.uk
StormyKnight
VIP
VIP



Posts : 556
Join date : 2008-10-08
Location : Australia

Basic Movie Renamer program based on nfo contents... Empty
PostSubject: Re: Basic Movie Renamer program based on nfo contents...   Basic Movie Renamer program based on nfo contents... Icon_minitimeSun Aug 02, 2009 2:14 pm

Well I guess there must be some rules that XBMC have made that we have to follow as to the naming conventions & the location of files.

PS I also noticed that if I have several movies moviename-cd1.avi, moviename-cd2.avi then nfo is moviename-cd1.nfo but the thumbnail is just moviename.tbn

They don't make it simple do they?

Is TV show renaming any easier? I haven't thought much about that Smile
Back to top Go down
billyad2000
Admin
billyad2000


Posts : 1326
Join date : 2008-09-20

Basic Movie Renamer program based on nfo contents... Empty
PostSubject: Re: Basic Movie Renamer program based on nfo contents...   Basic Movie Renamer program based on nfo contents... Icon_minitimeSun Aug 02, 2009 3:35 pm

Now your seeing the problems, due to the multiple naming conventions used by XBMC it has become extremely difficult to discern exactly what files are associated with a media file. It gets even more difficult if you take into account that many people using folders use "movie.nfo", "movie.tbn" and "fanart.jpg" filenames. In some ways this makes it easier since the file names of these becomes irrelevent, but there since there is no starting point as to the filename of the actual media file, the only way to do it is to examine the entire contents of the folder and try to match the items up.

TV Shows are a little bit easier since the tvshow and fanart are not related to the media, and there is only one standard to worry about, namely
tvepisodefilename.nfo, tvepisodefilename.avi, and tvepisodefilename.tbn, with possible tvepisodefilename.rar, tvepisodefilename.sub, and tvepisodefilename.srt
The only slight difficulty is with multipart tv media files that have nfo's that contain multiple episode details.
Back to top Go down
http://billyad2000.co.uk
SuperWade2
New User
New User



Posts : 1
Join date : 2009-08-06

Basic Movie Renamer program based on nfo contents... Empty
PostSubject: Re: Basic Movie Renamer program based on nfo contents...   Basic Movie Renamer program based on nfo contents... Icon_minitimeThu Aug 06, 2009 7:28 am

Would it be possible to code the app so I could select a top level folder (like X:\Movies in the below example) and have it travel through each of the subfolders under that to do the rename process with one click?

X:\Movies
X:\Moves\Movie1Name\BadlynamedMovie1.MKV/NFO/TBN, etc
X:\Movies\Movie2Name\BadlynamedMovie2.MKV/NFO/TBN, etc
X:\Movies\Movie3Name\BadlynamedMovie3.MKV/NFO/TBN, etc
Back to top Go down
Sponsored content





Basic Movie Renamer program based on nfo contents... Empty
PostSubject: Re: Basic Movie Renamer program based on nfo contents...   Basic Movie Renamer program based on nfo contents... Icon_minitime

Back to top Go down
 
Basic Movie Renamer program based on nfo contents...
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Media Companion :: Media Companion :: General Discussion-
Jump to: