ZeroQI / Absolute-Series-Scanner

Seasons, absolute mode, Subfolders...
1.01k stars 155 forks source link

emby support for ASS and Hama #224

Closed DarthKnight12 closed 5 years ago

DarthKnight12 commented 5 years ago

Would it be possible to maybe add support for Emby ? thus far i havent found a suitable replacement for emby dealing with absolute numbering and anime in general

purposelycryptic commented 5 years ago

I'm not ZeroQI or one of the other devs, so you should take everything I say with a heaping of salt, but, at least from what I do know, I'm thinking it would be a fairly massive undertaking.

If it means anything, I moved from Emby to Plex last year, solely because of ASS/HAMA, after being a dedicated Emby fan/user since the early 'Media Browser 2' days. I got the lifetime Plex Pass solely because ASS/HAMA exist. I prefer almost every aspect of Emby over Plex, but Emby's rigid metadata structure is just a terrible fit for anime - I spent ages trying to fix the Anime Metadata Agent, but, even when it was at its best, it wasn't even in the same dimension as HAMA; it still required the same rigid TVDB file organization for everything, because that is just a core aspect of Emby.

I moved to Plex last February, so it is entirely possible all that has changed in the time since then, and conversion could now be easy to do, but that would be somewhat of a miracle. Then there is also the reality that maintaining ASS/HAMA is a major project as is, so creating an Emby version would likely require another group of devs.

I do feel your pain, though - I spent years upon years manually adding anime to Emby, and it was just so much manual work; I just didn't know how much easier it could be. Now, I barely have to do anything manually. Everything just works.

DarthKnight12 commented 5 years ago

@purposelycryptic thank you for the reply and I highly appreciate it ! I just set up Emby last week so I was trying to get everything migrated but if you’re saying that emby is too rigid when it comes down to how to handle metadata then I guess the easiest solution would be for me to just not use emby for anime and stick with Plex ! Thanks for that !

ZeroQI commented 5 years ago

Not possible por reasons enumerated above

purposelycryptic commented 5 years ago

@DarthKnight12 I kept thinking about this (I'm seriously ill and essentially bedbound 24/7, so I have way too much time to think ¯\_(ツ)_/¯), and, while it sounds like, in your situation, i.e., only having just tried out Emby, sticking with Plex is definitely the best option, in case someone else comes around with the same idea, who has long-term assembled their anime library around Emby, there may be a possible solution, based on the following points:

Emby's basic recommended folder structure is not inherently different from that of Plex (outside of that it doesn't really support diverging from it to anywhere near the extent that Plex does), that is to say, the same \LIBRARY\SERIES_NAME\SEASON [X]\SERIES_NAME - sXXeYY.EXT structure works for both, and both ignore anything in the Series Folder and Episode File name that is put inside square brackets (i.e., in Game of Thrones - s05e09 [I AM A ROBOT] [DEATH TO ALL HUMANS].mkv, the [I AM A ROBOT] [DEATH TO ALL HUMANS] part is ignored).

Emby allows for its Metadata Agent(s) to be completely disabled, at which point it relies entirely on the metadata stored in the library folders.

A few years ago (or longer, it feels like just a few years, but...), Emby made the move from their own XML structure and organization to that used by Kodi, in an effort to help standardize media server metadata across platforms. When I first started using Plex, I was unsure as to whether I would keep using it, or go back to Emby (which I had used for almost 10 years at that point), so I simply made a copy of everything, and converted the copy to the AniDB naming structure, but I still have the entire Emby-structured anime library - so here is an example of the folder structure (with metadata files):

