From 3e4c5cb5e23acdc858348641198cb719c80a51e5 Mon Sep 17 00:00:00 2001 From: Fritsbenik Date: Wed, 4 Jan 2017 19:08:48 +0100 Subject: [PATCH 1/6] update init.freebsd Allow to set variables in /etc/rc.conf --- init-scripts/init.freebsd | 1 + 1 file changed, 1 insertion(+) diff --git a/init-scripts/init.freebsd b/init-scripts/init.freebsd index bd4cca2a..78decdcc 100755 --- a/init-scripts/init.freebsd +++ b/init-scripts/init.freebsd @@ -23,6 +23,7 @@ name="headphones" rcvar=${name}_enable +load_rc_config ${name} : "${headphones_enable:="NO"}" : "${headphones_user:="_sabnzbd"}" From 83c50ccd4f58b1e8d37f48d7d98835755fd0967b Mon Sep 17 00:00:00 2001 From: hypsometric Date: Tue, 14 Feb 2017 15:37:59 +0100 Subject: [PATCH 2/6] HTML escape pth_password --- data/interfaces/default/config.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 40f572f5..7b7254a6 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -687,7 +687,7 @@
- +
From ef6a203cdab393370fa6b07e5bc0c990185c0c01 Mon Sep 17 00:00:00 2001 From: MrClayPole Date: Tue, 21 Feb 2017 08:54:24 +0000 Subject: [PATCH 3/6] Update init.freebsd This path is incorrect for freebsd the path to python bin is /usr/local/bin/python rather than /usr/bin/python --- init-scripts/init.freebsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init-scripts/init.freebsd b/init-scripts/init.freebsd index 78decdcc..e250a7f1 100755 --- a/init-scripts/init.freebsd +++ b/init-scripts/init.freebsd @@ -31,7 +31,7 @@ load_rc_config ${name} : "${headphones_conf:="/usr/local/headphones/config.ini"}" command="${headphones_dir}/Headphones.py" -command_interpreter="/usr/bin/python" +command_interpreter="/usr/local/bin/python" pidfile="/var/run/headphones/headphones.pid" start_precmd="headphones_start_precmd" headphones_flags="--daemon --nolaunch --pidfile $pidfile --config $headphones_conf $headphones_flags" From 6a1aca66b10b62baddd86324feccd3f81dfda2e9 Mon Sep 17 00:00:00 2001 From: widewing Date: Fri, 24 Feb 2017 16:32:54 +0800 Subject: [PATCH 4/6] change ajax call method to POST --- data/interfaces/default/js/script.js | 1 + 1 file changed, 1 insertion(+) diff --git a/data/interfaces/default/js/script.js b/data/interfaces/default/js/script.js index 25e194a8..3f926f90 100644 --- a/data/interfaces/default/js/script.js +++ b/data/interfaces/default/js/script.js @@ -312,6 +312,7 @@ function doAjaxCall(url,elem,reload,form) { $.ajax({ url: url, data: dataString, + type: 'POST', beforeSend: function(jqXHR, settings) { // Start loader etc. feedback.prepend(loader); From 88366443fd24025afff55556a537bb11dc5225b7 Mon Sep 17 00:00:00 2001 From: Ade Date: Thu, 9 Mar 2017 11:10:06 +1300 Subject: [PATCH 5/6] Post processing temp dir fixup Hopefully fixes #2859 --- headphones/helpers.py | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/headphones/helpers.py b/headphones/helpers.py index b01cec69..fd774ec4 100644 --- a/headphones/helpers.py +++ b/headphones/helpers.py @@ -634,28 +634,40 @@ def preserve_torrent_directory(albumpath): tempdir = headphones.CONFIG.KEEP_TORRENT_FILES_DIR else: tempdir = tempfile.gettempdir() - prefix = "headphones_" + os.path.basename(os.path.normpath(albumpath)) + "_" - new_folder = tempfile.mkdtemp(prefix=prefix, dir=tempdir) - # Copy to temp dir - subdir = os.path.join(new_folder, "headphones") - logger.info("Copying files to " + subdir.decode(headphones.SYS_ENCODING, - 'replace') + " subfolder to preserve downloaded files for seeding") - - # Attempt to stop multiple temp dirs being created for the same albumpath - tempdir = os.path.join(tempdir, prefix) - if len(glob.glob(tempdir + '*/')) >= 3: - logger.error( - "Looks like a temp subfolder has previously been created for this albumpath, not continuing " + tempdir.decode( - headphones.SYS_ENCODING, 'replace')) - return None + logger.info("Preparing to copy to a temporary directory for post processing: " + albumpath.decode( + headphones.SYS_ENCODING, 'replace')) try: + prefix = "headphones_" + os.path.basename(os.path.normpath(albumpath)) + "_" + new_folder = tempfile.mkdtemp(prefix=prefix, dir=tempdir) + except Exception as e: + logger.error("Cannot create temp directory: " + tempdir.decode( + headphones.SYS_ENCODING, 'replace') + ". Error: " + str(e)) + return None + + # Attempt to stop multiple temp dirs being created for the same albumpath + try: + workdir = os.path.join(tempdir, prefix) + workdir = re.sub(r'\[', '[[]', workdir) + workdir = re.sub(r'(?= 3: + logger.error( + "Looks like a temp directory has previously been created for this albumpath, not continuing " + workdir.decode( + headphones.SYS_ENCODING, 'replace')) + return None + except Exception as e: + logger.warn("Cannot determine if already copied/processed, will copy anyway: Warning: " + str(e)) + + # Copy to temp dir + try: + subdir = os.path.join(new_folder, "headphones") + logger.info("Copying files to " + subdir.decode(headphones.SYS_ENCODING, 'replace')) shutil.copytree(albumpath, subdir) # Update the album path with the new location return subdir except Exception as e: - logger.warn("Cannot copy/move files to temp folder: " + new_folder.decode(headphones.SYS_ENCODING, + logger.warn("Cannot copy/move files to temp directory: " + new_folder.decode(headphones.SYS_ENCODING, 'replace') + ". Not continuing. Error: " + str( e)) shutil.rmtree(new_folder) From dd1e4bfe3b339a80d1daf346c5f922d3d8f7731d Mon Sep 17 00:00:00 2001 From: Ade Date: Thu, 9 Mar 2017 11:35:06 +1300 Subject: [PATCH 6/6] Label change --- data/interfaces/default/config.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 7b7254a6..a69e582d 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -1656,7 +1656,7 @@
- +