Process badly named files

All your suggestions, requests and ideas for future development
Post Reply
DavidRTurner
Power User
Posts: 89
Joined: 01 Feb 2014, 16:59

Process badly named files

Post by DavidRTurner »

Almost there... and only took a year... :)

OK - I've made my format more complex, incorporating exceptions as I come across them, and then simplified it somewhat as I've learned more...

Thanks to Red for adding the Presets feature recently; that's a major improvement for me (for the way I collect media, it's ideal to have multiple, similar presets - a flat rename, a rename with sort to series folders, a rename with sort to a unique folder... just depends on the media I'm working on at the time).

I'm stumped on one (final???) item, though:
- I use a CSV (as originally asked about in this thread, I got it going) to rename movie collections based on a numeric rename sequence (a sequel numbering format) - example:
First Blood;Rambo 1 -- First Blood
Rambo: First Blood Part II;Rambo 2 -- Rambo- First Blood Part II
Rambo III;Rambo 3 -- Rambo III
Rambo;Rambo 4 -- Rambo

...so that they contain a quick-sort-reference AND keep the original name in the filename.

But now, when I run the files through FB again, many/most of these renamed files are not recognized - which is understandable, as the filenames are modified versions of the movie names, so FB doesn't match them.
So - I've been manually re-naming them back to the original movie name, in order to run them through new formats in FB. I want to try & skip that step...

I'm trying to use the existing filename (which is the renamed-by-CSV name) as the 'name' that FB uses to pull from the dbase.
I extract the original movie name from the filename (dumping the 1st characters up to the '--' characters), but I can't figure how FB might use the result, to compare with the dbase.


An example of the issue:
Harold & Kumar movies... all are good, but I've renamed them to
H&K 1 -- Harold & Kumar Go to White Castle
H&K 2 -- Harold & Kumar Escape From Guantanamo Bay
H&K 3 -- Harold & Kumar Go to Amsterdam

Now, when I re-sort, none of them are recognized, and I even get a false result "Harold" (which has the same year as the 3rd movie).

If I got zero results, I'd be OK to continue my manual rename-back-to-original-then-run-FB-again process.
But the wrong result messes up my habits, so I'd really like to work around it by forcing a valid name through FB, as opposed to it making its own decision from the filename. Any thoughts?
User avatar
rednoah
The Source
Posts: 23931
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Process badly named files

Post by rednoah »

Since you're nicely tagging these files with double-dash, simple file-based renaming should do the trick:
viewtopic.php?f=3&t=2072

Just keep whatever's after the -- separator:

Code: Select all

{fn.after(/--/)}
PS: files previously renamed by FileBot should be tagged (via xattr) so renaming again later you shouldn't have identification issues (unless xattr was lost at some point).
:idea: Please read the FAQ and How to Request Help.
DavidRTurner
Power User
Posts: 89
Joined: 01 Feb 2014, 16:59

Re: Process badly named files

Post by DavidRTurner »

Thanks for the tip - the fn.after is easier than what I was doing with substrings...

And, I was not aware of the F2-edit function & manual over-ride for the New Names as per the linked post - this is great!


However, I may not have been clear above - I still want to use my formatting to rename to my 1,2,3 custom names. I just need to get the original name into FB so it can pull the right name from the dbase.
All my movies contain the dbase-correct name; the multi-movie sets (including files I have named myself, so that they will stay named with the movies) have my custom 1,2,3 format as well.

Basically:
Instead of FB reading the filename & searching on it, I want to extract the 'original name' (using fn.after) and have FB use that name to search... which should always match the correct movie.
So instead of a custom_format(n) line, can I force a custom_format({fn.after(/--/)}) line? I've tried several things & it doesn't (yet?) work.
**I'm assuming FB reads the (fn) to bring in as the (n) and searches on that field. So I want to customize the (n) before it searches, without manually renaming the files first (which is still a perfectly functional solution; but if code can do it, why not?)

Alternate1:
If the F2 function allowed the editing of a title in the LEFT pane, I could drop the 1,2,3 custom section as I go, which would let FB then match the original name... so consider this a feature request (also, would be nice to make the popup edit window resizeable)!


