use bui.open_url instead of webbrowser.open

Check if build is from playstore
This commit is contained in:
brostosjoined 2025-05-27 15:31:59 +03:00
parent c225d7067a
commit 893f18e3e6
2 changed files with 9 additions and 9 deletions

View file

@ -1854,12 +1854,7 @@
} }
], ],
"versions": { "versions": {
"1.0.0": { "1.0.0": null
"api_version": 9,
"commit_sha": "caf3d57",
"released_on": "27-05-2025",
"md5sum": "c80dcc08fa6acaab036d457330b4279e"
}
} }
} }
} }

View file

@ -5,11 +5,11 @@
from platform import machine from platform import machine
import threading import threading
import time import time
import webbrowser
import urllib.request import urllib.request
import re import re
import babase import babase
import bauiv1 as bui
import bascenev1 as bs import bascenev1 as bs
@ -83,6 +83,11 @@ def fetch_update():
extension = link.replace('https://files.ballistica.net/bombsquad/builds/', '') extension = link.replace('https://files.ballistica.net/bombsquad/builds/', '')
if build: if build:
if not ('server' in link_lower) and bs_platform.lower() in link_lower: if not ('server' in link_lower) and bs_platform.lower() in link_lower:
app = bui.app
subplatform = app.classic.subplatform
if subplatform == "google":
return
babase.screenmessage( babase.screenmessage(
"A new BombSquad version is available...\nRedirecting to download page", (0.21, 1.0, 0.20)) "A new BombSquad version is available...\nRedirecting to download page", (0.21, 1.0, 0.20))
sound_sequence = [ sound_sequence = [
@ -101,7 +106,7 @@ def fetch_update():
time.sleep(delay) time.sleep(delay)
babase.pushcall(babase.Call(play_sound, sound), from_other_thread=True) babase.pushcall(babase.Call(play_sound, sound), from_other_thread=True)
time.sleep(1) time.sleep(1)
webbrowser.open(f'https://ballistica.net/downloads#:~:text={extension}') bui.open_url(f'https://ballistica.net/downloads#:~:text={extension}')
elif not build: elif not build:
if ('server' in link_lower) and bs_platform.lower() in link_lower: if ('server' in link_lower) and bs_platform.lower() in link_lower:
GREEN = "\033[32m" GREEN = "\033[32m"
@ -110,7 +115,7 @@ def fetch_update():
try: try:
print(f"{GREEN}A new BombSquad version is available...Redirecting to download page{RESET}") print(f"{GREEN}A new BombSquad version is available...Redirecting to download page{RESET}")
time.sleep(4) time.sleep(4)
webbrowser.open(f'https://ballistica.net/downloads#:~:text={extension}') bui.open_url(f'https://ballistica.net/downloads#:~:text={extension}')
except: except:
print( print(
f"{GREEN}Download the latest version using this official link-> {LIGHT_BLUE}{link}{RESET}") f"{GREEN}Download the latest version using this official link-> {LIGHT_BLUE}{link}{RESET}")