[Release] HTTP Anidb Metadata Agent (HAMA)

Hi, after emails between Atomicstrawberry and me, i am taking over HAMA, so i started a new thread here:

http://forums.plexapp.com/index.php/topic/77636-release-http-anidb-metadata-agent-hama/

it is on git, i am stil polishing things but will but a zip link on the first post when ready(within a week hopefully)

This works really well, thanks for the plugin!

I have a problem with titles that have been corrected.

For example I have a folder called "Hunter X Hunter" that I have fixed the incorrect match to match it to "Hunter X Hunter (2011)" which is fine.

The problem occurs when I add a new episode to the folder.

Although it shows the new episode as "Hunter X Hunter (2011)" it is under a different listing where it is using the poster of the original 2009 series and has matched the metadata against the 2009 show.

So everytime a new episode is added I have to fix the incorrect match to the 2011 show.

I've tried a whole heap of things to try and match it t the show automatically but nothing has worked so far.

Changing the folder name to include (2011) still matches it to the 2009 show first.

Is there any way to make additional episodes remain matched to the same show the other episodes are using?

Hi, Bunta. Thanks for your feedback. Are you using hama 0.4 or the new HAMA that you can download at http://forums.plexapp.com/index.php/topic/77636-release-http-anidb-metadata-agent-hama/ ?

I would unmatch the serie to rematch it, this way the unique ID plex uses will match the anidb serie id. are you sure you do not have grouped series (ungroup if that is the case). I had issues with series with years in parenthesis, and am currently writing a new scanner (Hama Scanner) since Plex scanner insist in dropping the year without passing it to the metadata agent... i have an issue with logging within the scanner (no other scanner use it to my knowledge apart anidb specific scanner used in conjunction with a file renamer, but is direct path again), Help with scanner welcome (Knowledge of abosute and relative path within all or some plex versions, or a good knowledge of Regex welcome)

Hi ZeroQI. Yes I'm actually using the latest version from the other thread (Hama plugin bundle 2014-05-26 (fixed).zip) I probably should have posted there.

I tried unmatching the series which returned it back to the 2009 show and then did "fix incorrect match" and selected the 2011 show again.

This made no difference as new files added to the folder still appear as the 2009 show.

I've seen posts in other threads about normal TV shows where you can add the show ID in to the folder name and it will match the show from that.

ie folder name "Hunter X Hunter (8550)" will match to the 2011 show automatically.

Is that a possibility with the HAMA agent?

EDIT: Changing the folder name to "Hunter x Hunter 2011" without any parenthesis seems to work in auto matching it to the 2011 show!

Yeah, other thread would be better as I passed over maintaining this to ZeroQI and he's done a whole lot more work on it than I did now.