Ajin (2016) [VON] [BD, 1080p]\
    backdrop.jpg
    banner.jpg
    clearart.png
    folder.jpg
    logo.png
    season-specials-banner.jpg
    season01-banner.jpg
    tvshow.nfo
    Season 0\
        Ajin OAD - s00e04 [KentutNeraka-Koby Remux] [DVD, 576p, AAC].jpg
        Ajin OAD - s00e04 [KentutNeraka-Koby Remux] [DVD, 576p, AAC].mkv
        Ajin OAD - s00e04 [KentutNeraka-Koby Remux] [DVD, 576p, AAC].nfo
        Ajin OAD - s00e05 [KentutNeraka-UrbanTbc Remux] [DVD, 576p, AAC].jpg
        Ajin OAD - s00e05 [KentutNeraka-UrbanTbc Remux] [DVD, 576p, AAC].mkv
        Ajin OAD - s00e05 [KentutNeraka-UrbanTbc Remux] [DVD, 576p, AAC].nfo
        Ajin OAD - s00e06 [UrbanTbc] [DVD, 576p, AAC] [6FD81FAA].jpg
        Ajin OAD - s00e06 [UrbanTbc] [DVD, 576p, AAC] [6FD81FAA].mkv
        Ajin OAD - s00e06 [UrbanTbc] [DVD, 576p, AAC] [6FD81FAA].nfo
        backdrop.jpg
        folder.jpg
        season.nfo
    Season 1\
        Ajin (2016) - s01e01 [VON] [BD, 1080p, FLAC].jpg
        Ajin (2016) - s01e01 [VON] [BD, 1080p, FLAC].mkv
        Ajin (2016) - s01e01 [VON] [BD, 1080p, FLAC].nfo
        Ajin (2016) - s01e02 [VON] [BD, 1080p, FLAC].jpg
        Ajin (2016) - s01e02 [VON] [BD, 1080p, FLAC].mkv
        Ajin (2016) - s01e02 [VON] [BD, 1080p, FLAC].nfo
        Ajin (2016) - s01e03 [VON] [BD, 1080p, FLAC].jpg
        Ajin (2016) - s01e03 [VON] [BD, 1080p, FLAC].mkv
        Ajin (2016) - s01e03 [VON] [BD, 1080p, FLAC].nfo
        Ajin (2016) - s01e04 [VON] [BD, 1080p, FLAC].jpg
        Ajin (2016) - s01e04 [VON] [BD, 1080p, FLAC].mkv
        Ajin (2016) - s01e04 [VON] [BD, 1080p, FLAC].nfo
        Ajin (2016) - s01e05 [VON] [BD, 1080p, FLAC].jpg
        Ajin (2016) - s01e05 [VON] [BD, 1080p, FLAC].mkv
        Ajin (2016) - s01e05 [VON] [BD, 1080p, FLAC].nfo
        Ajin (2016) - s01e06 [VON] [BD, 1080p, FLAC].jpg
        Ajin (2016) - s01e06 [VON] [BD, 1080p, FLAC].mkv
        Ajin (2016) - s01e06 [VON] [BD, 1080p, FLAC].nfo
        Ajin (2016) - s01e07 [VON] [BD, 1080p, FLAC].jpg
        Ajin (2016) - s01e07 [VON] [BD, 1080p, FLAC].mkv
        Ajin (2016) - s01e07 [VON] [BD, 1080p, FLAC].nfo
        Ajin (2016) - s01e08 [VON] [BD, 1080p, FLAC].jpg
        Ajin (2016) - s01e08 [VON] [BD, 1080p, FLAC].mkv
        Ajin (2016) - s01e08 [VON] [BD, 1080p, FLAC].nfo
        Ajin (2016) - s01e09 [VON] [BD, 1080p, FLAC].jpg
        Ajin (2016) - s01e09 [VON] [BD, 1080p, FLAC].mkv
        Ajin (2016) - s01e09 [VON] [BD, 1080p, FLAC].nfo
        Ajin (2016) - s01e10 [VON] [BD, 1080p, FLAC].jpg
        Ajin (2016) - s01e10 [VON] [BD, 1080p, FLAC].mkv
        Ajin (2016) - s01e10 [VON] [BD, 1080p, FLAC].nfo
        Ajin (2016) - s01e11 [VON] [BD, 1080p, FLAC].jpg
        Ajin (2016) - s01e11 [VON] [BD, 1080p, FLAC].mkv
        Ajin (2016) - s01e11 [VON] [BD, 1080p, FLAC].nfo
        Ajin (2016) - s01e12 [VON] [BD, 1080p, FLAC].jpg
        Ajin (2016) - s01e12 [VON] [BD, 1080p, FLAC].mkv
        Ajin (2016) - s01e12 [VON] [BD, 1080p, FLAC].nfo
        Ajin (2016) - s01e13 [VON] [BD, 1080p, FLAC].jpg
        Ajin (2016) - s01e13 [VON] [BD, 1080p, FLAC].mkv
        Ajin (2016) - s01e13 [VON] [BD, 1080p, FLAC].nfo
        backdrop.jpg
        folder.jpg
        season.nfo
    Season 2\
        Ajin 2 (2016) - s02e01 [QOQ] [www, 1080p, AC3] [F98574AE].jpg
        Ajin 2 (2016) - s02e01 [QOQ] [www, 1080p, AC3] [F98574AE].mkv
        Ajin 2 (2016) - s02e01 [QOQ] [www, 1080p, AC3] [F98574AE].nfo
        Ajin 2 (2016) - s02e02 [QOQ] [www, 1080p, AC3] [BE486F80].jpg
        Ajin 2 (2016) - s02e02 [QOQ] [www, 1080p, AC3] [BE486F80].mkv
        Ajin 2 (2016) - s02e02 [QOQ] [www, 1080p, AC3] [BE486F80].nfo
        Ajin 2 (2016) - s02e03 [QOQ] [www, 1080p, AC3] [1B63911A].jpg
        Ajin 2 (2016) - s02e03 [QOQ] [www, 1080p, AC3] [1B63911A].mkv
        Ajin 2 (2016) - s02e03 [QOQ] [www, 1080p, AC3] [1B63911A].nfo
        Ajin 2 (2016) - s02e04 [QOQ] [www, 1080p, AC3] [0C7649B0].jpg
        Ajin 2 (2016) - s02e04 [QOQ] [www, 1080p, AC3] [0C7649B0].mkv
        Ajin 2 (2016) - s02e04 [QOQ] [www, 1080p, AC3] [0C7649B0].nfo
        Ajin 2 (2016) - s02e05 [QOQ] [www, 1080p, AC3] [A9DD2AEE].jpg
        Ajin 2 (2016) - s02e05 [QOQ] [www, 1080p, AC3] [A9DD2AEE].mkv
        Ajin 2 (2016) - s02e05 [QOQ] [www, 1080p, AC3] [A9DD2AEE].nfo
        Ajin 2 (2016) - s02e06 [QOQ] [www, 1080p, AC3] [2E77EF53].jpg
        Ajin 2 (2016) - s02e06 [QOQ] [www, 1080p, AC3] [2E77EF53].mkv
        Ajin 2 (2016) - s02e06 [QOQ] [www, 1080p, AC3] [2E77EF53].nfo
        Ajin 2 (2016) - s02e07 [QOQ] [www, 1080p, AC3] [E2B17C24].jpg
        Ajin 2 (2016) - s02e07 [QOQ] [www, 1080p, AC3] [E2B17C24].mkv
        Ajin 2 (2016) - s02e07 [QOQ] [www, 1080p, AC3] [E2B17C24].nfo
        Ajin 2 (2016) - s02e08 [QOQ] [www, 1080p, AC3] [009799DF].jpg
        Ajin 2 (2016) - s02e08 [QOQ] [www, 1080p, AC3] [009799DF].mkv
        Ajin 2 (2016) - s02e08 [QOQ] [www, 1080p, AC3] [009799DF].nfo
        Ajin 2 (2016) - s02e09 [QOQ] [www, 1080p, AC3] [821D3D5D].jpg
        Ajin 2 (2016) - s02e09 [QOQ] [www, 1080p, AC3] [821D3D5D].mkv
        Ajin 2 (2016) - s02e09 [QOQ] [www, 1080p, AC3] [821D3D5D].nfo
        Ajin 2 (2016) - s02e10 [QOQ] [www, 1080p, AC3] [3767B9EC].jpg
        Ajin 2 (2016) - s02e10 [QOQ] [www, 1080p, AC3] [3767B9EC].mkv
        Ajin 2 (2016) - s02e10 [QOQ] [www, 1080p, AC3] [3767B9EC].nfo
        Ajin 2 (2016) - s02e11 [QOQ] [www, 1080p, AC3] [8CCDE5BE].jpg
        Ajin 2 (2016) - s02e11 [QOQ] [www, 1080p, AC3] [8CCDE5BE].mkv
        Ajin 2 (2016) - s02e11 [QOQ] [www, 1080p, AC3] [8CCDE5BE].nfo
        Ajin 2 (2016) - s02e12 [QOQ] [www, 1080p, AC3] [88B3F9C9].jpg
        Ajin 2 (2016) - s02e12 [QOQ] [www, 1080p, AC3] [88B3F9C9].mkv
        Ajin 2 (2016) - s02e12 [QOQ] [www, 1080p, AC3] [88B3F9C9].nfo
        Ajin 2 (2016) - s02e13 [QOQ] [www, 1080p, AC3] [F47E4A13].jpg
        Ajin 2 (2016) - s02e13 [QOQ] [www, 1080p, AC3] [F47E4A13].mkv
        Ajin 2 (2016) - s02e13 [QOQ] [www, 1080p, AC3] [F47E4A13].nfo
        backdrop.jpg
        folder.jpg
        season.nfo

