From 3e6f46483cde896a090ee03d87bbff3ec59a0d5f Mon Sep 17 00:00:00 2001 From: ShyPike Date: Sun, 31 Jul 2011 10:53:41 +0200 Subject: [PATCH] Launch browser for a second instance when no -b parameter is given. This means that browser launch is always active when using the standard shortcut. Only an explicit -b0 will suppress the launch. --- SABnzbd.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SABnzbd.py b/SABnzbd.py index 069e9e6..8d139f3 100755 --- a/SABnzbd.py +++ b/SABnzbd.py @@ -643,7 +643,10 @@ def find_free_port(host, currentport): def check_for_sabnzbd(url, upload_nzbs, allow_browser=True): """ Check for a running instance of sabnzbd(same version) on this port + allow_browser==True|None will launch the browser, False will not. """ + if allow_browser is None: + allow_browser = True if is_sabnzbd_running(url): # Upload any specified nzb files to the running instance if upload_nzbs: @@ -652,6 +655,7 @@ def check_for_sabnzbd(url, upload_nzbs, allow_browser=True): upload_file(url, f) else: # Launch the web browser and quit since sabnzbd is already running + # Trim away everything after the final slash in the URL url = url[:url.rfind('/')+1] launch_a_browser(url, force=allow_browser) exit_sab(0)