From 2465b363a40c841393f6b376575d65e276fb42c8 Mon Sep 17 00:00:00 2001 From: Chris Griffith Date: Tue, 28 May 2024 21:40:35 -0500 Subject: [PATCH] figure out windows platform version --- .github/workflows/build.yaml | 1 - fastflix/entry.py | 11 +++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 96cb3d93..f48cb765 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -91,7 +91,6 @@ jobs: python -m pip install --upgrade pip setuptools --ignore-installed pip install . pip install .[develop] - python -c "import platform;print(f'PLATFORM PLATFORM {platform.platform()}')" - name: Grab iso-639 lists diff --git a/fastflix/entry.py b/fastflix/entry.py index d89d8dfb..12247893 100644 --- a/fastflix/entry.py +++ b/fastflix/entry.py @@ -122,8 +122,15 @@ def main(portable_mode=False): import platform try: - win_ver = int(platform.platform().lower().split("-")[1]) - except Exception: + windows_version_string = platform.platform().lower().split("-")[1] + if "server" in windows_version_string: + # Windows-2022Server-10.0.20348-SP0 + server_version = int(windows_version_string[:4]) + win_ver = 0 if server_version < 2016 else 10 + else: + win_ver = int(windows_version_string) + except Exception as error: + print(f"COULD NOT DETERMINE WINDOWS VERSION FROM: {platform.platform()} - {error}") win_ver = 0 if win_ver < 10: input(