generic gog picture if gog game

This commit is contained in:
nocci 2025-05-01 13:23:46 +02:00
parent b1aee9e5b8
commit a284ae3963
2 changed files with 8 additions and 1 deletions

View File

@ -590,6 +590,10 @@ def export_pdf():
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 = Image(img_data, width=3*cm, height=img_height)
elif game.url and 'gog.com' in game.url:
try:
img_path = os.path.join(app.root_path, 'static', 'gog_logo.png')
img = Image(img_path, width=3*cm, height=img_height)
except Exception:
img = Paragraph('', styles['Normal'])
@ -1108,6 +1112,9 @@ cat <<HTML_END > templates/index.html
{% if game.steam_appid %}
<img src="https://cdn.cloudflare.steamstatic.com/steam/apps/{{ game.steam_appid }}/header.jpg"
alt="Steam Header" style="height:64px;max-width:120px;object-fit:cover;">
{% elif game.url and 'gog.com' in game.url %}
<img src="{{ url_for('static', filename='gog_logo.png') }}"
alt="GOG Logo" style="height:48px;max-width:120px;object-fit:contain;">
{% endif %}
</td>
<td>{{ game.name }}</td>
@ -1598,7 +1605,7 @@ CSS_END
echo -e "\n\033[1;32m✅ Setup done! Seems to be okay!\033[0m"
echo -e "Have a look in your .env"
echo -e "nano .env"
echo -e "\n\033[1;32m✔️ After you are done start the system with:\033[0m"
echo -e "\n\033[1;32m After you are done start the system with:\033[0m"
echo -e "cd steam-gift-manager"
echo -e "docker-compose build --no-cache && docker-compose up -d"
echo -e "\nGenerate translations: ./translate.sh"

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB