diff --git a/resources/lib/Entrypoint.py b/resources/lib/Entrypoint.py index 69ccd011..f86af5d1 100644 --- a/resources/lib/Entrypoint.py +++ b/resources/lib/Entrypoint.py @@ -278,7 +278,13 @@ def getNextUpEpisodes(tagname,limit): # If we found any, find the oldest unwatched show for each one. if json_result.has_key('result') and json_result['result'].has_key('tvshows'): for item in json_result['result']['tvshows']: - json_query2 = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": { "tvshowid": %d, "sort": {"method":"episode"}, "filter": {"field": "playcount", "operator": "lessthan", "value":"1"}, "properties": [ "title", "playcount", "season", "episode", "showtitle", "plot", "file", "rating", "resume", "tvshowid", "art", "streamdetails", "firstaired", "runtime", "writer", "cast", "dateadded", "lastplayed" ], "limits":{"end":1}}, "id": "1"}' %item['tvshowid']) + addonSettings = xbmcaddon.Addon(id='plugin.video.emby') + + # If Ignore Specials is true only choose episodes from seasons greater than 0. + if addonSettings.getSetting("ignoreSpecialsNextEpisodes")=="true": + json_query2 = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": { "tvshowid": %d, "sort": {"method":"episode"}, "filter": {"and": [ {"field": "playcount", "operator": "lessthan", "value":"1"}, {"field": "season", "operator": "greaterthan", "value": "0"} ]}, "properties": [ "title", "playcount", "season", "episode", "showtitle", "plot", "file", "rating", "resume", "tvshowid", "art", "streamdetails", "firstaired", "runtime", "writer", "cast", "dateadded", "lastplayed" ], "limits":{"end":1}}, "id": "1"}' %item['tvshowid']) + else: + json_query2 = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": { "tvshowid": %d, "sort": {"method":"episode"}, "filter": {"field": "playcount", "operator": "lessthan", "value":"1"}, "properties": [ "title", "playcount", "season", "episode", "showtitle", "plot", "file", "rating", "resume", "tvshowid", "art", "streamdetails", "firstaired", "runtime", "writer", "cast", "dateadded", "lastplayed" ], "limits":{"end":1}}, "id": "1"}' %item['tvshowid']) if json_query2: json_query2 = json.loads(json_query2) diff --git a/resources/settings.xml b/resources/settings.xml index 30cc59b8..e224696f 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -32,6 +32,7 @@ +