ZeroQI / Hama.bundle

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

File w/ Movie: True Generating Error while Merging TVDB Metadata #202

Closed mdcx closed 6 years ago

mdcx commented 6 years ago

This seems to be occuring on any movie that is being attached to a TVDB ID for cross pollonation of metadata. The HamaMovie agent doesn't generate any errors when doing an update on a file that doesn't also have an associated TV series.

It's not unique to this file, but several (gintama movies, one piece movies, etc., etc.,)

E:\Media\Anime\Sorted\Movies\Ghost.in.the.Shell.1995.JPN.BluRay.Remux.1080p.AVC.FLAC.2.0-HiFi.mkv
E:\Media\Anime\Sorted\Movies\[zang] Gekijouban Gintama - Shinyaku Benizakura-hen [BD 1080p OPUS] [AAE32A79].mkv
18-05-14 13:28:26,456 (3b6c) :  INFO (logkit:16) - === Update ==================================================================================================================================================
2018-05-14 13:28:26,456 (3b6c) :  INFO (logkit:16) - id: anidb-6122, title: Ghost in the Shell (2008), lang: en, force: True, movie: True
2018-05-14 13:28:26,456 (3b6c) :  INFO (logkit:16) - -------------------------------------------------------------------------------------------------------------------------------------------------------------
2018-05-14 13:28:26,463 (3b6c) :  INFO (logkit:16) - AnimeLists.GetMetadata() - AniDBid: 6122, TVDBid: 73749, defaulttvdbseason: 0, episodeoffset: 0, name: Ghost in the Shell (2008)
2018-05-14 13:28:26,476 (3b6c) :  INFO (logkit:16) - anidbTvdbMapping() - mappingList: {'imdbid': 'tt1260502', 'defaulttvdbseason': '0', 'name': 'Ghost in the Shell (2008)', 'episodeoffset': '0'}
2018-05-14 13:28:26,476 (3b6c) :  INFO (logkit:16) - -------------------------------------------------------------------------------------------------------------------------------------------------------------
2018-05-14 13:28:26,476 (3b6c) :  INFO (logkit:16) - AniDB.GetMetadata() - AniDBid: 6122, AniDBids list: ['6122'], AniDBids present on disk: ['6122']
2018-05-14 13:28:26,477 (3b6c) :  DEBUG (logkit:13) - common.LoadFile() - CacheTime: 'Thu May  3 01:53:34 2018', Limit: 'Sun May 20 13:28:26 2018', url: 'http://api.anidb.net:9001/httpapi?request=anime&client=hama&clientver=1&protover=1&aid=6122', Filename: 'AniDB\xml\6122.xml' needs reloading..
2018-05-14 13:28:26,494 (3b6c) :  DEBUG (networking:166) - Requesting 'http://api.anidb.net:9001/httpapi?request=anime&client=hama&clientver=1&protover=1&aid=6122'
2018-05-14 13:28:26,947 (3b6c) :  DEBUG (logkit:13) - common.SaveFile() - CachePath: 'E:\Media\Plex\Plex Media Server\Plug-in Support\Data\com.plexapp.agents.hama\DataItems', file: 'AniDB\xml\6122.xml', directory present
2018-05-14 13:28:26,953 (3b6c) :  INFO (logkit:16) - AniDBid: 6122, url: http://api.anidb.net:9001/httpapi?request=anime&client=hama&clientver=1&protover=1&aid=6122----------------------------------------------
2018-05-14 13:28:26,953 (3b6c) :  INFO (logkit:16) - 'title': Ghost in the Shell (2008), 'title_sort': Ghost in the Shell (2008), original_title: Ghost in the Shell (2008)
2018-05-14 13:28:26,953 (3b6c) :  INFO (logkit:16) - 'originally_available_at': '2008-07-12'
2018-05-14 13:28:26,953 (3b6c) :  INFO (logkit:16) - 'summary' empty: 'False'
2018-05-14 13:28:26,954 (3b6c) :  INFO (logkit:16) - 'rating': '8.30'
2018-05-14 13:28:26,987 (3b6c) :  INFO (logkit:16) - 'genre' (15/52 above 400 weight): ['Detective', 'Cyborg', 'Future', 'Earth', 'Human enhancement', 'Japan', 'Violence', 'Asia', 'Virtual world', 'Action', 'Science fiction', 'Cyberpunk', 'Law and order', 'Cops', 'Special squads']
2018-05-14 13:28:26,989 (3b6c) :  INFO (logkit:16) - 'collection' AniDBid '6122' is part of movie collection: Koukaku Kidoutai Collection', related_anime_list: '{'61': (0, '')}', 
2018-05-14 13:28:26,990 (3b6c) :  INFO (logkit:16) - 'year': '2008'
2018-05-14 13:28:26,990 (3b6c) :  INFO (logkit:16) - AniDB.get_metadata() - ANNid: '', MALid: '4672', xml loaded: 'True'
2018-05-14 13:28:26,990 (3b6c) :  INFO (logkit:16) - -------------------------------------------------------------------------------------------------------------------------------------------------------------
2018-05-14 13:28:26,990 (3b6c) :  INFO (logkit:16) - TheTVDB.GetMetadata() - TVDBid: '73749', IMDbid: ''
2018-05-14 13:28:26,992 (3b6c) :  INFO (logkit:16) - language_series : ['en', 'ja'], language_episodes: ['en', 'ja']
2018-05-14 13:28:27,009 (3b6c) :  DEBUG (networking:166) - Requesting 'https://api.thetvdb.com/series/73749'
2018-05-14 13:28:27,700 (3b6c) :  INFO (logkit:16) - serie_json: {u'data': {u'seriesId': u'24388', u'rating': u'TV-14', u'overview': u'In the future when technological enhancements and robotics are a way of life, Major Motoko Kusanagi and Section 9 take care of the jobs that are too difficult for the police. Section 9 employs hackers, sharpshooters, detectives and cyborgs all in an effort to thwart cyber criminals and their plans to attack the innocent.', u'firstAired': u'2002-10-01', u'zap2itId': u'SH700817', u'aliases': [u'Ghost in the Shell: S.A.C.', u'Ghost in the Shell: S.A.C. 2nd GIG', u'Ghost in the Shell: Stand Alone Complex 2nd GIG'], u'networkId': u'', u'network': u'Animax', u'id': 73749, u'seriesName': u'Ghost in the Shell: Stand Alone Complex', u'status': u'Ended', u'added': u'', u'imdbId': u'tt0346314', u'lastUpdated': 1521931186, u'addedBy': None, u'genre': [u'Action', u'Animation', u'Science-Fiction'], u'banner': u'graphical/73749-g7.jpg', u'airsTime': u'1:30 AM', u'siteRatingCount': 242, u'airsDayOfWeek': u'Daily', u'runtime': u'25', u'siteRating': 8.9}}
2018-05-14 13:28:27,700 (3b6c) :  INFO (logkit:16) - TheTVDB.GetMetadata() - TVDBid: '73749', IMDbid: , url: 'https://api.thetvdb.com/series/73749'
2018-05-14 13:28:27,719 (3b6c) :  DEBUG (networking:166) - Requesting 'https://api.thetvdb.com/series/73749/actors'
2018-05-14 13:28:28,107 (3b6c) :  INFO (logkit:16) - TheTVDB.GetMetadata() - TVDB_ACTORS_URL: https://api.thetvdb.com/series/73749/actors
2018-05-14 13:28:28,108 (3b6c) :  INFO (logkit:16) - role: Daisuke Aramaki , name: Osamu Saka     , image: actors/27865.jpg , 
2018-05-14 13:28:28,108 (3b6c) :  INFO (logkit:16) - role: Batou           , name: Akio Ōtsuka    , image: actors/27866.jpg , 
2018-05-14 13:28:28,108 (3b6c) :  INFO (logkit:16) - role: Borma           , name: Taro Yamaguchi , image: actors/27867.jpg , 
2018-05-14 13:28:28,108 (3b6c) :  INFO (logkit:16) - role: Tachikoma       , name: Sakiko Tamagawa, image: actors/27868.jpg , 
2018-05-14 13:28:28,108 (3b6c) :  INFO (logkit:16) - role: Togusa          , name: Kōichi Yamadera, image: actors/349449.jpg, 
2018-05-14 13:28:28,108 (3b6c) :  INFO (logkit:16) - role: Motoko Kusanagi , name: Atsuko Tanaka  , image: actors/349447.jpg, 
2018-05-14 13:28:28,108 (3b6c) :  INFO (logkit:16) - role: Ishikawa        , name: Yutaka Nakano  , image: actors/407074.jpg, 
2018-05-14 13:28:28,108 (3b6c) :  INFO (logkit:16) - role: Saito           , name: Tōru Ōkawa     , image: actors/407075.jpg, 
2018-05-14 13:28:28,109 (3b6c) :  INFO (logkit:16) - role: Paz             , name: Takashi Onozuka, image: actors/407076.jpg, 
2018-05-14 13:28:28,109 (3b6c) :  INFO (logkit:16) - role: The Laughing Man, name: Yamadera Kōichi, image: actors/407078.jpg, 
2018-05-14 13:28:28,125 (3b6c) :  DEBUG (networking:166) - Requesting 'https://api.thetvdb.com/series/73749/episodes?page=1'
2018-05-14 13:28:28,680 (3b6c) :  DEBUG (networking:166) - Requesting 'https://api.thetvdb.com/series/73749/episodes?page=2'
2018-05-14 13:28:29,138 (3b6c) :  CRITICAL (core:574) - Exception in the update function of agent named 'HamaMovies', called with guid 'com.plexapp.agents.hama://anidb-6122?lang=en' (most recent call last):
  File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-31d3c0c65\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 1076, in _update
    agent.update(obj, media, lang, **kwargs)
  File "E:\Media\Plex\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code\__init__.py", line 131, in update
    def update (self, metadata, media, lang, force ):  Update (metadata, media, lang, force,  True)
  File "E:\Media\Plex\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code\__init__.py", line 103, in Update
    dict_TheTVDB,                             IMDbid              =     TheTVDBv2.GetMetadata(media, movie, error_log, lang, source, AniDBid, TVDBid, IMDbid,         mappingList, Dict(AniDB, 'movie'))
  File "E:\Media\Plex\Plex Media Server\Plug-ins\Hama.bundle\Contents\Code\TheTVDBv2.py", line 195, in GetMetadata
    break
AttributeError: 'MediaTree' object has no attribute 'seasons'

2018-05-14 13:28:29,207 (3b6c) :  DEBUG (model:229) - Serializing to E:\Media\Plex\Plex Media Server\Metadata\Movies\2\b4f55af844011d41cb74517c5b6a0ce01ef180d.bundle\Contents\com.plexapp.agents.hama\Info.xml
2018-05-14 13:28:29,211 (3b6c) :  DEBUG (runtime:88) - Sending packed state data (588 bytes)
2018-05-14 13:28:29,213 (3b6c) :  DEBUG (runtime:924) - Response: [200] str, 16 bytes
ZeroQI commented 6 years ago

tested with the 2 filenames you gave, made reproducing way faster Please test and close if resolved