rename posters and banners

Support for Windows users
Post Reply
User avatar
HtRabbit
Donor
Posts: 13
Joined: 09 Apr 2014, 01:18

rename posters and banners

Post by HtRabbit »

I am trying to rename posters and banners in the main folder with the movie but it appears i am not smarter than a 5th grader
here is what i have for the format in the gui

Code: Select all

T:/new/{fn.contains('3D') || fn.contains('3-D')|| fn.contains('3d') ? "3D\\":"Movies\\"}{def n0 = any{collection}{n}.sortName().charAt(0); n0.isDigit() ? "0-9\\" : "$n0\\"}{("$collection\\").replace(':',' ').replaceAll(/[?]/, '')}{(n ?: n).replace(':',' ').replaceAll(/[?]/, '')} {' [' + fn.matchAll(/uncensored|remastered|unrated|extended|special edition/)*.upperInitial()*.lowerTrail().sort().join(', ') + ']'} [{y}]\{def n0 = any{(n).replace(':',' ').replaceAll(/[?]/, '')}{n}?: "$n0\\"}{fn.contains('3D') || fn.contains('3-D')|| fn.contains('3d') ? "3D":""}{'.3D'+fn.matchAll(/sbs|tab/)*.upper().sort().join(', ')}{' [' + fn.matchAll(/uncensored|remastered|unrated|extended|special edition/)*.upperInitial()*.lowerTrail().sort().join(', ') + ']'} [{y}] {fn.contains('2160p')? "2160p":""} [ID IMDB {imdbid}]{fn.contains('trl') || fn.contains('Trailer')|| fn.contains('Official')|| fn.contains('trailer') ? '-'+'trailer':""}{if (ext =~ /jpg|png|gif/)'.'+fn.match(/(banner|videoimage|wide|fanart|poster)$/)}{any{subt}{f.subtitle ? fn =~ /forced/ ? '.eng.forced' : '.eng' : null}}
here is the output,
it does not seem to grab the .png or the .jpg files

Image
There is no Gravity...HST sucks!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: rename posters and banners

Post by rednoah »

Can you provide screenshots and sample file paths so that we can see and understand your use case?


In general, processing companion files is somewhat limited to processing them alongside their primary video file:
viewtopic.php?t=12172


You maybe able to use Plain File Mode for generic batch rename tasks.
:idea: Please read the FAQ and How to Request Help.
User avatar
HtRabbit
Donor
Posts: 13
Joined: 09 Apr 2014, 01:18

Re: rename posters and banners

Post by HtRabbit »

so i basically just grab a folder and drop it in the "original files" section
Image

my raw directory looks something like this. Image

after processing though i have no banners or posters Image
Last edited by HtRabbit on 19 May 2022, 17:47, edited 1 time in total.
There is no Gravity...HST sucks!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: rename posters and banners

Post by rednoah »

Please use https://snipboard.io/ or https://imgur.com/ for image hosting, or post images via our Discord channel.
:idea: Please read the FAQ and How to Request Help.
User avatar
HtRabbit
Donor
Posts: 13
Joined: 09 Apr 2014, 01:18

Re: rename posters and banners

Post by HtRabbit »

rednoah wrote: 19 May 2022, 17:38 Please use https://snipboard.io/ or https://imgur.com/ for image hosting, or post images via our Discord channel.
Oh , Sorry.
do the images not showup?

I have updates the links.
There is no Gravity...HST sucks!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: rename posters and banners

Post by rednoah »

There 2 types of companion files:
viewtopic.php?t=12172



1. Companion files that are well-named and linked to a corresponding video files by file name are matched to the same Episode or Movie object and then the rest is up to your custom format:
rednoah wrote: 09 Oct 2020, 04:36 1.
If companion files are derived-by-name and thus linked-by-name to the corresponding primary media file, then FileBot will automatically match them to the the same Movie or Episode object:

Code: Select all

Avatar.mp4
Avatar.xml
Avatar-poster.jpg
:arrow: Using {ny} as format:

Code: Select all

{ny}

Code: Select all

Avatar (2009).mp4
Avatar (2009).xml
Avatar (2009).jpg

:idea: In this case, companion files are matched to the same Movie or Episode object as the primary media file, and so the format will likely produce the same destination path for each file. If you want to preserve custom tags, then you may need to copy them over from the original file path.

:arrow: Adding fn.match() to the format:

Code: Select all

{ny}{'.'+fn.match('poster')}

Code: Select all

Avatar (2009).mp4
Avatar (2009).xml
Avatar (2009).poster.jpg


2. Companion files that are not well-named cannot be processed, but FileBot can help you copy them along:
rednoah wrote: 09 Oct 2020, 04:36 2.
Alternatively, you can also use the Import companion files post-processing feature to simply copy along any files or folders that were left behind in the original folder:
Image



:arrow: That said, if it's just artwork and nfo files, then I would leave all the clutter behind, and generate new artwork and nfo files from scratch via the Fetch artwork post-processing action. That's the easy way.

Image




:arrow: If you must process the extra files that you already have, then you may need to pre-process the file names first, e.g. rename banner.png to the.matrix-banner.png so that it matches the the.matrix.mkv by name. The Rename subtitle files to match the name of a nearby video file use case is effectively that. You just have to adapt it for image files.

Image

Image
:idea: Please read the FAQ and How to Request Help.
User avatar
HtRabbit
Donor
Posts: 13
Joined: 09 Apr 2014, 01:18

Re: rename posters and banners

Post by HtRabbit »

Thank-you for the help
i think i like the fetch best
There is no Gravity...HST sucks!
Post Reply