diff --git a/resources/lib/read_embyserver.py b/resources/lib/read_embyserver.py index 182c33fb..d0158b0e 100644 --- a/resources/lib/read_embyserver.py +++ b/resources/lib/read_embyserver.py @@ -80,8 +80,9 @@ class Read_EmbyServer(): "Path,Genres,SortName,Studios,Writer,ProductionYear,Taglines," "CommunityRating,OfficialRating,CumulativeRunTimeTicks," "Metascore,AirTime,DateCreated,MediaStreams,People,Overview," - "CriticRating,CriticRatingSummary,Etag,ProductionLocations," - "Tags,ProviderIds,RemoteTrailers,SpecialEpisodeNumbers" + "CriticRating,CriticRatingSummary,Etag,ShortOverview,ProductionLocations," + "Tags,ProviderIds,ParentId,RemoteTrailers,SpecialEpisodeNumbers," + "MediaSources" ) } result = self.doUtils.downloadUrl(url, parameters=params) @@ -205,12 +206,19 @@ class Read_EmbyServer(): "CommunityRating,OfficialRating,CumulativeRunTimeTicks," "Metascore,AirTime,DateCreated,MediaStreams,People,Overview," "CriticRating,CriticRatingSummary,Etag,ShortOverview,ProductionLocations," - "Tags,ProviderIds,ParentId,RemoteTrailers,SpecialEpisodeNumbers" + "Tags,ProviderIds,ParentId,RemoteTrailers,SpecialEpisodeNumbers," + "MediaSources" ) result = doUtils.downloadUrl(url, parameters=params) - items['Items'].extend(result['Items']) - - index += jump + try: + items['Items'].extend(result['Items']) + except TypeError: + # Connection timed out, reduce the number + jump -= 50 + self.limitindex = jump + self.logMsg("New throttle for items requested: %s" % jump, 1) + else: + index += jump return items @@ -389,9 +397,15 @@ class Read_EmbyServer(): ) } result = doUtils.downloadUrl(url, parameters=params) - items['Items'].extend(result['Items']) - - index += jump + try: + items['Items'].extend(result['Items']) + except TypeError: + # Connection timed out, reduce the number + jump -= 50 + self.limitindex = jump + self.logMsg("New throttle for items requested: %s" % jump, 1) + else: + index += jump return items