Page 1 of 1

AMC won't force Anime and language

Posted: 21 Nov 2014, 11:25
by shawly
Hi,

here is my batch script:

Code: Select all

@echo off
set input="//SERVER/Animes/Akame ga Kill!"
set excludeList="excludeList=//SERVER/Animes/excludes.txt"
set animeFormat="animeFormat=//SERVER/Animes/{n} ({y})/{n} - {e} - {t}"
set logPath="//SERVER/Animes/filebot.log"
set action=move

call filebot -script fn:amc %input% --log-file %logPath% --action %action% -non-strict --def "ut_label=Anime" %excludeList% %animeFormat% --lang en
pause
So for example I once tried to look for Akame ga Kill, instead of using AniDB it used TVDB, so the ut_label param is ignored because I previously renamed them with TVDB so now the episodes contain S01 which forces TVDB.. I have to rename them first to get filebot to use AniDB which eliminates the whole purpose of the ut_label variable...
Next problem is, after I renamed the anime it uses AniDB, BUT now instead of the english name it uses the german name, because I previously used the --lang de parameter but then switched back to en because AniDB doesn't know the german name, but it still uses the german name so it won't recognize the lang en parameter and I don't know why....

Code: Select all

Nov 21, 2014 12:06:07 PM java.util.prefs.WindowsPreferences <init>
WARNUNG: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Parameter: ut_label = Anime
Parameter: excludeList = //SERVER/Animes/excludes.txt
Parameter: animeFormat = //SERVER/Animes/{n} ({y})/{n} - {e} - {t}
Argument: \\SERVER\Animes\Akame ga Kill
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (1).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (10).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (11).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (12).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (13).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (14).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (15).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (16).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (17).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (18).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (19).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (2).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (20).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (3).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (4).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (5).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (6).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (7).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (8).mkv
Input: \\SERVER\Animes\Akame ga Kill\Akame ga Kill! (9).mkv
Group: [anime:akame ga kill schwerter der assassinen] => [Akame ga Kill! (1).mkv, Akame ga Kill! (10).mkv, Akame ga Kill! (11).mkv, Akame ga Kill! (12).mkv, Akame ga Kill! (13).mkv, Akame ga Kill! (14).mkv, Akame ga Kill! (15).mkv, Akame ga Kill! (16).mkv, Akame ga Kill! (17).mkv, Akame ga Kill! (18).mkv, Akame ga Kill! (19).mkv, Akame ga Kill! (2).mkv, Akame ga Kill! (20).mkv, Akame ga Kill! (3).mkv, Akame ga Kill! (4).mkv, Akame ga Kill! (5).mkv, Akame ga Kill! (6).mkv, Akame ga Kill! (7).mkv, Akame ga Kill! (8).mkv, Akame ga Kill! (9).mkv]
Rename episodes using [AniDB]
Auto-detected query: [Akame ga Kill: Schwerter der Assassinen]
Failed to fetch episode data: [Akame ga Kill: Schwerter der Assassinen]
CmdlineException: Unable to match files to episode data
Finished without processing any files
Failure (°_°)

Re: AMC won't force Anime and language

Posted: 21 Nov 2014, 12:00
by rednoah
1.
If you report a bug about not being able to force Anime it'd be good if you attached a log that isn't using AniDB. :D

2.
xattr set in previous runs will affect future runs. For testing you can use --action test which implicitly sets -no-xattr flag.

xattr view or clear:
viewtopic.php?f=4&t=5#p5394

3.
If you want to override previously misnamed files it's best to do it in the GUI. The amc script is not designed for that.

Re: AMC won't force Anime and language

Posted: 21 Nov 2014, 12:26
by shawly
Yeah well, like I said, the reason why it uses TV is because forceSeries in the amc.groovy script checks if the file contains the season and episode prefix e.g. S01E01, which is true.
forceAnime is also true because of ut_label=anime and the path containing "Anime".

Down in the code where the grouping happens you just ask if forceSeries is true which indeed is true, so it matches to tvs.

Code: Select all

	if (forceSeries(f))
		return [tvs:   detectSeriesName(f, true, false) ?: detectSeriesName(input.findAll{ s -> f.dir == s.dir && s.isVideo() }, true, false)]
	if (forceAnime(f))
		return [anime: detectSeriesName(f, false, true) ?: detectSeriesName(input.findAll{ s -> f.dir == s.dir && s.isVideo() }, false, true)]
So if forceSeries is true it doesn't even check for animes. That does even apply to movies and other aswell, because you ask if it's a movie before you ask if it's a series or an anime, so the part in the script where it checks if forceXY is true should be completly changed or you should cancel each variable out like a switch case where it checks if ut_label is anime then it changes forceSeries, forceMovie and others to false.
I'm sorry if I didn't explain it properly, since my native language isn't english. But there clearly is a flaw in the code.

If you fix the part where it detects the type of the content (and if it's forced or not) it would also be possible to fix misnamed files.

Simplest workaround would be to check IF a label is set and then directly set force true for the specific label and set the others to false.

Edit: A more stable workaround would be for example (might not be working I never wrote groovy code since I'm Javadev):

Code: Select all

def forceAnime = { f ->
	(label =~ /^(?i:Anime)/ && label !=~ /^(?i:audio|music|music.video|TV|movie|other)/) || f.dir.listPath().any{ it.name ==~ /(?i:Anime)/ } || (f.isVideo() && (f.name =~ /(?i:HorribleSubs)/ || f.name =~ "[\\(\\[]\\p{XDigit}{8}[\\]\\)]" || (getMediaInfo(file:f, format:'''{media.AudioLanguageList} {media.TextCodecList}''').tokenize().containsAll(['Japanese', 'ASS']) && (parseEpisodeNumber(f.name, false) != null || getMediaInfo(file:f, format:'{minutes}').toInteger() < 60))))
}
For short I just checked if the label is anime AND is not movie,music,TV or anything other. Isn't really a solution but definetly makes the forcing with ut_label possible.
Of course it would have to be implemented similar for the other force variables.

How do I use my own version of the amc script? I wanna try it myself :D

Re: AMC won't force Anime and language

Posted: 21 Nov 2014, 13:01
by rednoah
Alright, that's a known "issue", ...

However:

* If you have SxE numbered files it's a very BAD IDEA since SxE numbered files cannot be reliably be matched to AniDB data (it merely happens to work in special cases if happen to be lucky)

* The only reason you have this issue is because you process files that have already been processed, and the "issue" is that files are processed the same way as the first time around, which is intended behaviour

So consider ut_label more of a hint, that may or may not be ignored depending on the actual data ;)


PS: Why do you even use the amc script to fix specific files? You seem to know already that you want to -rename files for --q "Akame ga Kill" with --db AniDB in -non-strict mode :D I'd use the GUI but it's not like you can't just do a simple CLI call :D

Re: AMC won't force Anime and language

Posted: 21 Nov 2014, 14:07
by shawly
Yeah I'm probably on the safer side by doing it manually. :D

But anyways, I'm looking forward to use a customized version of amc myself and fix the issue until it's officially fixed. :)

Re: AMC won't force Anime and language

Posted: 21 Nov 2014, 14:20
by rednoah
It won't be fixed, because it can't be fixed.

If I allowed you to match SxE numbered TheTVDB episode files against absolute numbered AniDB episode data in -non-strict mode, you'd quickly run into some serious issues, and in combination with --conflict override it might even make you cry. :lol:

All things considered, the current behaviour is better than the alternative.