Compare commits

...

23 Commits

Author SHA1 Message Date
Safihre
971e4fc909 Merge branch '3.0.x' 2020-08-30 20:58:31 +02:00
Safihre
51cc765949 Update text files for 3.0.2 2020-08-30 20:50:45 +02:00
Safihre
19c6a4fffa Propagation delay label was shown even if no delay was activated 2020-08-29 16:46:16 +02:00
Safihre
105ac32d2f Reading RSS feed with no categories set could result in crash
Closes #1589
2020-08-28 10:16:49 +02:00
Safihre
57550675d2 Removed logging in macOS sabApp that resulted in double logging 2020-08-28 10:16:41 +02:00
Safihre
e674abc5c0 Update text files for 3.0.2RC2 2020-08-26 08:56:29 +02:00
Safihre
f965c96f51 Change the macOS power assertion to NoIdleSleep 2020-08-26 08:50:54 +02:00
Safihre
c76b8ed9e0 End-of-queue-script did not run on Windows due to long-path
https://forums.sabnzbd.org/viewtopic.php?f=3&t=24918

Will refactor this so they all call 1 function.
2020-08-24 11:28:14 +02:00
Safihre
4fbd0d8a7b Check if name is a string before switching to nzbfile in addfile
Closes #1584
2020-08-24 09:05:25 +02:00
Safihre
41ca217931 Merge branch '3.0.x' 2020-08-18 11:05:50 +02:00
Safihre
0087940898 Merge branch '3.0.x' into master 2020-08-02 09:46:41 +02:00
Safihre
8f21533e76 Set version to 2.3.9 2019-05-24 11:39:14 +02:00
Safihre
89996482a1 Merge branch '2.3.x' 2019-05-24 09:33:12 +02:00
Safihre
03c10dce91 Update text files for 2.3.9 2019-05-24 09:32:34 +02:00
Safihre
bd5331be05 Merge branch 'develop' into 2.3.x 2019-05-24 09:12:02 +02:00
Safihre
46e1645289 Correct typo in release notes 2019-05-18 10:56:39 +02:00
Safihre
4ce3965747 Update text files for 2.3.9RC2 2019-05-18 09:56:05 +02:00
Safihre
9d4af19db3 Merge branch 'develop' into 2.3.x 2019-05-18 09:45:20 +02:00
Safihre
48e034f4be Update text files for 2.3.9RC1 2019-05-07 13:50:20 +02:00
Safihre
f8959baa2f Revert "Notify develop-users that we will switch to Python 3"
This reverts commit fb238af7de.
2019-05-07 13:35:13 +02:00
Safihre
8ed5997eae Merge branch 'develop' into 2.3.x 2019-05-07 13:10:10 +02:00
Safihre
daf9f50ac8 Set version to 2.3.8 2019-03-18 11:10:56 +01:00
Safihre
6b11013c1a Merge branch '2.3.x' 2019-03-18 11:09:35 +01:00
11 changed files with 45 additions and 23 deletions

View File

@@ -1,7 +1,7 @@
Metadata-Version: 1.0
Name: SABnzbd
Version: 3.0.2RC1
Summary: SABnzbd-3.0.2RC1
Version: 3.0.2
Summary: SABnzbd-3.0.2
Home-page: https://sabnzbd.org
Author: The SABnzbd Team
Author-email: team@sabnzbd.org

View File

@@ -1,11 +1,16 @@
Release Notes - SABnzbd 3.0.2 RC 1
Release Notes - SABnzbd 3.0.2
=========================================================
## Bugfixes since 3.0.1
- Priority was not parsed correctly if supplied as through the API.
- API-call `addfile` could fail if `name` and `nzbfile` were used.
- Permissions were still not set correctly when creating directories.
- Propagation delay label was shown even if no delay was activated.
- Reading RSS feed with no categories set could result in crash.
- Jobs with numeric names could crash post-processing.
- Jobs with missing articles could result in crash.
- macOS: changed the power assertion to `NoIdleSleep`.
- Windows: end-of-queue-script did not run on Windows.
- Windows: crash if the virus scanner removed the certificate bundle.
## Bugfixes since 3.0.0

View File

@@ -1703,9 +1703,7 @@ if __name__ == "__main__":
# This code is made with trial-and-error, please improve!
class startApp(Thread):
def run(self):
logging.info("[osx] sabApp Starting - starting main thread")
main()
logging.info("[osx] sabApp Stopping - main thread quit ")
AppHelper.stopEventLoop()
sabApp = startApp()

View File

