ZeroQI / Hama.bundle

Plex HTTP Anidb Metadata Agent (HAMA)
GNU General Public License v3.0
1.21k stars 113 forks source link

Movie metadata is not being downloaded properly #157

Closed hthuong09 closed 6 years ago

hthuong09 commented 6 years ago

It's seem that some movie being matched correctly but meta data is not downloaded properly. For example, I have this movie, screenshot at 2018-01-07 23 43 24 On my disk, there is no anidb id in both folder and file.

My Movies, screenshot at 2018-01-07 23 46 58

Here is the, they contains some from TV series too, so you should read from bottom. [com.plexapp.agents.hama.log]

If you need any other log files. Please let me know.

I'm using Beta-Agent commit ce6859f

ZeroQI commented 6 years ago

Prefs[thumbs ] = TheTVDB That is the default setting in DefaultPrefs.json try instead (you will have to go to agent options) { "id": "thumbs", "label": "--E- 'thumbs'", "type": "text", "default": "TheTVDB, TheMovieDb, MyAnimeList, OMDb, FanartTV, AniDB" },

it crashes also due to common.py line 48. need to make it movie library friendly Note for me:

if movie:  dir = os.path.dirname( media.items[0].parts[0] )    
else:
    for s in media.seasons:  
+add movie variable to function call
hthuong09 commented 6 years ago

screenshot at 2018-01-08 06 30 26 Like this? Still not work.

New log file. [com.plexapp.agents.hama.log]

ZeroQI commented 6 years ago

I actually had resolved that already, just not published on beta branch. Please try the new release i did now and reply back

hthuong09 commented 6 years ago

Plugin crashed because of indent.

  File "/usr/lib/plexmediaserver/Resources/Plug-ins-f54242b6b/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/RestrictedPython/RCompile.py", line 68, in compile
    tree = self._get_tree()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-f54242b6b/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/RestrictedPython/RCompile.py", line 59, in _get_tree
    tree = self.parse()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-f54242b6b/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/RestrictedPython/RCompile.py", line 56, in parse
    return niceParse(self.source, self.filename, self.mode)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-f54242b6b/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/RestrictedPython/RCompile.py", line 38, in niceParse
    compile(source, filename, mode)
  File "/config/Library/Application Support/Plex Media Server/Plug-ins/Hama.bundle/Contents/Code/common.py", line 55
    try:
       ^
IndentationError: unindent does not match any outer indentation level

I tried to fix the error by remove all white space before try and re-create Library again, still the same, here is log file [com.plexapp.agents.hama.log]

ZeroQI commented 6 years ago

only one space was before the try AttributeError: 'module' object has no attribute 'foldername' os.path.foldername doesn't exist, yeah it's "os.path.dirname" uploaded new version, couldn't test from work so hope there's no other errors

hthuong09 commented 6 years ago

It crashed again. It's okay, you can do it when you have free time. Thanks.

And here is the new log file: [com.plexapp.agents.hama.log]

ZeroQI commented 6 years ago

Sorry some conversion of the code when editing online messed that up. Hopefully should be the last fix

hthuong09 commented 6 years ago

