missing-artwork-handling #15
@ -23,15 +23,23 @@ def game(predefinednfo=False, return_dict=False, skip_artwork=False):
|
||||
# Add front cover artwork in medium size
|
||||
artpath = os.path.dirname(nfopath)+'/art/'
|
||||
i = 0
|
||||
for art in nfo['game']['artwork']:
|
||||
if skip_artwork is False:
|
||||
nfo['game']['artwork'][i]['data'] = reduceartcv2(
|
||||
artpath+art['filename'], 'thumbnail')
|
||||
if art['type'] == 'front':
|
||||
nfo['game']['displayimage'] = reduceartcv2(
|
||||
artpath+art['filename'], 'thumbnail')
|
||||
i += 1
|
||||
|
||||
if 'artwork' in nfo['game']:
|
||||
if nfo['game']['artwork']:
|
||||
for art in nfo['game']['artwork']:
|
||||
if skip_artwork is False:
|
||||
nfo['game']['artwork'][i]['data'] = reduceartcv2(
|
||||
artpath+art['filename'], 'thumbnail')
|
||||
if art['type'] == 'front':
|
||||
nfo['game']['displayimage'] = reduceartcv2(
|
||||
artpath+art['filename'], 'thumbnail')
|
||||
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:
|
||||
return jsonify(nfo)
|
||||
return nfo
|
||||
|
||||
Loading…
Reference in New Issue
Block a user