mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
use etag for checksum
This commit is contained in:
parent
5000613a99
commit
210b0831c7
2 changed files with 21 additions and 21 deletions
|
@ -124,19 +124,19 @@ class API():
|
||||||
# else just add some fields to a string
|
# else just add some fields to a string
|
||||||
checksum = ""
|
checksum = ""
|
||||||
|
|
||||||
#if item.get("Etag") != None:
|
if item.get("Etag") != None:
|
||||||
#checksum = item.get("Etag")
|
checksum = item.get("Etag")
|
||||||
#else:
|
else:
|
||||||
userData = item.get("UserData")
|
userData = item.get("UserData")
|
||||||
if(userData != None):
|
if(userData != None):
|
||||||
checksum += str(userData.get("Played"))
|
checksum += str(userData.get("Played"))
|
||||||
checksum += str(userData.get("IsFavorite"))
|
checksum += str(userData.get("IsFavorite"))
|
||||||
if userData.get('UnplayedItemCount') != None:
|
if userData.get('UnplayedItemCount') != None:
|
||||||
checksum += str(userData.get("UnplayedItemCount"))
|
checksum += str(userData.get("UnplayedItemCount"))
|
||||||
if userData.get('LastPlayedDate') != None:
|
if userData.get('LastPlayedDate') != None:
|
||||||
checksum += str(userData.get("LastPlayedDate"))
|
checksum += str(userData.get("LastPlayedDate"))
|
||||||
if userData.get('PlaybackPositionTicks') != None:
|
if userData.get('PlaybackPositionTicks') != None:
|
||||||
checksum += str(userData.get("PlaybackPositionTicks"))
|
checksum += str(userData.get("PlaybackPositionTicks"))
|
||||||
|
|
||||||
return checksum
|
return checksum
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ class ReadEmbyDB():
|
||||||
|
|
||||||
#only get basic info for our sync-compares
|
#only get basic info for our sync-compares
|
||||||
sortstring = "&SortBy=SortName"
|
sortstring = "&SortBy=SortName"
|
||||||
url = "{server}/mediabrowser/Users/{UserId}/items?ParentId=%s%s&Fields=CumulativeRunTimeTicks&Recursive=true&SortOrder=Descending&IncludeItemTypes=Movie&CollapseBoxSetItems=false&format=json&ImageTypeLimit=1" % (id, sortstring)
|
url = "{server}/mediabrowser/Users/{UserId}/items?ParentId=%s%s&Fields=CumulativeRunTimeTicks,Etag&Recursive=true&SortOrder=Descending&IncludeItemTypes=Movie&CollapseBoxSetItems=false&format=json&ImageTypeLimit=1" % (id, sortstring)
|
||||||
|
|
||||||
jsonData = doUtils.downloadUrl(url)
|
jsonData = doUtils.downloadUrl(url)
|
||||||
if (jsonData == ""):
|
if (jsonData == ""):
|
||||||
|
@ -47,7 +47,7 @@ class ReadEmbyDB():
|
||||||
|
|
||||||
#only get basic info for our sync-compares
|
#only get basic info for our sync-compares
|
||||||
sortstring = "&SortBy=SortName"
|
sortstring = "&SortBy=SortName"
|
||||||
url = "{server}/mediabrowser/Users/{UserId}/items?%s&Fields=CumulativeRunTimeTicks&Recursive=true&SortOrder=Descending&IncludeItemTypes=MusicVideo&CollapseBoxSetItems=false&format=json&ImageTypeLimit=1" % sortstring
|
url = "{server}/mediabrowser/Users/{UserId}/items?%s&Fields=CumulativeRunTimeTicks,Etag&Recursive=true&SortOrder=Descending&IncludeItemTypes=MusicVideo&CollapseBoxSetItems=false&format=json&ImageTypeLimit=1" % sortstring
|
||||||
|
|
||||||
jsonData = doUtils.downloadUrl(url)
|
jsonData = doUtils.downloadUrl(url)
|
||||||
if (jsonData == ""):
|
if (jsonData == ""):
|
||||||
|
@ -99,7 +99,7 @@ class ReadEmbyDB():
|
||||||
|
|
||||||
#only get basic info for our sync-compares
|
#only get basic info for our sync-compares
|
||||||
sortstring = "&SortBy=SortName"
|
sortstring = "&SortBy=SortName"
|
||||||
url = "{server}/mediabrowser/Users/{UserId}/Items?ParentId=%s%s&Fields=CumulativeRunTimeTicks&Recursive=true&SortOrder=Descending&IncludeItemTypes=Series&format=json&ImageTypeLimit=1" % (id, sortstring)
|
url = "{server}/mediabrowser/Users/{UserId}/Items?ParentId=%s%s&Fields=CumulativeRunTimeTicks,Etag&Recursive=true&SortOrder=Descending&IncludeItemTypes=Series&format=json&ImageTypeLimit=1" % (id, sortstring)
|
||||||
|
|
||||||
jsonData = doUtils.downloadUrl(url)
|
jsonData = doUtils.downloadUrl(url)
|
||||||
if (jsonData == ""):
|
if (jsonData == ""):
|
||||||
|
@ -139,7 +139,7 @@ class ReadEmbyDB():
|
||||||
result = None
|
result = None
|
||||||
doUtils = DownloadUtils()
|
doUtils = DownloadUtils()
|
||||||
|
|
||||||
url = "{server}/mediabrowser/Users/{UserId}/Items?ParentId=%s&IsVirtualUnaired=false&IsMissing=False&SortBy=SortName&Fields=Name,SortName,CumulativeRunTimeTicks&Recursive=true&SortOrder=Ascending&IncludeItemTypes=Episode&format=json&ImageTypeLimit=1" % showId
|
url = "{server}/mediabrowser/Users/{UserId}/Items?ParentId=%s&IsVirtualUnaired=false&IsMissing=False&SortBy=SortName&Fields=Name,SortName,CumulativeRunTimeTicks,Etag&Recursive=true&SortOrder=Ascending&IncludeItemTypes=Episode&format=json&ImageTypeLimit=1" % showId
|
||||||
|
|
||||||
jsonData = doUtils.downloadUrl(url)
|
jsonData = doUtils.downloadUrl(url)
|
||||||
if (jsonData == ""):
|
if (jsonData == ""):
|
||||||
|
@ -168,9 +168,9 @@ class ReadEmbyDB():
|
||||||
limitString = "Ids=" + ",".join(itemList) + "&"
|
limitString = "Ids=" + ",".join(itemList) + "&"
|
||||||
|
|
||||||
if fullinfo:
|
if fullinfo:
|
||||||
url = "{server}/mediabrowser/Users/{UserId}/Items?%sIsVirtualUnaired=false&IsMissing=False&Fields=ParentId,Path,Genres,SortName,Studios,Writer,ProductionYear,Taglines,CommunityRating,OfficialRating,CumulativeRunTimeTicks,Metascore,AirTime,DateCreated,MediaStreams,People,Overview&Recursive=true&SortOrder=Descending&IncludeItemTypes=Episode&format=json&ImageTypeLimit=1" % limitString
|
url = "{server}/mediabrowser/Users/{UserId}/Items?%sIsVirtualUnaired=false&IsMissing=False&Fields=ParentId,Path,Genres,SortName,Studios,Writer,ProductionYear,Taglines,CommunityRating,OfficialRating,CumulativeRunTimeTicks,Metascore,AirTime,DateCreated,MediaStreams,People,Overview,Etag&Recursive=true&SortOrder=Descending&IncludeItemTypes=Episode&format=json&ImageTypeLimit=1" % limitString
|
||||||
else:
|
else:
|
||||||
url = "{server}/mediabrowser/Users/{UserId}/Items?%sIsVirtualUnaired=false&IsMissing=False&Fields=ParentId,Name,SortName,CumulativeRunTimeTicks&Recursive=true&SortOrder=Descending&IncludeItemTypes=Episode&format=json&ImageTypeLimit=1" % limitString
|
url = "{server}/mediabrowser/Users/{UserId}/Items?%sIsVirtualUnaired=false&IsMissing=False&Fields=ParentId,Name,SortName,CumulativeRunTimeTicks,Etag&Recursive=true&SortOrder=Descending&IncludeItemTypes=Episode&format=json&ImageTypeLimit=1" % limitString
|
||||||
|
|
||||||
jsonData = doUtils.downloadUrl(url)
|
jsonData = doUtils.downloadUrl(url)
|
||||||
if (jsonData == ""):
|
if (jsonData == ""):
|
||||||
|
@ -260,7 +260,7 @@ class ReadEmbyDB():
|
||||||
result = None
|
result = None
|
||||||
doUtils = DownloadUtils()
|
doUtils = DownloadUtils()
|
||||||
|
|
||||||
url = "{server}/mediabrowser/Users/{UserId}/Items?SortBy=SortName&IsVirtualUnaired=false&IsMissing=False&Fields=Name,SortName,CumulativeRunTimeTicks&Recursive=true&SortOrder=Ascending&IncludeItemTypes=BoxSet&format=json&ImageTypeLimit=1"
|
url = "{server}/mediabrowser/Users/{UserId}/Items?SortBy=SortName&IsVirtualUnaired=false&IsMissing=False&Fields=Name,SortName,CumulativeRunTimeTicks,Etag&Recursive=true&SortOrder=Ascending&IncludeItemTypes=BoxSet&format=json&ImageTypeLimit=1"
|
||||||
|
|
||||||
jsonData = doUtils.downloadUrl(url)
|
jsonData = doUtils.downloadUrl(url)
|
||||||
if (jsonData == ""):
|
if (jsonData == ""):
|
||||||
|
@ -276,7 +276,7 @@ class ReadEmbyDB():
|
||||||
result = None
|
result = None
|
||||||
doUtils = DownloadUtils()
|
doUtils = DownloadUtils()
|
||||||
|
|
||||||
url = "{server}/mediabrowser/Users/{UserId}/Items?ParentId=%s&Fields=ItemCounts&format=json&ImageTypeLimit=1" % boxsetId
|
url = "{server}/mediabrowser/Users/{UserId}/Items?ParentId=%s&Fields=ItemCounts,Etag&format=json&ImageTypeLimit=1" % boxsetId
|
||||||
|
|
||||||
jsonData = doUtils.downloadUrl(url)
|
jsonData = doUtils.downloadUrl(url)
|
||||||
if (jsonData == ""):
|
if (jsonData == ""):
|
||||||
|
|
Loading…
Reference in a new issue