mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-13 21:56:11 +00:00
Added mitigation for #216 for when the year data from the server is invalid
This commit is contained in:
parent
2f9fb660cb
commit
5c93a06e9b
1 changed files with 11 additions and 0 deletions
|
@ -282,6 +282,17 @@ def _get_items(query, server_id=None):
|
||||||
query['params'] = params
|
query['params'] = params
|
||||||
|
|
||||||
result = result or {'Items': []}
|
result = result or {'Items': []}
|
||||||
|
|
||||||
|
# Mitigates #216 till the server validates the date provided is valid
|
||||||
|
for count in range(0, len(result["Items"])):
|
||||||
|
if result["Items"][count].get('ProductionYear'):
|
||||||
|
try:
|
||||||
|
from datetime import date
|
||||||
|
date(result["Items"][count]["ProductionYear"], 1, 1)
|
||||||
|
except ValueError:
|
||||||
|
LOG.info("#216 mitigation triggered. Setting ProductionYear to None")
|
||||||
|
result["Items"][count]["ProductionYear"] = None
|
||||||
|
|
||||||
items['Items'].extend(result['Items'])
|
items['Items'].extend(result['Items'])
|
||||||
# Using items to return data and communicate a restore point back to the callee is
|
# Using items to return data and communicate a restore point back to the callee is
|
||||||
# a violation of the SRP. TODO: Seperate responsibilities.
|
# a violation of the SRP. TODO: Seperate responsibilities.
|
||||||
|
|
Loading…
Reference in a new issue