I took a look at the series metadata files (Emby, HAMA), and while they don't match up one-to-one, it's been 1 1/2 years since I made the move to Plex, and my Emby series metadata file was last updated 10/20/2017, so it's very possible things have changed since then - Emby is (or at least, was) pretty flexible about metadata encoding, since they had to support both their own and Kodi's, so a plug-in could potentially allow them to be read, even if the XML schema used are slightly different.

If you're still reading, you might be wondering what exactly I'm getting at - well, the wonderful @ZeroQI, creator of HAMA, also created Lambda, which allows for Plex metadata to export into media folders, much as Emby does - so, theoretically, by disabling Emby's metadata agents, running Plex (set to periodic metadata refresh) with HAMA (with tvdb guid) and Lambda, and both server programs aimed at the same media folders for their library, it should, potentially, be possible for Emby to take advantage of HAMA's superior metadata, albeit in a very circuitous way that involves running Plex solely for its metadata. A little overly complicated, and there is a chance you might need to write your own Emby plugin so it can properly read the metadata, but the possibility exists.

That said, I must admit, I've sadly never actually managed to get Lambda to do anything, but I'm also pretty sure that I am just missing something, as I can't even select Lambda as an Agent alongside HAMA, which would seem to make it hard for it to run on metadata refresh - not quite sure what I did wrong, but if it's something stupid, I'll be seriously embarrassed: nolambda

