[Rel] HTTP Anidb Metadata Agent (HAMA)

Analysis

  • FanartTv was in the readme, therefore readme might not have been followed
  • You have an episode 01 in season 01 folder which ends up logically as s01e01…
  • The movie is s01e01 which is correct but since you maped two s01e01 you don’t really know what you want and neither do i…
  • You should have pointed out the specials were for K-on!! (season 2) and not K-on! (first season)…

Do you want to follow anidb or tvdb convention ? Seeing what it wrong is useless if i cannot deduce what is right…

Anidb numbering: (3 separate entities)
K-On! The Movie [anidb-8280] / K-On! the Movie - Complete Movie.mkv
K-On! [anidb-6257] / 01 - abolished club.mkv
K-On! [anidb-7307] / Specials / K-On!! Special 1 - Planning Discussion!.mkv
K-On! [anidb-7307] / K-On!! S2 - Visiting!.mkv (bth convention works)

TVDB id: 87501
anidb to tvdb mapping: https://raw.githubusercontent.com/ScudLee/anime-lists/master/anime-list-master.xml

<anime anidbid="6257" tvdbid="87501" defaulttvdbseason="1" episodeoffset="" tmdbid="" imdbid="">
    <name>K-On!</name>
    <mapping-list>
      <mapping anidbseason="0" tvdbseason="0">;3-1;4-2;5-3;6-4;7-5;8-6;9-7;</mapping>
      <mapping anidbseason="0" tvdbseason="1">;1-13;2-14;</mapping>
    </mapping-list>
    <before>;1-13;2-14;</before>
  </anime>
  <anime anidbid="7307" tvdbid="87501" defaulttvdbseason="2" episodeoffset="" tmdbid="" imdbid="">
    <name>K-On!!</name>
    <mapping-list>
      <mapping anidbseason="0" tvdbseason="0">;3-8;4-9;5-10;6-11;7-12;8-13;9-14;10-15;11-17;12-16;</mapping>
      <mapping anidbseason="0" tvdbseason="2">;1-25;2-26;</mapping>
    </mapping-list>
    <before>;1-22;2-23;</before>
  </anime>
  <anime anidbid="8280" tvdbid="87501" defaulttvdbseason="0" episodeoffset="" tmdbid="" imdbid="tt1909796">
    <name>Eiga K-On!</name>
    <mapping-list>
      <mapping anidbseason="1" tvdbseason="0">;1-18;</mapping>
    </mapping-list>
  </anime>

tvdb convention:
K-On! The Movie [tvdb-87501-s00e18] / K-On! the Movie - Complete Movie.mkv
K-On! [tvdb-87501] / Specials / K-On!! Special 1 - Planning Discussion!.mkv
K-On! [tvdb-87501] / Specials / K-On!! S2 - Visiting!.mkv (bth convention works)
K-On! [tvdb-87501] / Season 1 / 01 - abolished club.mkv

or if you are lazy [anidb2-xxxxx] with xxxxx being the corresponding anidbid will map automatically to tvdb at right place…

