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