Fix missing mediasources

Also add a throttle to avoid crash if server connection times out.
This commit is contained in:
angelblue05 2016-01-14 02:59:02 -06:00
parent 5c9e571936
commit 5112500f4d

View file

@ -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,11 +206,18 @@ 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)
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,8 +397,14 @@ class Read_EmbyServer():
)
}
result = doUtils.downloadUrl(url, parameters=params)
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