fixed gog pic in route
This commit is contained in:
parent
cef1f900e6
commit
144e43d164
8
setup.sh
8
setup.sh
|
@ -585,6 +585,8 @@ def export_pdf():
|
||||||
img_url = f"https://cdn.cloudflare.steamstatic.com/steam/apps/{game.steam_appid}/header.jpg"
|
img_url = f"https://cdn.cloudflare.steamstatic.com/steam/apps/{game.steam_appid}/header.jpg"
|
||||||
img_data = io.BytesIO(requests.get(img_url, timeout=5).content)
|
img_data = io.BytesIO(requests.get(img_url, timeout=5).content)
|
||||||
img = Image(img_data, width=3*cm, height=img_height)
|
img = Image(img_data, width=3*cm, height=img_height)
|
||||||
|
except Exception:
|
||||||
|
img = Paragraph('', styles['Normal'])
|
||||||
elif game.url and 'gog.com' in game.url:
|
elif game.url and 'gog.com' in game.url:
|
||||||
try:
|
try:
|
||||||
img_path = os.path.join(app.root_path, 'static', 'gog_logo.png')
|
img_path = os.path.join(app.root_path, 'static', 'gog_logo.png')
|
||||||
|
@ -599,7 +601,7 @@ def export_pdf():
|
||||||
game.redeem_date.strftime('%d.%m.%y') if game.redeem_date else ''
|
game.redeem_date.strftime('%d.%m.%y') if game.redeem_date else ''
|
||||||
])
|
])
|
||||||
|
|
||||||
# Table format
|
# Table format (korrekte Einrückung)
|
||||||
table = Table(data, colWidths=col_widths, repeatRows=1)
|
table = Table(data, colWidths=col_widths, repeatRows=1)
|
||||||
table.setStyle(TableStyle([
|
table.setStyle(TableStyle([
|
||||||
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
|
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
|
||||||
|
@ -615,13 +617,14 @@ def export_pdf():
|
||||||
doc.build(elements)
|
doc.build(elements)
|
||||||
|
|
||||||
buffer.seek(0)
|
buffer.seek(0)
|
||||||
return send_file(
|
return send_file(
|
||||||
buffer,
|
buffer,
|
||||||
mimetype='application/pdf',
|
mimetype='application/pdf',
|
||||||
as_attachment=True,
|
as_attachment=True,
|
||||||
download_name=f'game_export_{datetime.now().strftime("%Y%m%d")}.pdf'
|
download_name=f'game_export_{datetime.now().strftime("%Y%m%d")}.pdf'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/import', methods=['GET', 'POST'])
|
@app.route('/import', methods=['GET', 'POST'])
|
||||||
@login_required
|
@login_required
|
||||||
def import_games():
|
def import_games():
|
||||||
|
@ -821,6 +824,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends wget \
|
||||||
&& wget -O /app/static/logo.png "https://git.nocci.it/nocci/GiftGamesDB/raw/branch/main/steam-gift-manager/static/logo.png" \
|
&& wget -O /app/static/logo.png "https://git.nocci.it/nocci/GiftGamesDB/raw/branch/main/steam-gift-manager/static/logo.png" \
|
||||||
&& wget -O /app/static/logo_small.png "https://git.nocci.it/nocci/GiftGamesDB/raw/branch/main/steam-gift-manager/static/logo_small.png" \
|
&& wget -O /app/static/logo_small.png "https://git.nocci.it/nocci/GiftGamesDB/raw/branch/main/steam-gift-manager/static/logo_small.png" \
|
||||||
&& wget -O /app/static/forgejo.svg "https://git.nocci.it/nocci/GiftGamesDB/raw/branch/main/steam-gift-manager/static/forgejo.svg" \
|
&& wget -O /app/static/forgejo.svg "https://git.nocci.it/nocci/GiftGamesDB/raw/branch/main/steam-gift-manager/static/forgejo.svg" \
|
||||||
|
&& wget -O /app/static/gog_logo.png "https://git.nocci.it/nocci/GameKeyManager/raw/branch/dev/steam-gift-manager/static/gog_logo.png" \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN mkdir -p /app/data && \
|
RUN mkdir -p /app/data && \
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 68 KiB |
Loading…
Reference in New Issue