File tree Expand file tree Collapse file tree
metadata.tvshows.themoviedb.org.python Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" standalone =" yes" ?>
22<addon id =" metadata.tvshows.themoviedb.org.python"
33 name =" TMDb TV Shows"
4- version =" 2.0.1 "
4+ version =" 2.0.2 "
55 provider-name =" Team Kodi" >
66 <requires >
77 <import addon =" xbmc.python" version =" 3.0.0" />
1010 <extension point =" xbmc.metadata.scraper.tvshows" library =" main.py" />
1111 <extension point =" xbmc.addon.metadata" >
1212 <reuselanguageinvoker >true</reuselanguageinvoker >
13- <news >2.0.1
14- - Season-aware artwork selection
15- - Better artwork distribution across all art types
16- - Fix Fanart.tv URLs with special characters
17- - Fanart.tv source preference settings
18- - Artwork scoring: language + resolution
19- - Punctuation agnostic title matching, year filter fallback
13+ <news >2.0.2
14+ - Log Fanart.tv and Trakt 404s as info instead of error
15+ - Wipe in-memory caches after 15 min idle
16+ - updated Trakt access
2017 </news >
2118 <platform >all</platform >
2219 <license >GPL-3.0-or-later</license >
Original file line number Diff line number Diff line change 1+ 2.0.2
2+ Log Fanart.tv and Trakt 404s as info instead of error
3+ Wipe in-memory caches after 15 min idle
4+ updated Trackt access
5+
162.0.1
27ground up rewrite by MikeSiLVO
38Season-aware artwork selection
Original file line number Diff line number Diff line change @@ -105,5 +105,9 @@ def _fetch(tvdb_id, client_key):
105105 with urlopen (req , timeout = 10 ) as resp :
106106 return json .loads (resp .read ().decode ('utf-8' ))
107107 except Exception as exc :
108- log .error ('Fanart.tv GET /tv/{} failed: {}' .format (tvdb_id , exc ))
108+ from urllib .error import HTTPError
109+ if isinstance (exc , HTTPError ) and exc .code == 404 :
110+ log .info ('Fanart.tv GET /tv/{}: not found' .format (tvdb_id ))
111+ else :
112+ log .error ('Fanart.tv GET /tv/{} failed: {}' .format (tvdb_id , exc ))
109113 return None
Original file line number Diff line number Diff line change @@ -103,5 +103,9 @@ def _get(path, params=None):
103103 with urlopen (req , timeout = 10 ) as resp :
104104 return json .loads (resp .read ().decode ('utf-8' ))
105105 except Exception as exc :
106- log .error ('Trakt GET {} failed: {}' .format (path , exc ))
106+ from urllib .error import HTTPError
107+ if isinstance (exc , HTTPError ) and exc .code == 404 :
108+ log .info ('Trakt GET {}: not found' .format (path ))
109+ else :
110+ log .error ('Trakt GET {} failed: {}' .format (path , exc ))
107111 return None
Original file line number Diff line number Diff line change 1717
1818TMDB_API_KEY = 'af3a53eb387d57fc935e9128468b1899'
1919
20- TRAKT_CLIENTID = '90901c6be3b2de5a4fa0edf9ab5c75e9a5a0fef2b4ee7373d8b63dcf61f95697 '
20+ TRAKT_CLIENTID = '07b40ae3e7c2aa7be77053b27469bfc599aafca58dafda41597c721e1293dd01 '
2121
2222FANARTTV_BASE = 'https://webservice.fanart.tv/v3.2'
2323FANARTTV_KEY = 'b018086af0e1478479adfc55634db97d'
Original file line number Diff line number Diff line change 44
55import json
66import re
7+ import time
78
89import xbmc
910import xbmcgui
1011import xbmcplugin
1112
1213from lib import art_cache , log
1314from lib .artwork import set_artwork
15+ from lib .api import trakt
1416from lib .api .fanarttv import merge_fanarttv_artwork
1517from lib .api .tmdb import TmdbApi , get_image_base , _cache
1618from lib .api .imdb import get_rating as imdb_rating , check_update as imdb_check
5153
5254_active_show = ''
5355
56+ _IDLE_TTL = 15 * 60
57+ _last_activity = 0
58+
59+
60+ def _clear_in_memory_caches ():
61+ _cache .clear ()
62+ trakt ._cached_shows .clear ()
63+ trakt ._episode_cache .clear ()
64+
5465
5566def run_action (handle , action , params ):
5667 """Dispatch a Kodi scraper action."""
68+ global _last_activity
69+ now = time .time ()
70+ if _last_activity and now - _last_activity > _IDLE_TTL :
71+ log .debug ('idle > {}s, wiping in-memory caches' .format (_IDLE_TTL ))
72+ _clear_in_memory_caches ()
73+ _last_activity = now
74+
5775 settings = get_settings ()
5876 log .init (settings .get ('verbose_log' , False ))
5977
You can’t perform that action at this time.
0 commit comments