Anything in parentheses in folder names is ignored by Plex (or possibly just the scanners I've used) when matching. Normally people use it to put stuff like (DVD) or (Bluray) or something in. Deciding which series to associate an episode with is done by Plex based on the directory it appears in.

The thing is, once a show is matched by the Metadata agent, it should 'lock down' on that series such that new episodes appearing in the same directory. Were you putting new episodes in and then manually forcing a full refresh each time? Because that will cause it to re-match and probably get it wrong.

Are you using HAMA as the default agent for the section, or just for that one series? If using it for the whole section does everything else work correctly?

The 'lock down' of the series on the folder doesn't appear to be happening.

I'm using the HAMA agent as the default for the section where all my anime folders are located.

As a test I created a folder called "Naruto" with an episode from Naruto Shippuuden in it.

After a library update it auto matched the folder as "Naruto" so I fixed the match to "Naruto Shippuuden".

Then when adding new files to the folder they get added as "Naruto" and not the corrected name.

I'm not doing a "Force Refresh", the existing episodes stay matched to the correct name.

Does this only happen for me?

Yeah, that's something odd going on. Are you using the BABS scanner or something else?

What does your directory structure look like exactly? It sounds almost like you're getting a different series entry per file based on the filename for some reason.

Yes I'm using the BABS scanner.

The library I added as TV Shows, choose F:\Anime as folder with BABS scanner and HamaTV agent.

The F:\Anime folder just has all my shows under individual folders beneath it.

eg F:\Anime\Naruto, F:\Anime\Hunter x Hunter

Nothing unusual in that I would think.

Did you repeat the same actions on your plex to prove it doesn't do the same thing?

So that's why it's matching the wrong shows ('Naruto' will match the first Naruto series, 'Hunter x Hunter' will match the 2009 one) but doesn't explain why it's re-matching each time. Do any of your other shows do this or is it just those two? I'm wondering if maybe it's not saving the match information to disk correctly.

Those are the only two I've fixed manually.

The functionality seems to be normal and happens consistently, I'm sure if you do the same test you will see it also happens to you.

Episodes that have been "fixed" remain on the fixed show, its only new episodes that change.

I just did a new (completely random) test like so:

Create a folder called Bleach add a couple episodes to this folder (it doesn't matter what files, I added two episodes from Ninku).

Update Library and Bleach gets added to plex with two episodes from season 1.

Click fix incorrect match and change to any other anime at all (I changed mine from Bleach to High School Agent).

The two episodes that were in the folder now show as High School Agent episodes.

Add another file to the folder. (I added a third ninku episode)

The new file appears as an episode of Bleach with the two original episodes still showing as High School Agent.

New episodes added to the folder always get recognised from an automatch of the folder name and not what the show has been fixed to.

Where exactly is it supposed to be saving the match information to disk?

If it is something like that it might be related to UAC possibly.

Nope, doesn't happen to me - as I mentioned, I watch Hunter X Hunter and my folder is named exactly that, so it mismatched the first time. Works perfectly each time.

I think ZeroQI might be best equipped to look at this one further. Might need to look at the logs as well. My gut feeling is that for some reason the information about the matches isn't being persisted to disk properly for some reason and as a result it re-matches everything each time there's a change. Most stuff matches correctly first go, but those two shows don't because of the name of the folder. But I'm really speculating, would need to dig into the logs.

Here is the agent log:

http://pastebin.com/NVemgc0r

@2014-07-02 22:31:45,729 - Created a new folder called Bleach with an episode in and scanned it.

@2014-07-02 22:32:21,966 - Changed the show match to Shingeki no Kyojin

@2014-07-02 22:33:07,990 - Added another episode and updated library

I can't see anything that looks wrong in the log but maybe it will help.

Is ZeroQI still reading?

I've posted in his thread to continue looking in to this anyway.

Thanks for looking in to the issue Atomicstrawberry.

I'm seeing a *lot* of I/O errors in there, stuff not being written to disk correctly. I don't know if that's a problem or not.

Could you check PlexMediaServer\Library\Plex Media Server\Plug-in Support\Data\com.plexapp.agents.hama directory exists and if it has any content in it? You might need to create some directories in there, not sure. Plex should be doing that automatically but there could be permissions issues or something I guess?

I have to admit that the local cache stuff was causing me a few issues on my box and I didn't personally need it so I manually hacked it out of the version I'm running. I think ZeroQI was going to add an option to disable it. However this might be a complete red herring and it probably is. If the directory exists and it has a file called 'Dict' in it that is non-zero size (mine is about 6kb) the the match info is being saved correctly and that's not the source of your problem and ZeroQI will have to take over.

The Plugin data folders are not created so it crashes. See read me in my signature and create all folders manually

Didn’t do the setting to disable local caching yet but it’s in the to do list Working on scanner at the moment and look promising, regex give issues but will handle episode in root and in download folders, anidb specials numbering, years in Serie name, semicolons, etc… oh and roman numbering for Eps work already…

I Installed Hama and it shows up in my server settings under agents but i cant seem to check the box to enable it. It has a red circle with a line throughit when i hover over the check box. can someone tell me what i might have done wrong.

which Hama version? did a lot of devlopment and even a scanner since i took over from atomicstrawberry so my guess is you are using an outdated one

Usage: Just extract Hama.bundle to your Plex Media Server's plugin library and restart Plex Media Server and it should appear as a selectable agent.

OK

So, I downloaded and extracted Hama_bundle V04.

I copied the extracted folder to C:\Users\Me\Program Files\Plex\Plex Media Server\Resources\Plug Ins

I restarted the machine, and started Plex

I went to Plex.tv, Anime*, Edit, Advanced, Scanner and I still have Plex Series Scanner  as my only choice in Scanner, and TVDB and Movie Database as my only choice in Agent.

Thanks for any help!

Dom.

*Folder type is TV Shows

OK

So, I downloaded and extracted Hama_bundle V04.

I copied the extracted folder to C:\Users\Me\Program Files\Plex\Plex Media Server\Resources\Plug Ins

I restarted the machine, and started Plex

I went to Plex.tv, Anime*, Edit, Advanced, Scanner and I still have Plex Series Scanner  as my only choice in Scanner, and TVDB and Movie Database as my only choice in Agent.

Thanks for any help!

Dom.

*Folder type is TV Shows

I think you miss the restart you server part. It will not appear till you restart your server, closing first.

Thanks Eskwire

I installed Plex onto a Windows 8 Laptop. It was on this laptop that I copied the extracted Hama_Bundle into \Plex Media Server\Resources\Plug ins, and it was this laptop which I restarted. I thought restarting the laptop, upon which Plex runs, would restart Plex? Or is it more complicated than that?

I was struggling with the Neko, Bake, Nise, Mono, (etc) gatari series. But when I searched for answers on OVAs I discovered that (for example) Monogatari may not be recognised by TVdb, but it is there, as Bakemonogatari season 2.

Thanks Eskwire

Dom.

Restart Plex Server. Everything you do is on the plex server.