Kodi Community Forum

Full Version: XBMC File Renaming Utility (X-FRU)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I wanted to bring to the attention of the XBMC community an application that my associate, bitwize, and I are developing: XBMC File Renaming Utility (X-FRU). This program is intended to consolidate, organize, and standardize the nomenclature of your video library (Movies and TV Shows.) Special attention is being paid to ensure that the application supports as many naming conventions (nomenclatures) that XBMC can understand as well as provide upwards compatibility with special skin features that rely on file/folder names (ie Aeon Stark's resolution tagging.)

Originally we wanted to keep this project a secret until we had something to show, but we'd like to get the community's opinion on the direction of the project. Hopefully any garish design flaws or missing features will be noticed and suggested before the framework of the program is finished. For specific information on X-FRU please visit http://bitwize.techdocrx.com/xfru/. It's not very pretty, but the page dictates what its purpose is. For any questions, suggestions, or comments feel free to post here or email me at the email provided on the website.

We look forward to contributing to the XBMC community!
first question

Quote:Episode: TVShowName.S##.E##.Resolution.extension

does . have to be used? will there be custom option? for example: TVShowName - S##.E## - TVShowEpisodeName Resolution.extension
nekrosoft13 Wrote:first question
does . have to be used? will there be custom option? for example: TVShowName - S##.E## - TVShowEpisodeName Resolution.extension
Not at all. This was only intended to show the recommended naming scheme as it's the one that I am most familiar with, know it works with XBMC, and feel that it's aesthetically pleasing.
The program will support selecting which extensions are 'valid' (that is, what file extensions you actively maintain in your movie folders and would like renamed) and additionally, the file extensions that represent fanart, (jpgs) for additional maintenance. This accommodates the situation where all your media is lumped in one folder, and you only want to format media files that XBMC can read.

@ nekrosoft13: I'm hoping to add user-defined separators to have the program parse file names based off your own personal naming convention. For example, if you separate the name of the media file from the year of the media file with a '-'. an '_' a space, etc, etc, you need only define this meta character and the program will use that to split the name upon. Some character are more tricky to split on than others, (periods, for example) but I'll get there.

Feel free to make any suggestions / criticisms.

Edit: I should mention that my XBMC knowledge is low. rickatnight11 is the media fanatic and XBMC guru. I'm mostly in it for the coding aspect.
Suggestions:

IMDB parsing from .nfo files: Sometimes the foldername is not the proper name of the movie. Allow the program to check moviename.nfo for the IMDB url, get the movie name from there. Having this as the first option would be good.

Options as to what to do with old (renamed) files: I talked to one person who wants to have the proper moviename.nfo, but keep their scene release .nfo. As for me, some of my folders have multiple .nfo/tbn files, of which I really only need moviename.ext. Allow for deletion of all unnecessicary files, or to keep certain things.

Multiple fanart files: It's not here now, but I'd imagine that people will want to be able to use more than one fanart for a movie. Again, personally, some of my movies contain a moviename-fanart.jpg and a moviename-fanart 2.jpg. You should have it be able to order these files consecutively.

Also, sometimes, I don't have XBMC set to use moviename-fanart.jpg, and have manually selected moviename-fanart2.jpg for use. Maybe have an option to select which fanart to rename to moviename-fanart.jpg when multiples are detected?

Custom stringexpressions for multipart files: A *few* users have custom strings defined to deal with odd multipart names.

Ex: Moviename (1-2).jpg, Moviename (2-2).jpg

Have a place to define the expression as used in XBMC? If you really wanted to get crazy, you could have it find the XBMC settings folder and parse custom string expressions automatically.

TV Show naming: You should add three other options for how to deal with folders.

3. Each TV Show has its own directory, most seasons have their own subdirectory, misc episodes are in another subdirectory.

4. Each TV Show has it's own directory, seasons have their own subdirectory, misc episodes are in the Show-specific folder.

5. All shows are in one folder.


DVD recognition: Make sure it knows how to deal with the .ifo/vob files in a DVD-folder. (I know, I know, I should just put them in .iso's)

Rar's: Gotta be able to deal with movies stored in multipart .rar files.


Criticisms: Don't really have any. One concern tho - I was under the impression that XBMC will shortly be able to parse the resolution directly from the video dimensions...making the need for tags like [resolution] unnecessary.

Uh...hmmm...that's all I've got for now. Figure out how to get it to do all of that stuff, and you've got yourself one sick video renamer. I'll endorse that badboy till I'm blue in the face. Big Grin
digitalhigh Wrote:IMDB parsing from .nfo files: Sometimes the foldername is not the proper name of the movie. Allow the program to check moviename.nfo for the IMDB url, get the movie name from there. Having this as the first option would be good.
We were actually just discussing this. Because this application is supposed to accompany other tools like XMC people will be using these tools in different orders and at different "states" in their organization process. We are going to try to implement the ability to pull the movie information from the .nfo file like you said if you have already run XMC or MIP to rename the parent directory and its contents. If you are running this tool first it can be a bit tricky, and ultimately depends on how you have already formatted the directory structure. If you already have your directory names "nomenclaturized" then our program can run based off of that information. If not, then running XMC or MIP first to generate the .nfo files first would probably be the best course of action.

digitalhigh Wrote:Options as to what to do with old (renamed) files: I talked to one person who wants to have the proper moviename.nfo, but keep their scene release .nfo. As for me, some of my folders have multiple .nfo/tbn files, of which I really only need moviename.ext. Allow for deletion of all unnecessicary files, or to keep certain things.
We already have planned to deal with unexpected files. The program will list the files that it is expected, and display what it recommends you do with them, but it will also list the files that it finds and doesn't have rules for. It will prompt the user for action, and eventually we will work in some intelligence for these files. A good example would be if someone added some fanart but left the extension as .jpeg, then the program would suggest changing it to the standard .jpg so XBMC will pick it up. This should allow users to keep additional files in their library (such as your friend's scene .nfo files.)

digitalhigh Wrote:Multiple fanart files: It's not here now, but I'd imagine that people will want to be able to use more than one fanart for a movie. Again, personally, some of my movies contain a moviename-fanart.jpg and a moviename-fanart 2.jpg. You should have it be able to order these files consecutively.
Great idea. Since the standard isn't in XBMC yet we can't really implement this (we don't know what convention they will use) but we can certainly lay the framework down to make it a cinch to activate it later.

digitalhigh Wrote:Also, sometimes, I don't have XBMC set to use moviename-fanart.jpg, and have manually selected moviename-fanart2.jpg for use. Maybe have an option to select which fanart to rename to moviename-fanart.jpg when multiples are detected?
We are certainly going to have to work on the algorithm that detects the expected files and separates them from unexpected files. Your situation of multiple fanart files will certainly be factored in. If XBMC is going to be implementing multiple fanart support then that may just be the fix here. It doesn't really matter which comes first as long as XBMC can detect them all. Perhaps what we will do for now is use a naming convention (numbering more like it) that XBMC will most likely be able to detect, and let the user choose which one is the first one (-fanart.jpg rather than -fanart2.jpg) to support current XBMC functionality but provide scaling for future features.

digitalhigh Wrote:Custom stringexpressions for multipart files: A *few* users have custom strings defined to deal with odd multipart names.

Ex: Moviename (1-2).jpg, Moviename (2-2).jpg

Have a place to define the expression as used in XBMC? If you really wanted to get crazy, you could have it find the XBMC settings folder and parse custom string expressions automatically.
We will certainly have an extensive custom naming/numbering scheme selection by using wildcards, but I am not familiar with situation you are referring to. Are these users editing anything in XBMC to make this work?

digitalhigh Wrote:TV Show naming: You should add three other options for how to deal with folders.

3. Each TV Show has its own directory, most seasons have their own subdirectory, misc episodes are in another subdirectory.

4. Each TV Show has it's own directory, seasons have their own subdirectory, misc episodes are in the Show-specific folder.

5. All shows are in one folder.
Certainly. The website lists only examples of directory structures, which I should have indicated. I'll update the site with your examples though. I'll try getting around to creating some nice images to visually explain each of the structures.

digitalhigh Wrote:DVD recognition: Make sure it knows how to deal with the .ifo/vob files in a DVD-folder. (I know, I know, I should just put them in .iso's)

Rar's: Gotta be able to deal with movies stored in multipart .rar files.
Definitely good ideas. The DVD recognition has been stressing me because it takes more work but I'll leave that up to master-coder bitwize, Wink. I can't believe I forgot about multipart archives. Thanks for the catch!


digitalhigh Wrote:Criticisms: Don't really have any. One concern tho - I was under the impression that XBMC will shortly be able to parse the resolution directly from the video dimensions...making the need for tags like [resolution] unnecessary.
This is true, but only to an extent. It will be pulling out information from the codec such as resolution, encoder, audio format, etc. There are some things that it will not or cannot detect. The example I was thinking about was a feature in the upcoming Aeon Stark skin where it can parse out keystrings such as BRDVD or HDDVD for BlueRay and HD-DVD rips and display icons for those movies to indicate that. We'd like to be upwards-compatible with that. In the end, the custom naming conventions will allow the users to do whatever they please, but we'd like to also provide some useful standards to help out.

digitalhigh Wrote:Uh...hmmm...that's all I've got for now. Figure out how to get it to do all of that stuff, and you've got yourself one sick video renamer. I'll endorse that badboy till I'm blue in the face. Big Grin
We really appreciate your feedback. This is exactly why we made the announcement. Your constructive and well thought-out suggestions will be extremely helpful.
rickatnight11 Wrote:We are going to try to implement the ability to pull the movie information from the .nfo file like you said if you have already run XMC or MIP to rename the parent directory and its contents. If you are running this tool first it can be a bit tricky, and ultimately depends on how you have already formatted the directory structure. If you already have your directory names "nomenclaturized" then our program can run based off of that information. If not, then running XMC or MIP first to generate the .nfo files first would probably be the best course of action.

I think if you did a combination of folder name recognition and .nfo scanning, there shouldn't be much that slips by. Unless they're custom rips, the majority of movies come with a .nfo file that has *at least* the movie's IMDB URL. it's just getting past the garbage to find it. Big Grin

Quote:Since the standard isn't in XBMC yet we can't really implement this (we don't know what convention they will use) but we can certainly lay the framework down to make it a cinch to activate it later.

Why not just set a standard? Get everybody on the same page now so that they're ready when the feature is implemented. Tell them why you have support for multiple fanarts, and people will start doing it. I think it's a pretty neat idea.

Quote:Perhaps what we will do for now is use a naming convention (numbering more like it) that XBMC will most likely be able to detect, and let the user choose which one is the first one (-fanart.jpg rather than -fanart2.jpg) to support current XBMC functionality but provide scaling for future features.

The algorithm wouldn't even need to be that complex. If the file ends with -fanart*, count it as a fanart and ask what to do. I'd go with double digits right off the bat when renaming. Scaling, like you said. If they're going to want multiple fanarts, then they're going to want a lot of multiple fanarts.

Quote:We will certainly have an extensive custom naming/numbering scheme selection by using wildcards, but I am not familiar with situation you are referring to. Are these users editing anything in XBMC to make this work?

There is the advancedsetting.xml file in the $userdata$\XBMC\settings\ folder. In it, you can define custom expressions to tell XBMC how to deal with stacked files.

Code:
<regexp>()(\([0-9]+).*(\....)$</regexp>

Is one of the expressions. Explanation of how they work is here:

http://forum.xbmc.org/showthread.php?tid...t=userdata

Quote:Definitely good ideas. The DVD recognition has been stressing me because it takes more work but I'll leave that up to master-coder bitwize, Wink. I can't believe I forgot about multipart archives. Thanks for the catch!

For dealing with the DVD, all it would need to do would be able to identify the VIDEO_TS folder, and treat that as an untouchable file.

Quote:This is true, but only to an extent. It will be pulling out information from the codec such as resolution, encoder, audio format, etc. There are some things that it will not or cannot detect.

Gotcha. So, not so much for 720p or 1080p, but for the Media it originally came on.

Quote:We really appreciate your feedback. This is exactly why we made the announcement. Your constructive and well thought-out suggestions will be extremely helpful.

If I can help you help me organize my collection better, then by all means, I'm glad to do it. There was another suggestion I had, but my ADD is acting up ATM and I forgot it. I'm sure I'll think of it again...
This is pretty close to what you're doing except it doesn't appear to have the options for the resulting filename. It does have imdb search though.
http://code.google.com/p/mediarenamer/

When will you have a release, beta or otherwise. Let us help you bug test.
Thanks for the response, KRavEN. There has been a major stall on development since work has really picked up for both bitwize and I. We hope to get back on this soon.
Seems very simular to others out there like Kraven mentioned BUT what would be VERY NICE is if...

1) runs as a service on the computer
2) watched an "import" folder, renamed the file, detected the type (TV Show or Movie) and moved it to a 'final' location.
2) automatically ran XBMC Media Companion or Media Info Plus on the newly renamed files.

this could create a fully automated process.
Is this project still live, as I have a suggestion for adding some additional options, Ive wrote a small utility that does (a very basic version) of this, but rather than actually renaming the files - it creates a new folder with symbolic links to the old data - thus creating a structure the XBMC likes, but without actually renaming - or modifying the original files.

NOTE: The symlink files need not have the same name as the original either, but im not using that just now purely because i dont need it for my structure.

eg c:\movies\POTC3.avi

could be symlinked to

c:\XBMCmovies\Pirates Of The Caribean - At Worlds End.avi

XBMC will be totally oblivious to this function as its handled at the filesystem level on the host

I needed this functionality because my main HTPC is not XBMC based, and im not willing to break it.

More about it here http://forum.xbmc.org/showthread.php?tid=46807

by adding this as an OPTION, then you allow people to keep there existing structure too.
and without duplicating files (Only costs a few Kb in the FAT)

below is an example of my original structure

Code:
+---Buffy The Vampire Slayer ~ S01E05
|   +---AUDIO_TS
|   \---VIDEO_TS
|           VIDEO_TS.BUP
|           VIDEO_TS.IFO
|           VTS_01_0.BUP
|           VTS_01_0.IFO
|           VTS_01_1.VOB
|           VTS_01_2.VOB
|          
+---Buffy The Vampire Slayer ~ S01E06
|   +---AUDIO_TS
|   \---VIDEO_TS
|           VIDEO_TS.BUP
|           VIDEO_TS.IFO
|           VTS_01_0.BUP
|           VTS_01_0.IFO
|           VTS_01_1.VOB
|           VTS_01_2.VOB
|          
+---Desperate Housewives ~ S01E05
|   +---AUDIO_TS
|   \---VIDEO_TS
|           VIDEO_TS.BUP
|           VIDEO_TS.IFO
|           VTS_01_0.BUP
|           VTS_01_0.IFO
|           VTS_01_1.VOB
|           VTS_01_2.VOB
|          
+---Desperate Housewives ~ S01E06
|   +---AUDIO_TS
|   \---VIDEO_TS
|           VIDEO_TS.BUP
|           VIDEO_TS.IFO
|           VTS_01_0.BUP
|           VTS_01_0.IFO
|           VTS_01_1.VOB
|           VTS_01_2.VOB
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And below is the structure generated within a folder (Which is what I share with my XBOX)

Code:
\---~ShaddowXBMC~
    +---Buffy The Vampire Slayer
    |   +---Season 01
    |       +---Buffy The Vampire Slayer.S01E05
    |       |       VIDEO_TS.BUP
    |       |       VIDEO_TS.IFO
    |       |       VTS_01_0.BUP
    |       |       VTS_01_0.IFO
    |       |       VTS_01_1.VOB
    |       |       VTS_01_2.VOB
    |       |      
    |       +---Buffy The Vampire Slayer.S01E06
    |       |       VIDEO_TS.BUP
    |       |       VIDEO_TS.IFO
    |       |       VTS_01_0.BUP
    |       |       VTS_01_0.IFO
    |       |       VTS_01_1.VOB
    |       |       VTS_01_2.VOB
    |       |      
    |       \---Buffy The Vampire Slayer.S01E07
    |               VIDEO_TS.BUP
    |               VIDEO_TS.IFO
    |               VTS_01_0.BUP
    |               VTS_01_0.IFO
    |               VTS_01_1.VOB
    |               VTS_01_2.VOB
    |    
    +---Gossip Girl
    |   \---Season 01
    |       +---Gossip Girl.S01E01
    |       |       VIDEO_TS.BUP
    |       |       VIDEO_TS.IFO
    |       |       VTS_01_0.BUP
    |       |       VTS_01_0.IFO
    |       |       VTS_01_1.VOB
    |       |       VTS_01_2.VOB
    |       |      
    |       +---Gossip Girl.S01E02
    |       |       VIDEO_TS.BUP
    |       |       VIDEO_TS.IFO
    |       |       VTS_01_0.BUP
    |       |       VTS_01_0.IFO
    |       |       VTS_01_1.VOB
    |       |       VTS_01_2.VOB
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If the project is still live can you let me know what you think of the idea, as mines only suits my existing structure, whereas yours is flexible and this wouldn't be hard for you to impliment as youve already done the hard part - but would be a godsend for me (and a few other from what ive read)

(NOTE: This only works with NTFS drives on windoze, but im sure linux has similar features)
That's very interesting. I like the idea of using links (shortcuts?) to create a faux library with the appropriate names and structure from an existing library that can be structured however you want. Our utility is geared towards actually editing the names and manipulating the structure itself, but I like your project. This project is very much alive, although development has drastically slowed because of work. We are spending more time on it and hope to have a working product for you soon.
rickatnight11 Wrote:That's very interesting. I like the idea of using links (shortcuts?) to create a faux library with the appropriate names and structure from an existing library that can be structured however you want. Our utility is geared towards actually editing the names and manipulating the structure itself, but I like your project. This project is very much alive, although development has drastically slowed because of work. We are spending more time on it and hope to have a working product for you soon.

Well its great to know that its still active, please keep the idea in your head as it would be awsome - and easy to impliment.

Would just like to clarify that (On a MS operating system) a shortcut is NOT a symlink. Hence why creating shorcuts to do this doesnt work.

What were basically doing is having 2 seperate pointers in the Allocation Table (each with its own name) pointing to the same physical location on a disc.

Linux has REAL symlinks, but these ones are similar if not so powerful (links cant cross a volume boundry)

Anyway - look forward to seeing your works, as it seems to be a hot topic, getting everything named right. Laugh
rickatnight11, I found this thread by searching for exactly such a tool. Has there been any progress regarding the development of your program?

Maybe, you could consider the following feature:

Some movie files are named with their non-English name (e.g. German title). IMDB can derive the respective English title with the help of the "AKA title search". If you could add such a feature, this would be of tremendous help!
That's a great idea. I definitely have found it annoying that I can't title my movie "Pan's Labyrinth". Sadly we haven't touched this in white a while. Life has been extremely busy for the both of us. Thanks for bringing our attention back though.
Pages: 1 2