From 7c38ad1c0088e6e8480b8f3adb8863462ba715d0 Mon Sep 17 00:00:00 2001 From: Ruud Date: Wed, 23 Jan 2013 22:23:52 +0100 Subject: [PATCH 1/6] Remove non-int backup folders. closes #1298 --- couchpotato/runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/couchpotato/runner.py b/couchpotato/runner.py index 7062c75b..97d15a55 100644 --- a/couchpotato/runner.py +++ b/couchpotato/runner.py @@ -98,7 +98,7 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En total_backups = len(backups) for backup in backups: if total_backups > 3: - if int(os.path.basename(backup)) < time.time() - 259200: + if tryInt(os.path.basename(backup)) < time.time() - 259200: for src_file in src_files: b_file = os.path.join(backup, os.path.basename(src_file)) if os.path.isfile(b_file): From 2a451c255e4bec393d8747bd9064405083645994 Mon Sep 17 00:00:00 2001 From: ikkemaniac Date: Thu, 17 Jan 2013 19:55:45 +0100 Subject: [PATCH 2/6] Rename var for naming consistency --- couchpotato/core/notifications/email/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/couchpotato/core/notifications/email/main.py b/couchpotato/core/notifications/email/main.py index 118ed1b6..0194ade7 100644 --- a/couchpotato/core/notifications/email/main.py +++ b/couchpotato/core/notifications/email/main.py @@ -15,9 +15,9 @@ class Email(Notification): # Extract all the settings from settings from_address = self.conf('from') - to = self.conf('to') - smtp_server = self.conf('smtp_server') + to_address = self.conf('to') ssl = self.conf('ssl') + smtp_server = self.conf('smtp_server') smtp_user = self.conf('smtp_user') smtp_pass = self.conf('smtp_pass') @@ -25,7 +25,7 @@ class Email(Notification): message = MIMEText(toUnicode(message)) message['Subject'] = self.default_title message['From'] = from_address - message['To'] = to + message['To'] = to_address try: # Open the SMTP connection, via SSL if requested @@ -36,7 +36,7 @@ class Email(Notification): mailserver.login(smtp_user, smtp_pass) # Send the e-mail - mailserver.sendmail(from_address, to, message.as_string()) + mailserver.sendmail(from_address, to_address, message.as_string()) # Close the SMTP connection mailserver.quit() From 35a9739ec5647485c6267c917ac328a4d7d67dae Mon Sep 17 00:00:00 2001 From: ikkemaniac Date: Thu, 17 Jan 2013 21:36:08 +0100 Subject: [PATCH 3/6] Improve debugging for email notifications --- couchpotato/core/notifications/email/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/notifications/email/main.py b/couchpotato/core/notifications/email/main.py index 0194ade7..6c957227 100644 --- a/couchpotato/core/notifications/email/main.py +++ b/couchpotato/core/notifications/email/main.py @@ -29,18 +29,23 @@ class Email(Notification): try: # Open the SMTP connection, via SSL if requested + log.debug("SMTP over SSL %s", ("enabled" if ssl == 1 else "disabled")) mailserver = smtplib.SMTP_SSL(smtp_server) if ssl == 1 else smtplib.SMTP(smtp_server) # Check too see if an login attempt should be attempted if len(smtp_user) > 0: + log.debug("Loggin in on SMTP server using username \'%s\'%s", (smtp_user, " and password" if len(smtp_pass) > 0 else "")) mailserver.login(smtp_user, smtp_pass) # Send the e-mail + log.debug("Sending the email") mailserver.sendmail(from_address, to_address, message.as_string()) # Close the SMTP connection mailserver.quit() - log.info('Email notifications sent.') + + log.info('Email notification sent') + return True except: log.error('E-mail failed: %s', traceback.format_exc()) From 0456a1e820419008eedfa7afb3cb1c01cd1b0ff1 Mon Sep 17 00:00:00 2001 From: Ruud Date: Wed, 23 Jan 2013 22:29:02 +0100 Subject: [PATCH 4/6] Typo --- couchpotato/core/notifications/email/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/couchpotato/core/notifications/email/main.py b/couchpotato/core/notifications/email/main.py index 6c957227..be61e944 100644 --- a/couchpotato/core/notifications/email/main.py +++ b/couchpotato/core/notifications/email/main.py @@ -34,7 +34,7 @@ class Email(Notification): # Check too see if an login attempt should be attempted if len(smtp_user) > 0: - log.debug("Loggin in on SMTP server using username \'%s\'%s", (smtp_user, " and password" if len(smtp_pass) > 0 else "")) + log.debug("Logging on to SMTP server using username \'%s\'%s", (smtp_user, " and a password" if len(smtp_pass) > 0 else "")) mailserver.login(smtp_user, smtp_pass) # Send the e-mail From 749075b4cbad2dea460a35c4f2d565f8304b7c65 Mon Sep 17 00:00:00 2001 From: Ruud Date: Wed, 23 Jan 2013 22:50:31 +0100 Subject: [PATCH 5/6] Setting cleanup --- couchpotato/core/notifications/notifymywp/__init__.py | 2 +- couchpotato/static/style/page/settings.css | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/couchpotato/core/notifications/notifymywp/__init__.py b/couchpotato/core/notifications/notifymywp/__init__.py index 4e52761d..6e0bd06d 100644 --- a/couchpotato/core/notifications/notifymywp/__init__.py +++ b/couchpotato/core/notifications/notifymywp/__init__.py @@ -10,7 +10,7 @@ config = [{ 'tab': 'notifications', 'list': 'notification_providers', 'name': 'notifymywp', - 'label': 'Notify My Windows Phone', + 'label': 'Windows Phone', 'options': [ { 'name': 'enabled', diff --git a/couchpotato/static/style/page/settings.css b/couchpotato/static/style/page/settings.css index 8d0b0f2e..bcd0b774 100644 --- a/couchpotato/static/style/page/settings.css +++ b/couchpotato/static/style/page/settings.css @@ -176,7 +176,7 @@ .page .option_list h3 { padding: 0; - margin: 10px 0 0 0; + margin: 10px 5px 0; text-align: center; font-weight: normal; text-shadow: none; @@ -189,7 +189,7 @@ display: inline-block; margin: 3px 3px 3px 20px; padding: 4px 0; - width: 159px; + width: 173px; vertical-align: top; } @@ -629,14 +629,14 @@ .group_userscript .or { float: left; - margin: 20px 10px; + margin: 20px -10px 0 10px; } .group_userscript .bookmarklet { display: block; display: block; float: left; - padding: 20px 15px 0 0 ; + padding: 20px 15px 0 25px; border-radius: 5px; } From cad9bfae9fe59bd4cb41b9bea5006308653c277a Mon Sep 17 00:00:00 2001 From: Ruud Date: Wed, 23 Jan 2013 22:54:02 +0100 Subject: [PATCH 6/6] Transmission: Don't use ratio when not filled in. --- couchpotato/core/downloaders/transmission/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/couchpotato/core/downloaders/transmission/main.py b/couchpotato/core/downloaders/transmission/main.py index 63c9de9d..d7354823 100644 --- a/couchpotato/core/downloaders/transmission/main.py +++ b/couchpotato/core/downloaders/transmission/main.py @@ -38,10 +38,11 @@ class Transmission(Downloader): 'download-dir': folder_path } - torrent_params = { - 'seedRatioLimit': self.conf('ratio'), - 'seedRatioMode': (0 if self.conf('ratio') else 1) - } + if self.conf('ratio'): + torrent_params = { + 'seedRatioLimit': self.conf('ratio'), + 'seedRatioMode': self.conf('ratio') + } if not filedata and data.get('type') == 'torrent': log.error('Failed sending torrent, no data')