From 13742b8a0cd558a4750c8c3b968d734840044beb Mon Sep 17 00:00:00 2001 From: csd4ni3l Date: Mon, 21 Jul 2025 23:50:48 +0200 Subject: [PATCH] simplify getting of max texture size for atlas, improve ffmpeg missing popup messages --- menus/ffmpeg_missing.py | 8 ++++---- run.py | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/menus/ffmpeg_missing.py b/menus/ffmpeg_missing.py index 78a6d7c..ba33df8 100644 --- a/menus/ffmpeg_missing.py +++ b/menus/ffmpeg_missing.py @@ -13,8 +13,8 @@ class FFmpegMissing(arcade.gui.UIView): arcade.gui.UIMessageBox( width=self.window.width / 2, height=self.window.height / 2, - title="FFmpeg Missing", - message_text="FFmpeg has not been found but is required for this application.", + title="Third-party FFmpeg Missing", + message_text="FFmpeg is a third party software that is required for this application to work. It needs to be downloaded with libavcodec (and) shared libraries included. We provide a basic install script for Windows that might or might not work. For other operating systems, install from the package manager to make sure it is in PATH.", buttons=("Exit", "Install") ) ) @@ -28,7 +28,7 @@ class FFmpegMissing(arcade.gui.UIView): system = platform.system() if system == "Linux" or system == "Darwin": - msgbox = self.add_widget(arcade.gui.UIMessageBox(message_text="You are on a Linux or Darwin based OS. You need to install FFmpeg, and libavcodec shared libraries from your package manager so it is in PATH.", width=self.window.width / 2, height=self.window.height / 2)) + msgbox = self.add_widget(arcade.gui.UIMessageBox(message_text="You are on a Linux or Darwin based OS. You need to install FFmpeg and libavcodec shared libraries from your package manager to make sure it is in PATH.", width=self.window.width / 2, height=self.window.height / 2)) msgbox.on_action = lambda: sys.exit() return @@ -46,4 +46,4 @@ class FFmpegMissing(arcade.gui.UIView): logging.debug("Failed to install FFmpeg via winget:", e) else: - self.add_widget(arcade.gui.UIMessageBox(message_text="Your OS is unsupported by this script. You are probably on some kind of BSD system. Please install FFmpeg and libavcodec shared libraries from your package manager so it is in PATH.", width=self.window.width / 2, height=self.window.height / 2)) + self.add_widget(arcade.gui.UIMessageBox(message_text="Your OS is unsupported by this script. You are probably on some kind of BSD system. Please install FFmpeg and libavcodec shared libraries from your package manager to make sure it is in PATH.", width=self.window.width / 2, height=self.window.height / 2)) diff --git a/run.py b/run.py index 98810fa..4f8908e 100644 --- a/run.py +++ b/run.py @@ -7,13 +7,10 @@ os.environ['SSL_CERT_FILE'] = certifi.where() # Fix SSL not working and download import pyglet pyglet.options.debug_gl = False +max_texture_size = pyglet.image.get_max_texture_size() import logging, datetime, json, sys, arcade -window = pyglet.window.Window(visible=False, width=1, height=1) -max_tex_size = pyglet.gl.GLint() -pyglet.gl.glGetIntegerv(pyglet.gl.GL_MAX_TEXTURE_SIZE, max_tex_size) -arcade.ArcadeContext.atlas_size = (max_tex_size.value, max_tex_size.value) -window.close() +arcade.ArcadeContext.atlas_size = (max_texture_size, max_texture_size) from utils.utils import get_closest_resolution, print_debug_info, on_exception from utils.acoustid_metadata import get_fpcalc_path