Fixes #348 comment added to code
This commit is contained in:
@ -355,6 +355,7 @@ def last_played_work(sectionID, date=None):
|
||||
start += count
|
||||
for item in tt_history:
|
||||
_meta = tautulli_server.get_metadata(item['rating_key'])
|
||||
if _meta: # rating_key that no longer exists on the Plex server will return blank metadata
|
||||
metadata = Metadata(_meta)
|
||||
if (float(item['last_played'])) < date:
|
||||
metadata.last_played = item['last_played']
|
||||
@ -390,6 +391,7 @@ def unwatched_work(sectionID, date=None):
|
||||
start += count
|
||||
for item in tt_history:
|
||||
_meta = tautulli_server.get_metadata(item['rating_key'])
|
||||
if _meta: # rating_key that no longer exists on the Plex server will return blank metadata
|
||||
metadata = Metadata(_meta)
|
||||
unwatched_lst.append(metadata)
|
||||
continue
|
||||
@ -424,6 +426,7 @@ def size_work(sectionID, operator, value, episodes):
|
||||
start += count
|
||||
for item in tt_size:
|
||||
_meta = tautulli_server.get_metadata(item['rating_key'])
|
||||
if _meta: # rating_key that no longer exists on the Plex server will return blank metadata
|
||||
metadata = Metadata(_meta)
|
||||
try:
|
||||
if episodes:
|
||||
@ -476,6 +479,7 @@ def watched_work(user, sectionID=None, ratingKey=None):
|
||||
user.watch.get(metadata.rating_key).watched_status += 1
|
||||
else:
|
||||
_meta = tautulli_server.get_metadata(metadata.rating_key)
|
||||
if _meta: # rating_key that no longer exists on the Plex server will return blank metadata
|
||||
metadata = Metadata(_meta)
|
||||
user.watch.update({metadata.rating_key: metadata})
|
||||
|
||||
@ -504,6 +508,7 @@ def rating_work(sectionID, operator, value):
|
||||
start += count
|
||||
for item in tt_size:
|
||||
_meta = tautulli_server.get_metadata(item['rating_key'])
|
||||
if _meta: # rating_key that no longer exists on the Plex server will return blank metadata
|
||||
metadata = Metadata(_meta)
|
||||
try:
|
||||
if metadata.audience_rating:
|
||||
|
Reference in New Issue
Block a user