Well, some are working now, and some are not :(. It still crash somehow.

[com.plexapp.agents.hama.log]

hthuong09 commented 6 years ago

Just wonder why Hama doesn't support display movie year?

screenshot at 2018-01-10 22 24 15

ZeroQI commented 6 years ago

Thanks for the prompt update, i managed to fix quite few issues thanks to you... It should have the year, It used to. it may crash before getting it though? "Coquelicot-zaka kara" and "Ged Senki: Tales from Earthsea" crashed in FanartTv due to movies so that should be fixed now. update to latest and send a log for Accel World movie and will fix if still present

hthuong09 commented 6 years ago

Yes, It worked really well this time. But still doesn't have year in movie list, even though there is date is meta data.

Edit: Kyoukai no Kanata above was crawled using The Movie DB / Plex Movie. Which is why it has year.

screenshot at 2018-01-11 00 09 13 screenshot at 2018-01-11 00 09 29

com.plexapp.agents.hama.log

hthuong09 commented 6 years ago

One more thing, some times when I do "Scan Library Files", and when new series found, meta data was loaded correctly, but no series poster. For example, this log, there is actors, description, but no posters, no sure if this is Plex or Hama problem since I saw it crawl poster URL successfully. It work when I force refresh meta data again.

[com.plexapp.agents.hama.log]

P/S: One more thing is wrong with this log, Episode name being named using release date.

ZeroQI commented 6 years ago

So remaining issues:

Prefs[year ] = AniDB Well that explains, it is the Default setting... Will have to amend that. However year not listed in the output despite being in movies libraries... Anidb doesn't add it [#] year Type: NoneType Source: 'AniDB', Field present in this sources: '[]' "Kyoukai no Kanata" not in logs...

last log for "Violet Evergarden" [5] posters ( 1) Type: dict Source: AniDB Value: '{'http://img7.anidb.net/pics/anime/203878.jpg': ('AniDB/poster/203878.jpg', 99, 'http://img7.anidb.net/pics/anime/thumbs/150/203878.jpg-thumb.jpg')}' look ok to me, both URL works, possibly Plex issue downloader slow in background

can't see title field listed for eps, need to investigate, should be showing with [#] in logs some logs lines seem to be missing from hama logs and it might be because of the logs redirection... You should have a copy of the update and scan logs separately in agent data folders per series....

hthuong09 commented 6 years ago

Prefs[year ] = AniDB Well that explains, it is the Default setting... Will have to amend that. However year not listed in the output despite being in movies libraries... Anidb doesn't add it

Tried to change option to TheMovieDb but still no info about year. Can we just use original available date for year?

can't see title field listed for eps, need to investigate, should be showing with [#] in logs some logs lines seem to be missing from hama logs and it might be because of the logs redirection... You should have a copy of the update and scan logs separately in agent data folders per series....

Where can I find those logs?

ZeroQI commented 6 years ago

Made a mistake, thumbs are for episodes screenshots. Experienced the poster missing issue but seem a Plex issue to me since code ran is the same for refreshes and was ok after refresh but seen 30 min delay for posters at times...

Published new code Added 'year' field for Movie Libraries in AniDB Removed report of missing tvdbid for movie libraries

ZeroQI commented 6 years ago

corrected huge bug causing fields not updated if first meta source didn't have it Also prevented crashes in movies library and movie specific log files even if in root folder Please try again with latestbeta code

hthuong09 commented 6 years ago

Got it. I will try it after I got home. Thanks.

hthuong09 commented 6 years ago

Year is still not displaying on web browser, though it displays on mobile app.

ZeroQI commented 6 years ago

If it displays through mobile app, there is a Plex issue displaying it through the web... Works for me on synology NAS displaying though the Plex web page since i corrected it

Do you still have posters not downloading for movie libraries issue?

hthuong09 commented 6 years ago

Do you still have posters not downloading for movie libraries issue?

No that's solved now. Thank you.

hthuong09 commented 6 years ago

Okay, so today I rename some movies file using filebot. And then it include year in the name.

├── Detective Conan Captured in Her Eyes (2000).mp4
├── Detective Conan Countdown to Heaven (2001).mp4
├── Detective Conan Crossroad in the Ancient Capital (2003).mkv
├── Detective Conan Full Score of Fear (2008).mp4
├── Detective Conan Jolly Roger in the Deep Azure (2007).mp4
├── Detective Conan Magician of the Silver Key (2004).mp4
├── Detective Conan Private Eye in the Distant Sea (2013).mkv
├── Detective Conan Quarter of Silence (2011).mp4
├── Detective Conan Skyscraper on a Timer (1997).mp4
├── Detective Conan Strategy Above the Depths (2005).mp4
├── Detective Conan Sunflowers of Inferno (2015).mkv
├── Detective Conan The Dimensional Sniper (2014).mkv
├── Detective Conan The Eleventh Striker (2012).mkv
├── Detective Conan The Fourteenth Target (1998).mp4
├── Detective Conan The Last Wizard of the Century (1999).mp4
├── Detective Conan The Lost Ship in the Sky (2010).mp4
├── Detective Conan The Phantom of Baker Street (2002).mp4
├── Detective Conan The Private Eyes' Requiem (2006).mp4
└── Detective Conan The Raven Chaser (2009).mkv

At first, when I add new Library after file scan complete. There is year appear, but after metadata refresh successfully. Year is gone. And the log: [com.plexapp.agents.hama.log]

mikethecalamity commented 6 years ago

I'm seeing that adding a new series requires a manual "Refresh Metadata" to get the posters. This is with the latest beta release. (Also, "Refresh All Metadata" on the specific library is not enough, each series needs to be done individually). Not sure if this is related.

ZeroQI commented 6 years ago

@hthuong09 so we need to keep the year if no present in metadata source, in search function it is media.year but i do not know if it persists in update function. If using beta, the series full log is in agent data folder. pleast attach that. The logs attach miss all field replacement matrix and summary at the end

@mweber03 This thread is a bug report on Movie library metadata when you have a Series library so possibly not the same issue. That is odd, but if the agent ca do it in the end, might be a plex issue. Would need to see what happens when the serie is first added, then what happends on refresh. With beta, the logs should be per series in agent data folders

ZeroQI commented 6 years ago
Plex.UpdateMeta() - Metadata Fields (items #), type, source provider, value, 
[=] original_title                 Type: str                   Source: AniDB        Value: 'Accel World: Infinite Burst'
[=] title                          Type: str                   Source: AniDB        Value: 'Accel World: Infinite Burst'
[=] roles                    (19)  Type: list                  Source: AniDB        Value: '[{'photo': 'http://img7.anidb.net/pics/anime/23287.jpg', 'role': 'Kuroyuki-hime', 'name': 'Misawa Sachika'}, {'photo': 'http://img7.anidb.net/pics/anime/80605.jpg', 'role': 'Mayuzumi Takumu', 'name': 'Asanuma Shintarou'}, {'photo': 'http://img7.anidb.net/pics/anime/69192.jpg', 'role': 'Kurashima Chiyuri', 'name': 'Toyosaki Aki'}, {'photo': 'http://img7.anidb.net/pics/anime/68277.jpg', 'role': 'Arita Haruyuki', 'name': 'Kaji Yuuki'}, {'photo': 'http://img7.anidb.net/pics/anime/17006.jpg', 'role': 'Ash Roller', 'name': 'Suzumura Ken`ichi'}, {'photo': 'http://img7.anidb.net/pics/anime/23287.jpg', 'role': 'Kuroyuki-hime', 'name': 'Misawa Sachika'}, {'photo': 'http://img7.anidb.net/pics/anime/68277.jpg', 'role': 'Arita Haruyuki', 'name': 'Kaji Yuuki'}, {'photo': 'http://img7.anidb.net/pics/anime/69192.jpg', 'role': 'Kurashima Chiyuri', 'name': 'Toyosaki Aki'}, {'photo': 'http://img7.anidb.net/pics/anime/129542.jpg', 'role': 'Kouzuki Yuniko', 'name': 'Hidaka Rina'}, {'photo': 'http://img7.anidb.net/pics/anime/71057.jpg', 'role': 'Himi Akira', 'name': 'Ueda Kana'}, {'photo': 'http://img7.anidb.net/pics/anime/17044.jpg', 'role': 'Blue Knight', 'name': 'Sakurai Takahiro'}, {'photo': 'http://img7.anidb.net/pics/anime/166173.jpg', 'role': 'Green Grandee', 'name': 'Kuroda Takaya'}, {'photo': 'http://img7.anidb.net/pics/anime/130580.jpg', 'role': 'Yellow Radio', 'name': 'Ishida Akira'}, {'photo': 'http://img7.anidb.net/pics/anime/184301.jpg', 'role': 'Kakei Mihaya', 'name': 'Kawasumi Ayako'}, {'photo': 'http://img7.anidb.net/pics/anime/17988.jpg', 'role': 'Purple Thorn', 'name': 'Mizuhashi Kaori'}, {'photo': 'http://img7.anidb.net/pics/anime/17294.jpg', 'role': 'Kurasaki Fuuko', 'name': 'Endou Aya'}, {'photo': 'http://img7.anidb.net/pics/anime/85663.jpg', 'role': 'Shinomiya Utai', 'name': 'Hara Yumi'}, {'photo': 'http://img7.anidb.net/pics/anime/38901.jpg', 'role': 'Kusakabe Rin', 'name': 'Nanri Yuuka'}, {'photo': 'http://img7.anidb.net/pics/anime/85893.jpg', 'role': 'Tsukiori Risa', 'name': 'Akasaki Chinatsu'}]'
[=] year                           Type: int                   Source: AniDB        Value: '2016'
[=] originally_available_at        Type: date                  Source: AniDB        Value: '2016-07-23'
[=] studio                         Type: str                   Source: AniDB        Value: 'Sunrise'
[=] summary                        Type: str                   Source: AniDB        Value: '* Based on a light novel series by Kawahara Reki, with illustrations by Hima. In..'
[=] content_rating                 Type: str                   Source: TheTVDB      Value: 'TV-14'

Year only exist for movie libraries and work for me when set to AniDB

Your log: [#] year Type: NoneType Source: 'TheMovieDb, TheTVDB', Field present in this sources: '['AniDB']'

TheMovieDb is not providing anything since not in scudlee's mapping file.

I only update fields if required therefore the year is removed by the time update function is called. maybe if i could get it from the tvdb year episode release date BUT anidb gets it reliably so no need for now though AniDB neet to be first in the year field setting...