mirror of
https://github.com/sabnzbd/sabnzbd.git
synced 2026-02-02 20:02:22 -05:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8d6eebb04 | ||
|
|
864c5160c0 | ||
|
|
99b5a00c12 | ||
|
|
85ee1f07d7 | ||
|
|
e58b4394e0 | ||
|
|
1e91a57bf1 | ||
|
|
39cee52a7e | ||
|
|
72068f939d | ||
|
|
096d0d3cad | ||
|
|
2472ab0121 | ||
|
|
00421717b8 |
4
PKG-INFO
4
PKG-INFO
@@ -1,7 +1,7 @@
|
||||
Metadata-Version: 1.0
|
||||
Name: SABnzbd
|
||||
Version: 3.1.0
|
||||
Summary: SABnzbd-3.1.0
|
||||
Version: 3.1.1
|
||||
Summary: SABnzbd-3.1.1
|
||||
Home-page: https://sabnzbd.org
|
||||
Author: The SABnzbd Team
|
||||
Author-email: team@sabnzbd.org
|
||||
|
||||
11
README.mkd
11
README.mkd
@@ -1,6 +1,15 @@
|
||||
Release Notes - SABnzbd 3.1.0
|
||||
Release Notes - SABnzbd 3.1.1
|
||||
=========================================================
|
||||
|
||||
## Changes and bugfixes since 3.1.1
|
||||
- Enforce CRLF line endings on outgoing email messages.
|
||||
- Queue Repair would fail if Rating is enabled.
|
||||
- It was not possible to set directory-settings to empty values.
|
||||
- Deobfuscate-during-download was not triggered.
|
||||
- Failed to start on Python 3.5 with HTTPS enabled.
|
||||
- Could show traceback when formatting error/warnings messages.
|
||||
- Windows/macOS: improve handling of program restart.
|
||||
|
||||
## Changes since 3.0.2
|
||||
- Added option to automatically deobfuscate final filenames: after unpacking,
|
||||
detect and rename obfuscated or meaningless filenames to the job name,
|
||||
|
||||
17
SABnzbd.py
17
SABnzbd.py
@@ -125,17 +125,23 @@ class GUIHandler(logging.Handler):
|
||||
|
||||
def emit(self, record):
|
||||
""" Emit a record by adding it to our private queue """
|
||||
# If % is part of the msg, this could fail
|
||||
try:
|
||||
record_msg = record.msg % record.args
|
||||
except TypeError:
|
||||
record_msg = record.msg + str(record.args)
|
||||
|
||||
if record.levelname == "WARNING":
|
||||
sabnzbd.LAST_WARNING = record.msg % record.args
|
||||
sabnzbd.LAST_WARNING = record_msg
|
||||
else:
|
||||
sabnzbd.LAST_ERROR = record.msg % record.args
|
||||
sabnzbd.LAST_ERROR = record_msg
|
||||
|
||||
if len(self.store) >= self.size:
|
||||
# Loose the oldest record
|
||||
self.store.pop(0)
|
||||
try:
|
||||
# Append traceback, if available
|
||||
warning = {"type": record.levelname, "text": record.msg % record.args, "time": int(time.time())}
|
||||
warning = {"type": record.levelname, "text": record_msg, "time": int(time.time())}
|
||||
if record.exc_info:
|
||||
warning["text"] = "%s\n%s" % (warning["text"], traceback.format_exc())
|
||||
self.store.append(warning)
|
||||
@@ -1287,7 +1293,7 @@ def main():
|
||||
sabnzbd.cfg.enable_https.set(False)
|
||||
|
||||
# So the cert and key files do exist, now let's check if they are valid:
|
||||
trialcontext = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
|
||||
trialcontext = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
|
||||
try:
|
||||
trialcontext.load_cert_chain(https_cert, https_key)
|
||||
logging.info("HTTPS keys are OK")
|
||||
@@ -1530,6 +1536,7 @@ def main():
|
||||
# Check for auto-restart request
|
||||
# Or special restart cases like Mac and WindowsService
|
||||
if sabnzbd.TRIGGER_RESTART:
|
||||
logging.info("Performing triggered restart")
|
||||
# Shutdown
|
||||
sabnzbd.shutdown_program()
|
||||
|
||||
@@ -1548,7 +1555,7 @@ def main():
|
||||
my_name = sabnzbd.MY_FULLNAME.replace("/Contents/MacOS/SABnzbd", "")
|
||||
my_args = " ".join(sys.argv[1:])
|
||||
cmd = 'kill -9 %s && open "%s" --args %s' % (my_pid, my_name, my_args)
|
||||
logging.info("Launching: ", cmd)
|
||||
logging.info("Launching: %s", cmd)
|
||||
os.system(cmd)
|
||||
elif sabnzbd.WIN_SERVICE:
|
||||
# Use external service handler to do the restart
|
||||
|
||||
@@ -465,15 +465,6 @@ def trigger_restart(timeout=None):
|
||||
if timeout:
|
||||
time.sleep(timeout)
|
||||
|
||||
# Add extra arguments
|
||||
if sabnzbd.downloader.Downloader.do.paused:
|
||||
sabnzbd.RESTART_ARGS.append("-p")
|
||||
sys.argv = sabnzbd.RESTART_ARGS
|
||||
|
||||
# Stop all services
|
||||
sabnzbd.halt()
|
||||
cherrypy.engine.exit()
|
||||
|
||||
if sabnzbd.WIN32:
|
||||
# Remove connection info for faster restart
|
||||
del_connection_info()
|
||||
@@ -482,6 +473,15 @@ def trigger_restart(timeout=None):
|
||||
if hasattr(sys, "frozen"):
|
||||
sabnzbd.TRIGGER_RESTART = True
|
||||
else:
|
||||
# Add extra arguments
|
||||
if sabnzbd.downloader.Downloader.do.paused:
|
||||
sabnzbd.RESTART_ARGS.append("-p")
|
||||
sys.argv = sabnzbd.RESTART_ARGS
|
||||
|
||||
# Stop all services
|
||||
sabnzbd.halt()
|
||||
cherrypy.engine.exit()
|
||||
|
||||
# Do the restart right now
|
||||
cherrypy.engine._do_execv()
|
||||
|
||||
|
||||
@@ -1746,8 +1746,8 @@ def build_history(start=0, limit=0, search=None, failed_only=0, categories=None)
|
||||
# Un-reverse the queue
|
||||
items.reverse()
|
||||
|
||||
# Global check if rating is enabled
|
||||
rating_enabled = cfg.rating_enable()
|
||||
# Global check if rating is enabled and available (queue-repair)
|
||||
rating_enabled = cfg.rating_enable() and Rating.do
|
||||
|
||||
for item in items:
|
||||
item["size"] = to_units(item["bytes"], "B")
|
||||
|
||||
@@ -236,7 +236,7 @@ class OptionDir(Option):
|
||||
'create' means try to create (but don't set permanent create flag)
|
||||
"""
|
||||
error = None
|
||||
if value and (value != self.get() or create):
|
||||
if value is not None and (value != self.get() or create):
|
||||
value = value.strip()
|
||||
if self.__validation:
|
||||
error, value = self.__validation(self.__root, value, super().default())
|
||||
|
||||
@@ -27,6 +27,7 @@ import glob
|
||||
|
||||
from Cheetah.Template import Template
|
||||
from email.message import EmailMessage
|
||||
from email import policy
|
||||
|
||||
from sabnzbd.constants import *
|
||||
import sabnzbd
|
||||
@@ -296,4 +297,4 @@ def _prepare_message(txt):
|
||||
msg[keyword] = value
|
||||
|
||||
msg.set_content("\n".join(payload))
|
||||
return msg.as_bytes()
|
||||
return msg.as_bytes(policy=msg.policy.clone(linesep="\r\n"))
|
||||
|
||||
@@ -357,15 +357,15 @@ class NzbFile(TryList):
|
||||
self.valid = bool(raw_article_db)
|
||||
|
||||
if self.valid and self.nzf_id:
|
||||
# Save first article separate so we can do duplicate file detection
|
||||
# Save first article separate so we can do
|
||||
# duplicate file detection and deobfuscate-during-download
|
||||
first_article = self.add_article(raw_article_db.pop(0))
|
||||
first_article.lowest_partnum = True
|
||||
self.nzo.first_articles.append(first_article)
|
||||
self.nzo.first_articles_count += 1
|
||||
|
||||
# For non-par2 files we also use it to do deobfuscate-during-download
|
||||
# And we count how many bytes are available for repair
|
||||
# Count how many bytes are available for repair
|
||||
if sabnzbd.par2file.is_parfile(self.filename):
|
||||
self.nzo.first_articles.append(first_article)
|
||||
self.nzo.first_articles_count += 1
|
||||
self.nzo.bytes_par2 += self.bytes
|
||||
|
||||
# Any articles left?
|
||||
@@ -1702,8 +1702,11 @@ class NzbObject(TryList):
|
||||
self.renamed_file(yenc_filename, nzf.filename)
|
||||
nzf.filename = yenc_filename
|
||||
|
||||
@synchronized(NZO_LOCK)
|
||||
def verify_all_filenames_and_resort(self):
|
||||
""" Verify all filenames based on par2 info and then re-sort files """
|
||||
"""Verify all filenames based on par2 info and then re-sort files.
|
||||
Locked so all files are verified at once without interuptions.
|
||||
"""
|
||||
logging.info("Checking all filenames for %s", self.final_name)
|
||||
for nzf_verify in self.files:
|
||||
self.verify_nzf_filename(nzf_verify)
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
|
||||
# You MUST use double quotes (so " and not ')
|
||||
|
||||
__version__ = "3.1.0"
|
||||
__baseline__ = "23f86e95f1f980963c4e4017276b3a3e2adfc6e2"
|
||||
__version__ = "3.1.1"
|
||||
__baseline__ = "99b5a00c12c1d8e17bb3e4a9a98339f59152c842"
|
||||
|
||||
Reference in New Issue
Block a user