Added printing of failed cover art #19

Merged
odecif merged 1 commits from print-current-art-when-failing into master 2022-10-31 11:50:01 +01:00
4 changed files with 15 additions and 6 deletions

View File

@ -5,6 +5,7 @@ user = user
pass = pass pass = pass
db_name = gamedistrosys db_name = gamedistrosys
contentpath = /srv/nfs_mounts/media/PC/ contentpath = /srv/nfs_mounts/media/PC/
nfo_suffix = _index.nfo
[Running] [Running]
host = 172.29.29.51 host = 172.29.29.51

View File

@ -32,3 +32,6 @@ def init():
def contentpath(): def contentpath():
return(config.get('Database','contentpath')) return(config.get('Database','contentpath'))
def nfosuffix():
return(config.get('Database','nfo_suffix'))

View File

@ -26,12 +26,16 @@ def game(predefinednfo=False, return_dict=False, skip_artwork=False):
if 'artwork' in nfo['game']: if 'artwork' in nfo['game']:
if nfo['game']['artwork']: if nfo['game']['artwork']:
for art in nfo['game']['artwork']: for art in nfo['game']['artwork']:
if skip_artwork is False: try:
nfo['game']['artwork'][i]['data'] = reduceartcv2( 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') artpath+art['filename'], 'thumbnail')
if art['type'] == 'front': except Exception as e:
nfo['game']['displayimage'] = reduceartcv2( print("Failing cover: " + art['filename'])
artpath+art['filename'], 'thumbnail') print(e)
i += 1 i += 1
if 'displayimage' not in nfo['game']: if 'displayimage' not in nfo['game']:
for art in nfo['game']['artwork']: for art in nfo['game']['artwork']:

View File

@ -6,6 +6,7 @@ import modules.game
import glob import glob
contentpath = modules.db_connect.contentpath() contentpath = modules.db_connect.contentpath()
nfosuffix = modules.db_connect.nfosuffix()
# Collects all _index.nfo-files present and crunches them into a list of # Collects all _index.nfo-files present and crunches them into a list of
@ -22,7 +23,7 @@ def show_gamelist():
@app.route('/gamelist/update', methods=['GET']) @app.route('/gamelist/update', methods=['GET'])
def update_gamelist(): def update_gamelist():
nfolist = list(dict.fromkeys(glob.glob( nfolist = list(dict.fromkeys(glob.glob(
str(contentpath)+'/**/**/*_index.nfo', recursive=True))) str(contentpath)+'/**/**/*'+nfosuffix, recursive=True)))
glist = [] glist = []
for nfo in nfolist: for nfo in nfolist: