Copying/Renaming of related files

Any questions? Need some help?
Post Reply
0rca
Posts: 9
Joined: 24 Aug 2014, 22:50

Copying/Renaming of related files

Post by 0rca »

Hi all,

I have been working on my renaming format for quite some time now and and am almost satisfied with what it does. But now I ran into an understanding problem of sorts, as I can't figure out how to handle additional files like artwork etc.

This is what I am using in order to clean up all my exsiting movie folders via the GUI:

Code: Select all

{any {if (info.ProductionCountries[0,1,2,3,4].join(', ').matchAll(/bangladesh|burma|china|hong.kong|india|indonesia|japan|korea|laos|macau|malaysia|maldives|mongolia|myanmar|nepal|north.korea|singapore|taiwan|thailand|viet.nam/)){'Eastern/'}}{''}}{any  {if (genres.join(', ').matchAll(/^(?=.*action)(?=.*comedy)/))('Action-Comedy')}{if (genres.join(', ').matchAll(/^(?=.*action)(?=.*horror)/))('Action-Horror')}{if (genres.join(', ').matchAll(/^(?=.*action)(?=.*thriller)/))('Action-Thriller')}{if (genres.join(', ').matchAll(/^(?=.*drama)(?=.*comedy)/))('Comedy-Drama')}{if (genres.join(', ').matchAll(/^(?=.*action)(?=.*drama)/))('Action-Drama')}{if (genres.join(', ').matchAll(/^(?=.*horror)(?=.*comedy)/))('Horror-Comedy')}{if (genres.join(', ').matchAll(/animation/))('Animation')}{if (genres.join(', ').matchAll(/documentary/))('Doku')}{if (genres.join(', ').matchAll(/sci-fi/))('Sci-Fi')}{if (genres.join(', ').matchAll(/western/))('Western')}{genre}{'[No Genre]'}}/{norm =  {it.upperInitial().lowerTrail().replaceTrailingBrackets().replaceAll(/[`´‘’?""“”]/, "'").replaceAll(/[:|]/, " - ").replaceAll(/[?]/, "!").replaceAll(/[*\s]+/, " ").replaceAll(/\b[IiVvXx]+\b/, { it.upper() }).replaceAll(/\b[0-9](?i:th| nd|rd)\b/, { it.lower() }).replaceFirst(/^(?i)(The)\s(.+)/, /$2, $1/)}; norm(n)}  {if (norm(n) != norm(primaryTitle)) '  ['+norm(primaryTitle)+']'}  {" ["+file.path.lower().replace(/dc/, 'director\'s cut').replaceAll('limited','limited release').replaceAll('directors','director\'s').replaceAll('-','').replaceAll(/director.s|theatrical/,'$0 Cut').matchAll(/(uncensored|uncut|unrated|remastered|ultimate|extended|director?s|theatrical|ultimate|final|bootleg|special|fan?edit?|limited|rifftrax|monstervision|youtube|hulu|netflix|vimeo|edited|edit|censored+)(?:.edition|.cut|.version|.edit|.release|.extended|.rip)?/)*.upperInitial()*.lowerTrail().sort().join('] [')+']'} ({y}{csv('c:/Program Files/FileBot/countrycodes.csv').subMap(info.ProductionCountries).values().join(', ')} {minutes}min)/{n.replaceAll(/[:|]/, "-")} ({y}{csv('c:/Program Files/FileBot/countrycodes.csv').subMap(info.ProductionCountries).values().join(', ')})  [{rating} {minutes}min]  ({audios.collect{ aud -> allOf{any{aud.language.upper()}{'EN'}}{aud.format.lower().replace('ac-3','ac3')}{aud.channels+'ch'} }*.join(' ').join(', ').replace('8ch', '7.1').replace('7ch', '6.1').replace('6ch', '5.1').replace('3ch', '2.1').replace('2ch','stereo').replace('1ch','mono')})  [{vc} {video.frameRate}fps {vf}] {any{" ("+omdb.genres.take(3).join(', ')+")"}{" ("+genres.take(3).join(', ')+")"}}
I have some folders containing artwork in the format filename-fanart.jpg, filename-poster.jpg and sometimes filename.tbn, others are already containing artwork as folder.jpg, banner.jpb, fanart.jpg and so on and sometimes a mix of all these.
Also there are some subfolder like .actors, extrafanart and extrathumbs.

How can I copy those files files together with the renaming process so that they simply are moved to the new folder?
User avatar
rednoah
The Source
Posts: 23947
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Copying/Renaming of related files

Post by rednoah »

1)
Extra files that match another video file will be matched with the same metadata so you can do any kind of special handling for those files in the format.

2)
Files that do not match another video will not be matched and hence cannot be processed. There's nothing you can do about that in the format.
:idea: Please read the FAQ and How to Request Help.
0rca
Posts: 9
Joined: 24 Aug 2014, 22:50

Re: Copying/Renaming of related files

Post by 0rca »

Hi Rednoah,

ah, too bad. I feared as much as I could't see how to do it all.

I've never used or even looked at AMC, but wouldnt I be able to do just what I need with AMC, i.e. sort all files and folders into a folderstructure which I define via my expression?

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

Re: Copying/Renaming of related files

Post by rednoah »

1)
No. The AMC script and FileBot in general take a set of files, no matter how organised, match them with metadata, apply the format, and then move files accordingly. It can't "import" and existing structure and then "export" it elsewhere.

e.g.
* Movie.mp4 (media file -> has metadata -> can be processed)
* Movie.eng.srt (linked to Movie.mp4 -> has metadata of linked file -> can be processed)
* random.xyz (meaningless file, no metadata -> will be ignored)

2)
What you should do:
* Whatever you have now, put it all in a folder "Not Sorted Yet"
* Run the AMC script on "Not Sorted Yet" and have it organise everything into a folder "Media"

So instead of "importing" all the clutter files you recreate them from scratch.
:idea: Please read the FAQ and How to Request Help.
Post Reply