Added handling for when artwork is missing
This commit is contained in:
parent
ffaff83c78
commit
16cc5a44eb
@ -23,6 +23,8 @@ def game(predefinednfo=False, return_dict=False, skip_artwork=False):
|
|||||||
# Add front cover artwork in medium size
|
# Add front cover artwork in medium size
|
||||||
artpath = os.path.dirname(nfopath)+'/art/'
|
artpath = os.path.dirname(nfopath)+'/art/'
|
||||||
i = 0
|
i = 0
|
||||||
|
if 'artwork' in nfo['game']:
|
||||||
|
if nfo['game']['artwork']:
|
||||||
for art in nfo['game']['artwork']:
|
for art in nfo['game']['artwork']:
|
||||||
if skip_artwork is False:
|
if skip_artwork is False:
|
||||||
nfo['game']['artwork'][i]['data'] = reduceartcv2(
|
nfo['game']['artwork'][i]['data'] = reduceartcv2(
|
||||||
@ -31,7 +33,13 @@ def game(predefinednfo=False, return_dict=False, skip_artwork=False):
|
|||||||
nfo['game']['displayimage'] = reduceartcv2(
|
nfo['game']['displayimage'] = reduceartcv2(
|
||||||
artpath+art['filename'], 'thumbnail')
|
artpath+art['filename'], 'thumbnail')
|
||||||
i += 1
|
i += 1
|
||||||
|
if 'displayimage' not in nfo['game']:
|
||||||
|
for art in nfo['game']['artwork']:
|
||||||
|
if art['type'] == 'cd':
|
||||||
|
nfo['game']['displayimage'] = reduceartcv2(
|
||||||
|
artpath+art['filename'], 'thumbnail')
|
||||||
|
else:
|
||||||
|
nfo['game']['displayimage'] = ""
|
||||||
if return_dict is False:
|
if return_dict is False:
|
||||||
return jsonify(nfo)
|
return jsonify(nfo)
|
||||||
return nfo
|
return nfo
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user