Alternate2 - a different approach:
If I have the movie ID # in the title (my collection is about 95% complete with the ID#), is there a way to have FB use that # from the dbase, regardless of the title?

Many thanks again!
User avatar
rednoah
The Source
Posts: 23931
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Process badly named files

Post by rednoah »

1.
The idea would be to use the Generic File Rename feature to rename files into something more agreeable first, and then process things again with TheMovieDB as usual.

Step 1: "Rambo 1 -- BADNAME" -> "First Blood (1982)"
Step 2: "First Blood (1982)" -> ANYTHING

Other than changing the filename, you have no control over the "query-guessing-based-filename" logic.

2.
Whatever you do, make sure that the official movie name/year is somewhere in the filename. For example, a name like Rambo 3 -- Rambo III (1988) should allow FileBot to immediately match Rambo III (1988) using it's local movie index.

3.
I recommend putting each movie into it's own folder, and have FileBot create movie.nfo files. Alternatively, you can also embed tt1234567 style IMDB IDs in the filename.

4.
Are you on Windows? I highly recommend that you store everything on NTFS filesystems only, so FileBot can store NTFS Extended Attributes (xattr) and make any file easily identifiable regardless of filename.
:idea: Please read the FAQ and How to Request Help.
DavidRTurner
Power User
Posts: 89
Joined: 01 Feb 2014, 16:59

Re: Process badly named files

Post by DavidRTurner »

Once again, thanks for the quick replies...

1. If you mean 'run the files through FB to bring back the original names (such as simply using fn.after); then run them through FB again to add my custom format', that's what I've been doing for months - I was hoping I could do something within the format itself to both a) rename normal filenames, and b) rename, then re-rename my custom filenames; but that may just be trying to do too much.

It sounds like FB can't have a 'forced' input name other than the filename (so my suggestion for an F2-Edit on the 'original files' pane would help with that)... I can live with what I've been doing;
My next addition, then, is to run my custom files to a specific folder as they name back to normal, so they're all in one place for me to run my custom format on in a single batch, putting them back to where they belong. Essentially what I'm doing now, but a little easier to maintain (I use a file manager to list all files with '--' instances, and then drag that list into FB.


2. I know the year is important; and yes, FB will recognize Rambo 1,2,3,4 as the right titles when it reads my custom list. For 3 of them, it asks for a selection from possible titles, but they are all available.
But again, Harold & Kumar movies (with my custom titles) don't come up with anything at all.
*I've noted "H&K 1..." but they're actually "Harold & Kumar 1 -- Harold & Kumar..." named. So FB should be finding "Harold & Kumar" & at least bringing me the options to select from, but it brings nothing at all.
So why it finds 'Rambo' but not 'Harold', I don't know...


3. I prefer all my movies in single folders named for the 1st-letter of the title. Some of my folder/filenames would be longer than Windows' 256-characters, so sub-folders don't work well for me. I don't like having any files other than the media themselves (I convert movies with external subs to combine them, so there aren't any external sub/srt files kicking around).
Perhaps I'm just trying to do too much; and perhaps I'm at a point in my format code which is optimal for me...

The ID# I referred to is the imdbid#. Using TMDB has a higher success rate matching movies than the OMDB dbase. Do you mean that if I included the "tt" along with the 1234567 that I have in them now, it would recognize them better? I can experiment...


4. Yes, Win7 Pro-64. My Drobo5N NAS is my media drive, so I have no direct control over its file system.
User avatar
rednoah
The Source
Posts: 23931
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Process badly named files

Post by rednoah »

1.
Sorry, that's tricky. You can automate a bit with Presets, but otherwise it's gonna be a 2-step process. Considering (3) and (4) it should only be much of an issue for most people.

2.
The official movie name is Harold & Kumar Go to White Castle (2004) according to TheMovieDB. Search for that works fine.

3.
I mean using {imdbid} in the output format. IMDB IDs (e.g. tt1234567) are the only supported type of ID that you can embed in the filename. It just helps FileBot to identify the movie. It's still gonna use TheMovieDB for everything, including IMDB ID lookups.

4.
Then I'd recommend generating *.nfo files or {imdbid} tags in the filename, to make identification easier in the future.
:idea: Please read the FAQ and How to Request Help.
Post Reply