adding try/except for addressing #253
This commit is contained in:
parent
7f20da0ca9
commit
0125865124
@ -532,6 +532,7 @@ def action_show(items, selector, date, users=None):
|
|||||||
print("The following items were added before {}".format(date))
|
print("The following items were added before {}".format(date))
|
||||||
|
|
||||||
for item in items:
|
for item in items:
|
||||||
|
try:
|
||||||
if selector == 'watched':
|
if selector == 'watched':
|
||||||
item = users[0].watch[item]
|
item = users[0].watch[item]
|
||||||
added_at = datetime.datetime.utcfromtimestamp(float(item.added_at)).strftime("%Y-%m-%d")
|
added_at = datetime.datetime.utcfromtimestamp(float(item.added_at)).strftime("%Y-%m-%d")
|
||||||
@ -553,6 +554,8 @@ def action_show(items, selector, date, users=None):
|
|||||||
|
|
||||||
total_size = sum(sizes)
|
total_size = sum(sizes)
|
||||||
print("Total size: {}".format(sizeof_fmt(total_size)))
|
print("Total size: {}".format(sizeof_fmt(total_size)))
|
||||||
|
except TypeError as e:
|
||||||
|
print("Item: {} caused the following error: {}".format(item.rating_key, e))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user