fixed gog pic in route
This commit is contained in:
		
							parent
							
								
									cef1f900e6
								
							
						
					
					
						commit
						144e43d164
					
				
					 2 changed files with 6 additions and 2 deletions
				
			
		
							
								
								
									
										6
									
								
								setup.sh
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								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'),
 | 
				
			||||||
| 
						 | 
					@ -622,6 +624,7 @@ def export_pdf():
 | 
				
			||||||
        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…
	
	Add table
		Add a link
		
	
		Reference in a new issue