Ahoy!
Sorry for delay and also for me mistake about Specials for Season 2:(
… So i read 3times your post but i dont understand you.
I didnt see any different in TVDB or Anidb convention. Only diference “for me” is in location of the folder where is anime series and movies. Is it right ? Iam using “File Bot” for Anime Naming which using data from ani.db = name is same as on ani.db

Anyway i make new folder for test in my disk G: where is now located K-ON series with specials and movies. I used your separate. But its not working for me. Look down, in attach you can find log.

K-On! The Movie [anidb-8280] / K-On! the Movie - Complete Movie.mkv
K-On! [anidb-6257] / 01 - abolished club.mkv
K-On! [anidb-7307] / Specials / K-On!! Special 1 - Planning Discussion!.mkv
K-On! [anidb-7307] / K-On!! S2 - Visiting!.mkv (bth convention works)




With TVDB convention you see One plex entry
With AniDB convention you have 3 series folder, will see 3 entries (movie, season 1, season 2) unless you use anidb2 force id mode to show it with tvdb numbering and a single entry (or just use tvdb force mode), i gave both mappings previously

i cannot find on tvdb nor mapping files the season 2 extras showing in anidb. You will therefore have no meta for this.

“K-on!” (one exclamation mark) is the first season. you named the season two specials as specials in a folder you matches to anidb (1 season ), yet you put two seasons on it, therefore tvdb convention, yet do not rename the specials with tvdb numbering… That is especially non-nonsensical after i specifically gave EVERY folder and file name to avoid that, that you chose to ignore, so since you did not label your serie folder with the specials “K-On!! [anidb-7307]” (had forgotten one exclamation mark but no impact since the anidbid is force)

Please label the folder as i gave in former port as per anidb numbering convention:
Anidb numbering: (3 separate entities in plex, three series folder)
K-On! The Movie [anidb-8280] / K-On! the Movie - Complete Movie.mkv
K-On! [anidb-6257] / 01 - abolished club.mkv
K-On! [anidb-7307] / Specials / K-On!! Special 1 - Planning Discussion!.mkv
K-On! [anidb-7307] / Specials / K-On!! Special 2 - Visiting!.mkv

Many thanks to you. Finally it’s working. Im so dumb! . I tried TVDB converse and Also AniDb both working. Thanks for the detailed explanation

Bei neusten Plex Version geht der Agent auch noch ?

I have version 1.1.4.2757 and Agent works fine.

Hi! I just installed Plex and HAMA Scanner/Agent.

The scanner seems to be working, but my Metadata doesn’t seem to be fetching for every series :confused:

I’ve noticed that this CRITICAL log is happening for every series it scans:
2016-10-18 07:08:23,697 - com.plexapp.agents.hama (1d78) : CRITICAL (core/log_exception:574) - Exception in the update function of agent named ‘HamaTV’, called with guid ‘com.plexapp.agents.hama://anidb-11074?lang=en’ (most recent call last):
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-24ffd60\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py”, line 1065, in update
agent.update(obj, media, lang, **kwargs)
File "C:\Users\Ryan Fadholi\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code_init
.py", line 936, in update
def update(self, metadata, media, lang, force ): self.Update(metadata, media, lang, force, False )
File “C:\Users\Ryan Fadholi\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code_init_.py”, line 672, in Update
elif not movie and (len(media.seasons)>2 or max(map(int, media.seasons.keys()))>1): keys = [“tvdbid: %s” % (WEB_LINK % (TVDB_SERIE_URL % tvdbid, tvdbid) )]
File “C:\Users\Ryan Fadholi\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code_init_.py”, line 705, in anidbTvdbMapping
error_log[‘anime-list anidbid missing’].append(“anidbid: %s | Title: ‘UNKNOWN’” % WEB_LINK % (ANIDB_SERIE_URL % anidbid, anidbid))
UnboundLocalError: local variable ‘anidbid’ referenced before assignment

Help? I’ve included the logs.

Agebt crash and can’t load mapping files on github
2016-10-18 07:08:22,594 - com.plexapp.agents.hama (26a4) : INFO (logkit/Info:16) - Loading local custom mapping - url: ‘anime-list-custom.xml’
2016-10-18 07:08:22,595 - com.plexapp.agents.hama (26a4) : CRITICAL (core/log_exception:574) - Exception when calling function ‘Start’ (most recent call last):
File “C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-24ffd60\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code\sandbox.py”, line 294, in call_named_function
result = f(*args, **kwargs)
File “C:\Users\Ryan Fadholi\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code_init_.py”, line 72, in Start
AniDB_TVDB_mapping_tree = HamaCommonAgent().xmlElementFromFile(ANIDB_TVDB_MAPPING, os.path.basename(ANIDB_TVDB_MAPPING), False, CACHE_1HOUR * 24 * 2)
File “C:\Users\Ryan Fadholi\AppData\Local\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code_init_.py”, line 894, in xmlElementFromFile
result = result_custom[:result_custom.rfind("")-1] + result[result.find("")+len("")+1:] #cut both fiels together removing ending and starting tags to do so
AttributeError: ‘NoneType’ object has no attribute ‘find’

A user posted something of the like there https://github.com/ZeroQI/Hama.bundle/issues/83
Please change in your source the following variables:
ANIDB_TVDB_MAPPING = ‘https://raw.githubusercontent.com/ScudLee/anime-lists/master/anime-list-master.xml
ANIDB_COLLECTION = ‘https://raw.githubusercontent.com/ScudLee/anime-lists/master/anime-movieset-list.xml

Edit: didn’t had errors when i tried but could have loaded local files since i cache everything.
Local links in code gave a 404 on first access, then tried again and worked, so unsure, and changed source now with pull request. please try and if works will apply on main code

https://github.com/ZeroQI/Hama.bundle/blob/c34154333d6539300ffbf8f75a70d85f316eb64a/Contents/Code/init.py

Hi ZeroQI, sorry I replied late.

So a few days after I asked, I tried to refresh again and it works perfectly! It downloads metadata, posters, backgrounds and everything else.

But I’ve been experiencing a few issues:

  1. Plex won’t fetch episode names for “Space Brothers”, but everything else including artworks works normally. I first think that it’s a specific issue for the show, so I ignored it.
  2. A few days ago, it just stops downloading artworks like poster and background. But things like description, episode names still works. I’ve tried to delete the local Plug-In cache, but it seems to do nothing.

I just read your reply, and I’ve changed my code locally according to the change in the commit you’ve referred to (changing ANIDB_TVDB_MAPPING and ANIDB_COLLECTION variable urls).

I’m unsure as how to replicate my problem, so I tried to create 2 new library, one using ASS/Hama and one using the default settings while keeping my original library intact.

The one using hama still won’t fetch posters for my newly added shows, but shows that is added before the problem began still received their posters.

The one using default agent won’t fetch ANY posters, but processes the Space Brother episodes correctly.

At this point I’m not sure if it’s HAMA or another thing that’s been causing all this, but my Western Movie and TV Shows libraries seems to work normally.

I’ve included my logs below; if you need any more details or want me to replicate my steps again please let me know.

Thanks for your help!

Can’t do anything with the logs provided…
It is an agent issue and therefore i need agent logs…

Whoops, the agent file was left behind. Sorry about that!

I’m having some trouble with the series To Heart 2 (2007) [anidb-4806], it seems that hama refuses to match it correctly and no matter what I do it uses the metadata for To Heart 2 [anidb-3428]. I can see this because the release data and description are from that and using the fix incorrect match from plex doesn’t help nor does adding the anidb id to the folder name.

It also matches the episodes in a really weird way:
2016-11-10 13:13:16,039 - ASS : INFO - "To Heart 2 (2007) [anidb-4806]" s0001e001 "To Heart 2 (2007) - 1 [Avalon&AQS].avi" 2016-11-10 13:13:16,041 - ASS : INFO - "To Heart 2 (2007) [anidb-4806]" s2007e001 "To Heart 2 (2007) - 2 [Avalon&AQS].avi" "4" ") - 2" 2016-11-10 13:13:16,042 - ASS : INFO - "To Heart 2 (2007) [anidb-4806]" s0001e003 "To Heart 2 (2007) - 3 [Avalon&AQS].avi"
As you can see episode 2 is season 2007 whilst episode 1&3 are season 1, which is quite weird.

I don’t know if it’s relevant but when I first added the series it was merged with To Heart 2 [anidb-3428], which I split it from and tried to correct the match with no success.

Some other things to note is that in the DataItems/AniDB folder I can find no 4806.xml file and deleting the xml file for To Heart 2 [anidb-3428] and the tvdb xml file for To Heart 2 doesn’t change any behavior. So to me it appears data is being cached somewhere and hama doesn’t hit up anidb for the correct data at any time.

Attached all the logs I thought would be relevant. Hope somebody has a clue on how to fix this.

@Kyomujin You have probably same problem as me .
Look at this page https://forums.plex.tv/discussion/77636/release-http-anidb-metadata-agent-hama/p61 and roll down.

Try to use TVDB covertion just like me.

@lekarnicka That doesn’t really help for 2 reasons

  1. I want the Anidb style of 2 shows and not the tvdb style of 1 show with multiple seasons.
  2. It still messes up the match and places episode 1&3 in season 2 and episode 2 is season 2008

From the Plex Media Scanner (custom ASS) - Anime.log
2016-11-10 14:48:15,648 - ASS : INFO - "To Heart 2 (2007) [tvdb-81768]" s0002e001 (Orig: s1e1) "To Heart 2 (2007) - 1 [Avalon&AQS].avi" 2016-11-10 14:48:15,650 - ASS : INFO - "To Heart 2 (2007) [tvdb-81768]" s2008e001 (Orig: s2007e1) "To Heart 2 (2007) - 2 [Avalon&AQS].avi" "4" ") - 2" 2016-11-10 14:48:15,651 - ASS : INFO - "To Heart 2 (2007) [tvdb-81768]" s0002e003 (Orig: s1e3) "To Heart 2 (2007) - 3 [Avalon&AQS].avi"

The agent crash with the error below so nothing can get updated
“UnboundLocalError: local variable ‘tvdbGenre’ referenced before assignment”

I had a look at the source and can not spot an easy mistake, and it reference the wrong lines in source…
https://github.com/ZeroQI/Hama.bundle/blob/master/Contents/Code/init.py

Use latest version (on pull request):
https://github.com/ZeroQI/Hama.bundle/blob/c34154333d6539300ffbf8f75a70d85f316eb64a/Contents/Code/init.py
if it doesn’t change the error in agent logs, let me know

I’m using the pull request version with the changed urls.

Showing the full critical in the log:

2016-11-10 13:28:34,238 - com.plexapp.agents.hama (80b03a400) : CRITICAL (agentkit/_update:1067) - Exception in the update function of agent named 'HamaTV', called with guid 'com.plexapp.agents.hama://anidb-11890?lang=en' (most recent call last): File "/usr/local/share/plexmediaserver/Resources/Plug-ins-24ffd60/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1065, in _update agent.update(obj, media, lang, **kwargs) File "/usr/local/plexdata/Plex Media Server/Plug-ins/Hama.bundle/Contents/Code/__init__.py", line 936, in update def update(self, metadata, media, lang, force ): self.Update(metadata, media, lang, force, False ) File "/usr/local/plexdata/Plex Media Server/Plug-ins/Hama.bundle/Contents/Code/__init__.py", line 672, in Update elif not movie and (len(media.seasons)>2 or max(map(int, media.seasons.keys()))>1): keys = ["tvdbid: %s" % (WEB_LINK % (TVDB_SERIE_URL % tvdbid, tvdbid) )] UnboundLocalError: local variable 'tvdbGenre' referenced before assignment

You can see that it claims this happens when calling with guid: com.plexapp.agents.hama://anidb-11890 and anidb-11890 is Shinmai Maou no Testament Burst (2016). I don’t know why that one fails, but looking at the anidb page is only has the ecchi and the comdy tags and it isn’t linked to any tvdb ids in the master list so I would expect it to never call the line where tvdbGenre is defined, but that doesn’t exactly tell me the error occurs

Anyway this doesn’t appear to be relevant to my problem, as I tried removing all the Shinamai Maou entries from plex and let it rerun and I can now get a hama log with no critical alerts and it still doesn’t correctly identify To Heart 2 (2007)

At line 135 in this new hama log you can see that it starts to refer to the series as ‘To Heart 2’ and there is still no DataItems/AniDB/4806.xml file in plex, indicating to me that it hasn’t bothered looking up fresh data.

I think these section I found using grep are interesting. First is a working lookup I just performed by adding Uchuu Kyoudai: Number Zero. I found it by doing a grep for the anidb id.

2016-11-10 16:18:24,613 - com.plexapp.agents.hama (80b04dc00) : INFO (__init__/Search:145) - AniDB - score: ' 99', id: ' 10320', title: 'uchuu kyoudai number zero' 2016-11-10 16:18:25,417 - com.plexapp.agents.hama (80b44cc00) : DEBUG (model/__getitem__:32) - Loading model with GUID com.plexapp.agents.hama://anidb-10320?lang=en 2016-11-10 16:18:25,427 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/Update:672) - metadata source: 'anidb', id: '10320', Title: 'None', lang: 'en', (True) 2016-11-10 16:18:25,463 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/anidbTvdbMapping:698) - anidb: '10320', tvbdid: '256705', tmdbid: '', imbdid: 'tt3407024', studio: '', defaulttvdbseason: '0', name: 'Uchuu Kyoudai: Number Zero' 2016-11-10 16:18:26,001 - com.plexapp.agents.hama (80864e800) : INFO (__init__/Search:145) - AniDB - score: ' 50', id: ' 10320', title: 'Uchuu Kyoudai' 2016-11-10 16:18:36,879 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/Update:417) - AniDB mode - AniDB Serie XML: http://api.anidb.net:9001/httpapi?request=anime&client=hama&clientver=1&protover=1&aid=10320, AniDB/10320.xml 2016-11-10 16:18:36,879 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/xmlElementFromFile:878) - url: 'http://api.anidb.net:9001/httpapi?request=anime&client=hama&clientver=1&protover=1&aid=10320', filename: 'AniDB/10320.xml' 2016-11-10 16:18:40,883 - com.plexapp.agents.hama (80b44cc00) : DEBUG (networking/load:166) - Requesting 'http://api.anidb.net:9001/httpapi?request=anime&client=hama&clientver=1&protover=1&aid=10320' 2016-11-10 16:18:41,270 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/anidbCollectionMapping:719) - anidbid '10320' is part of movie collection: Uchuu Kyoudai Collection', related_anime_list: '['8865']', 2016-11-10 16:18:42,954 - com.plexapp.agents.hama (8086fb400) : INFO (__init__/anidbCollectionMapping:719) - anidbid '8865' is part of movie collection: Uchuu Kyoudai Collection', related_anime_list: '['9032', '9754', '10320']',

Compare this with the same data for To Heart 2 (2007):

2016-11-10 16:00:22,199 - com.plexapp.agents.hama (80864e800) : INFO (__init__/Search:142) - Title: 'To Heart 2 (2007) [anidb-4806]', name: ') - 2', filename: '%2Fmnt%2Fmedia%2Fanime%2FTo%20Heart%2FTo%20Heart%202%20(2007)%20[anidb-4806]%2FTo%20Heart%202%20(2007)%20-%202%20[Avalon%26AQS]%2Eavi', manual:'False' 2016-11-10 16:00:22,231 - com.plexapp.agents.hama (80864e800) : INFO (__init__/Search:145) - source: 'anidb', id: '4806', show from id: 'To Heart 2 (2007)' provided in foldername: 'To Heart 2 (2007) [anidb-4806]' 2016-11-10 16:00:23,597 - com.plexapp.agents.hama (80b44cc00) : DEBUG (model/__getitem__:32) - Loading model with GUID com.plexapp.agents.hama://anidb-4806?lang=en 2016-11-10 16:00:23,859 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/Update:672) - metadata source: 'anidb', id: '4806', Title: 'To Heart 2', lang: 'en', (True) 2016-11-10 16:00:25,720 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/anidbTvdbMapping:698) - anidb: '4806', tvbdid: '81768', tmdbid: '', imbdid: '', studio: '', defaulttvdbseason: '2', name: 'To Heart 2 (2007)' 2016-11-10 16:00:26,667 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/Update:672) - File: 's1e1' '/mnt/media/anime/To Heart/To Heart 2 (2007) [anidb-4806]/To Heart 2 (2007) - 1 [Avalon&AQS].avi' 2016-11-10 16:00:26,668 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/Update:672) - File: 's1e3' '/mnt/media/anime/To Heart/To Heart 2 (2007) [anidb-4806]/To Heart 2 (2007) - 3 [Avalon&AQS].avi' 2016-11-10 16:00:26,668 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/Update:672) - File: 's2007e1' '/mnt/media/anime/To Heart/To Heart 2 (2007) [anidb-4806]/To Heart 2 (2007) - 2 [Avalon&AQS].avi' 2016-11-10 16:04:38,249 - com.plexapp.agents.hama (8086fb400) : DEBUG (model/__getitem__:32) - Loading model with GUID com.plexapp.agents.hama://anidb-4806?lang=en 2016-11-10 16:04:38,258 - com.plexapp.agents.hama (8086fb400) : INFO (__init__/Update:672) - metadata source: 'anidb', id: '4806', Title: 'To Heart 2', lang: 'en', (True) 2016-11-10 16:04:38,274 - com.plexapp.agents.hama (8086fb400) : INFO (__init__/anidbTvdbMapping:698) - anidb: '4806', tvbdid: '81768', tmdbid: '', imbdid: '', studio: '', defaulttvdbseason: '2', name: 'To Heart 2 (2007)' 2016-11-10 16:04:38,451 - com.plexapp.agents.hama (8086fb400) : INFO (__init__/Update:672) - File: 's1e1' '/mnt/media/anime/To Heart/To Heart 2 (2007) [anidb-4806]/To Heart 2 (2007) - 1 [Avalon&AQS].avi' 2016-11-10 16:04:38,452 - com.plexapp.agents.hama (8086fb400) : INFO (__init__/Update:672) - File: 's1e3' '/mnt/media/anime/To Heart/To Heart 2 (2007) [anidb-4806]/To Heart 2 (2007) - 3 [Avalon&AQS].avi' 2016-11-10 16:04:38,452 - com.plexapp.agents.hama (8086fb400) : INFO (__init__/Update:672) - File: 's2007e1' '/mnt/media/anime/To Heart/To Heart 2 (2007) [anidb-4806]/To Heart 2 (2007) - 2 [Avalon&AQS].avi'

One possibly noteworthy thing is these 2 lines
2016-11-10 16:18:25,427 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/Update:672) - metadata source: 'anidb', id: '10320', Title: 'None', lang: 'en', (True) 2016-11-10 16:00:23,859 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/Update:672) - metadata source: 'anidb', id: '4806', Title: 'To Heart 2', lang: 'en', (True)'
Which shows a difference, which might, but probably not be relevant. But more noteworthy is that the Uchuu kyoudai gets:
Update:417) - AniDB mode - AniDB Serie XML:
Which never happens with To Heart for some reason instead it gets spammed with these:
2016-11-10 16:00:26,667 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/Update:672) - File: 's1e1' '/mnt/media/anime/To Heart/To Heart 2 (2007) [anidb-4806]/To Heart 2 (2007) - 1 [Avalon&AQS].avi' 2016-11-10 16:00:26,668 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/Update:672) - File: 's1e3' '/mnt/media/anime/To Heart/To Heart 2 (2007) [anidb-4806]/To Heart 2 (2007) - 3 [Avalon&AQS].avi' 2016-11-10 16:00:26,668 - com.plexapp.agents.hama (80b44cc00) : INFO (__init__/Update:672) - File: 's2007e1' '/mnt/media/anime/To Heart/To Heart 2 (2007) [anidb-4806]/To Heart 2 (2007) - 2 [Avalon&AQS].avi'

Okay applying a bunch of vodoo and an update of plex media server to the latest available on freebsd I’ve managed to get it working.

Now the messed up steps I took was to do a big search through the entire ‘plexhome/MetaData/TV Shows’ directory finding all info.xml files that mention ‘To Heart 2’ and deleting all those entries. This means I’ve removed all the cached/serialized data for To Heart and I also changed the episode numbering to use 0 padding. Cleansing the stored data from plex and the padded numbers made HAMA and the Absolute Series Scanner discover the files correctly and download the correct metadata.

So the messed up metadata might simply be an exceptional situation, which is hard or not even possible to fix, but the faulty season data remains. Using the following file names with padded episode numbers resulted in correct seasons.

s0001e001 "To Heart 2 (2007) - 01 [Avalon&AQS].avi" s0001e002 "To Heart 2 (2007) - 02 [Avalon&AQS].avi" s0001e003 "To Heart 2 (2007) - 03 [Avalon&AQS].avi" but the following unpadded have the wrong season on episode 2 s0001e001 "To Heart 2 (2007) - 1 [Avalon&AQS].avi" s2007e001 "To Heart 2 (2007) - 2 [Avalon&AQS].avi" "4" ") - 2" s0001e003 "To Heart 2 (2007) - 3 [Avalon&AQS].avi"

So for the time being I can workaround the season error by just setting my renamer program to use padded episode numbers.

does the hama agent logs still show a crash ?

No crashes in the hama agent log since I removed Shinmai Maou no Testament Burst (2016) from processed series. Going to see if HAMA is still allergic too that series.