[amc script] How to use a complex custom naming scheme?

Any questions? Need some help?
Post Reply
okretsej
Posts: 3
Joined: 01 Nov 2019, 20:35

[amc script] How to use a complex custom naming scheme?

Post by okretsej » 01 Nov 2019, 23:20

yes i am using

Code: Select all

"animeFormat=c:/users/jbeis/desktop/test2/anime/{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)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""} /{norm(n)} - {s00e00.pad(episodelist.size() < 99 ? 2 : 3)}{'Special '+special.pad(episodelist.size() < 99 ? 2 : 3)} - {norm(t)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|special[ ._-]edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[.]/, " ") + ')'}{" Part $pi"}{" [$vf $vc $ac $af]"}"
with the added title(which i really like) i was wondering if someone could help me with a regex line to use in media companion to get artwork. the scrapper get stuck on the second title in ( ) with manual entry all comes out correct but i want to auto this as well and im at a loss on how to do this part.
i know this might be inappropriate i have looked and asked elsewhere with no luck. any help would be great but still square if not. thank you

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

Re: using naming scheme

Post by rednoah » 02 Nov 2019, 05:37

1.
What does the amc log say?

Since you're not quoting the argument correctly, the format that is passed in is not what you think it is, and probably complete gibberish
viewtopic.php?t=1899


2.
Use the @file syntax for reading command-line arguments from external text files.


3.
Please read How to Request Help.
:idea: Please read the FAQ and How to Request Help.

okretsej
Posts: 3
Joined: 01 Nov 2019, 20:35

Re: [amc script] How to use a complex custom naming scheme?

Post by okretsej » 04 Nov 2019, 15:40

my bad i missed typed what i was hoping to get. the argument above is Ithiel anime naming scheme, with S00E00 change to make it easier for artwork. his/her naming scheme is as follows- folder= english title (jap title), file= english title S00E00 ep title. that works perfectly no issues. spent 12 hours doing the fine tuning to learn what it was doing. I'm not using filebot to get the artwork. media companion grabs hella artwork. (im using kodi and have a well done skin that has lots of stuff to apply art to) the issue i am having is not with filebot but with media companion and need a regex line, that i can't seem to learn on my own atm. it uses the folder name as its search parameter. it fails at reading the folder due to the alt title. wanted a regex to put into the profile that would read the folder title and stop once it reached the alt title. i can't seem to file the option to only read file names. i have reached out to multiple places looking. i want to automate both filebot (done) and media companion. so to increase my chances of finding help i posted here as well. i apologize for not quoting the argument above properly. i put it there so someone would know what it was that im getting from filebot. i am using txt file to run these args (took all 3 fields Movie tv anime from Ithiel naming scheme)
thank you tho for responding

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

Re: [amc script] How to use a complex custom naming scheme?

Post by rednoah » 04 Nov 2019, 16:02

Presumably, you have multiple questions and multiple issues, all at once, making things difficult.


The obvious issue with the argument in the OP, is that it's not escaped correctly, so regardless of whether or not the format works in itself, just copy & pasting it verbatim onto the command-line will make it not work, because the format that is actually passed in, isn't what you think it is.


Regardless, I don't actually know what you're trying to do. I don't know where you're stuck. I don't know what you have tried. I don't know what OS you're using. I don't even know if you're using GUI or CLI. I ask for screenshots because screenshots tell me a lot of things that you wouldn't think of telling me. ;)
:idea: Please read the FAQ and How to Request Help.

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

Re: [amc script] How to use a complex custom naming scheme?

Post by rednoah » 04 Nov 2019, 18:47

1.
I got your PM. Looks like you're using @files now so you should be fine as far as passing in the right format is concerned.


2.
Now to fixing up the format to make it work the way you want. Can you list a sample input file + output path that you get? And can you provide the ideal output path you'd like to get instead?

:idea: I'm assuming the goal is to modify Ithiels format to something more MC-friendly, correct?


3.
Are you already using the GUI format editor for prototyping your format? Prototyping formats in @files with Editor is going to be excruciatingly painful. Use the Format Editor GUI instead:
https://www.filebot.net/naming.html

Image
:idea: Please read the FAQ and How to Request Help.

okretsej
Posts: 3
Joined: 01 Nov 2019, 20:35

Re: [amc script] How to use a complex custom naming scheme?

Post by okretsej » 04 Nov 2019, 19:23

sorta, i did not use the gui editor i re-processed copys of the show change by change (helped to learn what was going on so don't mind)
folder
input = [horriblesubs] danMach s2/[horriblesubs] danMach S02E01.mkv
output = is it wrong to pick up girls in a dungeon (DanMach)/is it wrong to pick up girls in a dungeon/season 2/Is It Wrong To Try To Pick Up Girls In A Dungeon! S02E01 Party - Banquet Of The Gods [1080p x264 AAC 2ch].mkv

thats what its supposed to do
Mc scrapes series/eps so it reads the folder first (is it wrong..(danMach)) and can't find the show. it fails and cancels look until manual correction of the series (removal of (danMach)) personally i want to keep the (danmach) , ('+norm(primaryTitle)+'), is what would be removed from above (2nd title line) to remove the (jap title) from any and all future ones. i was hoping to find a regex line to be used with the scraper that will have it stop reading the series name once it comes upon the ( or the jap title. looking thru mc forums and the topic as above it says i can use the regex to fine tune but seems complicated since im not sure where to start on that one. then use the english title(so not sure if that is a real thing lol)

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

Re: [amc script] How to use a complex custom naming scheme?

Post by rednoah » 04 Nov 2019, 19:45

1.
Let's start by making the format human-readable:

Code: Select all

{
	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/)
	}
	/** This is the "Is It Wrong To Try To Pick Up Girls In A Dungeon!" part **/
	return norm(n)
}

{
	if (norm(n) != norm(primaryTitle)) {
		/** This is the "Dungeon Ni Deai O Motomeru No Wa Machigatte Iru Darouka - Familia Myth" part **/
		return ' (' + norm(primaryTitle) + ')'
	}
}

{
	/** This is the optional "3D" part **/
	fn.contains('3D') || fn.contains('3-D') ? ' 3D': null
}


/{norm(n)} - {s00e00.pad(episodelist.size() < 99 ? 2 : 3)}{'Special '+special.pad(episodelist.size() < 99 ? 2 : 3)} - {norm(t)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|special[ ._-]edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[.]/, " ") + ')'}{" Part $pi"}{" [$vf $vc $ac $af]"}"
:!: I've only refactored the first few {expressions} that are responsible for the series level folder name. I recommend fixing up the rest like I did so that you can read it.



2.
Now that we can easily distinguish which section of the code does what, you can simply remove the "original title" part and the "3D" part from the format, so that the series level folder name is always just the series name:

Code: Select all

{
	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/)
	}
	/** This is the "Is It Wrong To Try To Pick Up Girls In A Dungeon!" part **/
	return norm(n)
}


/{norm(n)} - {s00e00.pad(episodelist.size() < 99 ? 2 : 3)}{'Special '+special.pad(episodelist.size() < 99 ? 2 : 3)} - {norm(t)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|special[ ._-]edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[.]/, " ") + ')'}{" Part $pi"}{" [$vf $vc $ac $af]"}"
:idea: Please read the FAQ and How to Request Help.

Post Reply