@@ -848,10 +848,10 @@ def change_queue_complete_action(action, new=True):
def run_script(script):
""" Run a user script (queue complete only) """
command = [os.path.join(cfg.script_dir.get_path(), script)]
if os.path.exists(command[0]):
script_path = filesystem.make_script_path(script)
if script_path:
try:
stup, need_shell, command, creationflags = sabnzbd.newsunpack.build_command(command)
stup, need_shell, command, creationflags = sabnzbd.newsunpack.build_command([script_path])
logging.info("Spawning external command %s", command)
subprocess.Popen(
command,

View File

@@ -350,7 +350,7 @@ def _api_translate(name, output, kwargs):
def _api_addfile(name, output, kwargs):
""" API: accepts name, output, pp, script, cat, priority, nzbname """
# Normal upload will send the nzb in a kw arg called name or nzbfile
if not name:
if not name or isinstance(name, str):
name = kwargs.get("nzbfile", None)
if hasattr(name, "file") and hasattr(name, "filename") and name.filename:
cat = kwargs.get("cat")

View File

@@ -710,15 +710,15 @@ class NzbQueue:
Not locked for performance, since it only reads the queue
"""
# Pre-calculate propagation delay
propagtion_delay = float(cfg.propagation_delay() * 60)
propagation_delay = float(cfg.propagation_delay() * 60)
for nzo in self.__nzo_list:
# Not when queue paused and not a forced item
if nzo.status not in (Status.PAUSED, Status.GRABBING) or nzo.priority == TOP_PRIORITY:
# Check if past propagation delay, or forced
if (
not propagtion_delay
not propagation_delay
or nzo.priority == TOP_PRIORITY
or (nzo.avg_stamp + propagtion_delay) < time.time()
or (nzo.avg_stamp + propagation_delay) < time.time()
):
if not nzo.server_in_try_list(server):
article = nzo.get_article(server, servers)

View File

@@ -1345,8 +1345,9 @@ class NzbObject(TryList):
labels.append(T("WAIT %s sec") % dif)
# Propagation delay label
if (self.avg_stamp + float(cfg.propagation_delay() * 60)) > time.time() and self.priority != TOP_PRIORITY:
wait_time = int((self.avg_stamp + float(cfg.propagation_delay() * 60) - time.time()) / 60 + 0.5)
propagation_delay = float(cfg.propagation_delay() * 60)
if propagation_delay and self.avg_stamp + propagation_delay > time.time() and self.priority != TOP_PRIORITY:
wait_time = int((self.avg_stamp + propagation_delay - time.time()) / 60 + 0.5)
labels.append(T("PROPAGATING %s min") % wait_time) # Queue indicator while waiting for propagation of post
return labels

View File

@@ -791,7 +791,7 @@ def _get_link(entry):
except AttributeError:
try: # nzb.su
category = entry.tags[0]["term"]
except (AttributeError, KeyError):
except (AttributeError, IndexError, KeyError):
try:
category = entry.description
except AttributeError:

View File

@@ -45,12 +45,16 @@ def keep_awake(reason):
Multiple calls allowed.
"""
global assertion_id
kIOPMAssertionTypeNoIdleSleep = "PreventUserIdleSystemSleep"
kIOPMAssertionLevelOn = 255
errcode, assertion_id = IOPMAssertionCreateWithName(
kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, reason, None
)
return errcode == 0
# Each assertion needs to be released, so make sure to only set it once
if not assertion_id:
kIOPMAssertionTypeNoIdleSleep = "NoIdleSleepAssertion"
kIOPMAssertionLevelOn = 255
errcode, assertion_id = IOPMAssertionCreateWithName(
kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, reason, None
)
return errcode == 0
return True
def allow_sleep():

View File

@@ -4,5 +4,5 @@
# You MUST use double quotes (so " and not ')
__version__ = "3.0.1"
__baseline__ = "9a4be70734dbf7ac60f5d4d308a8ff1223206503"
__version__ = "3.0.2"
__baseline__ = "51cc7659493b8f98b5da7537831d1a56f2777775"

View File

@@ -59,3 +59,17 @@ class TestSleepless:
sleepless.allow_sleep()
assert not self.check_msg_in_assertions()
assert sleepless.assertion_id is None
def test_sleepless_multi_call(self):
# If we set it twice, is it still cleared with one call
assert not self.check_msg_in_assertions()
assert sleepless.assertion_id is None
sleepless.keep_awake(self.sleep_msg)
time.sleep(2)
sleepless.keep_awake(self.sleep_msg)
assert self.check_msg_in_assertions()
sleepless.allow_sleep()
assert not self.check_msg_in_assertions()
assert sleepless.assertion_id is None