Renaming all folder/files but {vf} syntax error

All about user-defined episode / movie / file name format expressions
Post Reply
spiney
Posts: 4
Joined: 29 Feb 2024, 22:03

Renaming all folder/files but {vf} syntax error

Post by spiney »

Hey, I have been using a script that runs after a download for a few years now.
It has been en still is working fine.

Shell: Select all

filebot -script fn:amc --output "S:" --action copy --conflict skip -non-strict --log-file amc.log --def unsorted=y music=y artwork=n "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" seriesFormat="S:/TV-Shows/{n}/Season {s}/{n} - {sxe} - {t}" movieFormat="S:/Movies/{n} ({y}) [{vf}]/{n} ({y}) [{vf}]" subtitles=nl,en
Now I'm migrating to a new server, and I see alot of old movies and shows (pre use of filebot) that don't have the correct format.
So I want to run through the folders and have it rename them.
What I want to achieve is the same format as the script, so "Moviename (year) [1080p]/Moviename (year) [1080p]

(idealy i want to add codec and audiotype to the movie title but Im doing this step by step)

When I change the" Movie format", and use {n} ({y}) [{vf}], I get an error, "Binding "Media": Failed to read media info:"file: undefined" when I select the folder with all the movies in.
When I select some test files and match with TVmovieDB it does work.
But I can't seem to get it to work on the folders.

I'm assuming I can't rename folders that way?
Unless I go via a script in cmd?
I Don't realy wanna do Action Copy, since there are a lot of files.

PS, maybe to go a few steps further.
I'm also doing this to see what movies I wanna replace with a higher quality one.
So is it hard to move folders who are below a certain quality? Or is that a next level of script?
User avatar
rednoah
The Source
Posts: 22987
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming all folder/files but {vf} syntax error

Post by rednoah »

EDIT:

On second thought...

:?: Are you using the GUI or the CLI? If it's a one-off task, then I would recommend using the FileBot Desktop application. If you're having trouble with the amc script command above, make sure to copy & paste the console output so we can see what you can see. At a glance, I don't see an issues.

:idea: If you see Binding "media": Failed to read media info: Binding "file": undefined then you simply have not selected a sample file for testing. Where does the value of {vf} come from? It comes from the sample file you have selected for testing, which can be undefined if you have not yet done so. You can select a sample file for testings via the Icon View Bindings button. If you open the Format Editor via Double-Click ➔ Edit Match on a Movie / File match, then that Movie / File match will be used for testing for your convenience.

Screenshot Screenshot




ORIGINAL REPLY:
spiney wrote: 29 Feb 2024, 22:44 But I can't seem to get it to work on the folders.
:?: What exactly do you mean by renaming folders? Can you provide screenshots so that we can see what you can see? Please read How to Request Help for details.


:arrow: FileBot is used for organizing and renaming files. Please read Can I move files? Can I rename folders? Can I change how files are named? and How do I organize files for Plex? for details and examples.


e.g. if you want this naming scheme:

Code: Select all

S:/Movies/Moviename (year) [1080p]/Moviename (year) [1080p]
then you'll want to use this naming scheme then you would express this in FileBot as custom format like so:

Format: Select all

{drive}/Movies/{ny} [{vf}]/{ny} [{vf}]

:idea: FileBot will typically only organize / rename movie files, ignoring artwork, nfo files and other companion files that may happen to be in the same folder. Please read Companion Files if you need FileBot to copy along companion files as well.
:idea: Please read the FAQ and How to Request Help.
spiney
Posts: 4
Joined: 29 Feb 2024, 22:03

Re: Renaming all folder/files but {vf} syntax error

Post by spiney »

Thanks for the help, the syntax problem I figured out a few hours later when I tryed again (and saw some youtube vids :D)
rednoah wrote: 01 Mar 2024, 03:44 then you'll want to use this naming scheme then you would express this in FileBot as custom format like so:

Format: Select all

{drive}/Movies/{ny} [{vf}]/{ny} [{vf}]
Perfect, this works.
The problem I had was that it made folder inside the folder (or was planning to)
But this works.
rednoah wrote: 01 Mar 2024, 03:44 e.g. if you want this naming scheme:

Code: Select all

S:/Movies/Moviename (year) [1080p]/Moviename (year) [1080p]
Yes, wel wanted, since it works now, I've been able to add it more my liking.

Format: Select all

{drive}/Videos/Movies/{ny} [{vf}]/{ny} [{vf}] [{vc}] [{af}]
Screenshot

I will read through the move files part, but no harm in asking.
Is it easy to actualy move a folder/movie based on the minimum quality (like 720p and above)?
That that would mean I create a nice folder with all the movies I need to upgrade :D
If not, this already does wonders.

Thanks again
User avatar
rednoah
The Source
Posts: 22987
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming all folder/files but {vf} syntax error

Post by rednoah »

:arrow: Moving files to different folders based on some condition is very easy. See Conditional Structures (if-then-else) for details and examples:
rednoah wrote: 03 Oct 2016, 18:53 e.g. Move 4K movies and normal movies into different folders:

Format: Select all

{ height > 2000 ? '4K Movies' : 'Movies' }


:arrow: If you want to only select specific files, then How do I process only specific kinds of files? › Option 3: Use Presets with Includes has got you covered:

Groovy: Select all

height > 2000
:idea: Please read the FAQ and How to Request Help.
spiney
Posts: 4
Joined: 29 Feb 2024, 22:03

Re: Renaming all folder/files but {vf} syntax error

Post by spiney »

rednoah wrote: 03 Oct 2016, 18:53 e.g. Move 4K movies and normal movies into different folders:

Format: Select all

{ height > 2000 ? '4K Movies' : 'Movies' }
if I use this, then the movies rename themselfs to 4K movies or Movies.
it is looking and responding to the IF/ealse, but it names it to the text used (4k Movies or Movies)
Screenshot
So I tried with the locations, but it just sees it as text not a structured renaming.
Screenshot
So I'm guessing it's missing something.
User avatar
rednoah
The Source
Posts: 22987
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming all folder/files but {vf} syntax error

Post by rednoah »

Each {...} is a variable, so you would use it like this if you want separate SD / HD folders:

Format: Select all

{drive}/Videos/Movies/{ height < 700 ? 'SD' : 'HD' }/{ny} [{vf}]/{ny} [{vf}] [{vc}] [{af}]
:idea: Please read the FAQ and How to Request Help.
spiney
Posts: 4
Joined: 29 Feb 2024, 22:03

Re: Renaming all folder/files but {vf} syntax error

Post by spiney »

btw, thanks again
Post Reply