summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/hooks/UnRar.py5
-rw-r--r--module/web/ajax/views.py1
2 files changed, 4 insertions, 2 deletions
diff --git a/module/plugins/hooks/UnRar.py b/module/plugins/hooks/UnRar.py
index 8acc853d4..6bd650b4a 100644
--- a/module/plugins/hooks/UnRar.py
+++ b/module/plugins/hooks/UnRar.py
@@ -56,14 +56,15 @@ class UnRar(Hook):
def addPassword(self, pws):
if not type(pws) == list: pws = [pws]
+ pws.reverse()
for pw in pws:
pw = pw.strip()
if not pw or pw == "None" or pw in self.passwords: continue
self.passwords.insert(0, pw)
with open(self.getConfig("passwordfile"), "w") as f:
- f.writelines(self.comments)
- f.writelines(self.passwords)
+ f.writelines([c+"\n" for c in self.comments])
+ f.writelines([p+"\n" for p in self.passwords])
def removeFiles(self, pack, fname):
if not self.getConfig("deletearchive"):
diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py
index 9430a54d4..166356ceb 100644
--- a/module/web/ajax/views.py
+++ b/module/web/ajax/views.py
@@ -287,6 +287,7 @@ def edit_package(request):
"password": request.POST.get("pack_pws")}
settings.PYLOAD.set_package_data(id, data)
+ return JsonResponse("success")
except:
return HttpResponseServerError()