ZeroQI commented 5 years ago

Look like a right issue or the Lambda.bundle folder is mongly named (-master at the end?). plex logs should show if Lambda is attempted to be lauched

purposelycryptic commented 5 years ago

I probably should have added more information, but I was excited and feeling clever about the idea of potentially using HAMA with Emby without any extra effort required, so I ended up just leaving that hanging at the end without much detail.

I'm pretty sure Lambda used to show in the secondary agent options for HAMA for me, way back when you first released it, but back then, I couldn't get it to export anything. I just updated it a few days ago, and it shows up for most agents, and I just tested it and it works properly with the TVDB-Agent/Plex-Scanner combination. That's the only one I've tested so far, as I discovered, frustratingly, that either that agent or scanner (likely the latter) refuse to accept dummy media files, but I'm guessing all the other ones it shows for will work similarly well. I tested after writing, and haven't had a chance to edit yet.

Having had a few minutes to think while typing, the culprit is probably my older HAMA version not playing well with/being recognized by the newer Lambda version; I'll test that hypothesis in a bit, but first I desperately need lunch, as it's past 5PM here already.

ZeroQI commented 5 years ago

ASS accepts dummy media files while Plex default scanner does not. Possible Lambda doesn't play nice wifi Hama but should be easy to modify

purposelycryptic commented 5 years ago

I don't think I've ever not used ASS since I began using Plex (except for rare tests), so I had no idea:)

I was going to upgrade HAMA this afternoon/evening since I'm thinking that is likely the cause, but ended up doing several hours of over-the-phone family tech support instead, which left me completely burnt-out, so I'll try tomorrow (nothing like trying to figure out a network issue when the person on the other end doesn't know what a router, network cable or browser is... I love my family, but sometimes...)

purposelycryptic commented 5 years ago

@ZeroQI - OK, it wasn't because my version of HAMA was old, but you were right, it was still an easy fix: I simply added 'com.plexapp.agents.hama' to the contributes_to list for the LambdaTV and LambdaMovie class definition.

I had added 'com.plexapp.agents.lambda' to the accepts_from list for the HamaTVAgent and HamaMovieAgent class definition first, which did nothing by itself, but as I didn't undo those additions before editing the Lambda class definitions, I can't say for certain whether or not it is unnecessary. Just tested by reverting HAMA to my old version, and Lambda still works with it. So only the changes on the Lambda side were necessary.