diff --git a/CouchPotato.py b/CouchPotato.py
index c36757fc..e777f9bf 100755
--- a/CouchPotato.py
+++ b/CouchPotato.py
@@ -62,7 +62,6 @@ class Loader(object):
self.log.logger.addHandler(hdlr)
def addSignals(self):
-
signal.signal(signal.SIGINT, self.onExit)
signal.signal(signal.SIGTERM, lambda signum, stack_frame: sys.exit(1))
@@ -74,7 +73,7 @@ class Loader(object):
def onExit(self, signal, frame):
from couchpotato.core.event import fireEvent
- fireEvent('app.crappy_shutdown', single = True)
+ fireEvent('app.shutdown', single = True)
def run(self):
diff --git a/contributing.md b/contributing.md
index 5bb77037..572dd332 100644
--- a/contributing.md
+++ b/contributing.md
@@ -5,9 +5,10 @@
* Search through the existing (and closed) issues first. See if you can get your answer there.
* Double check the result manually, because it could be an external issue.
* Post logs! Without seeing what is going on, I can't reproduce the error.
- * What are you settings for the specific problem
- * What providers are you using. (While your logs include these, scanning through hundred of lines of log isn't my hobby)
- * Give me a short step by step of how to reproduce
+ * What is the movie + quality you are searching for.
+ * What are you settings for the specific problem.
+ * What providers are you using. (While your logs include these, scanning through hundred of lines of log isn't my hobby).
+ * Give me a short step by step of how to reproduce.
* What hardware / OS are you using and what are the limits? NAS can be slow and maybe have a different python installed then when you use CP on OSX or Windows for example.
* I will mark issues with the "can't reproduce" tag. Don't go asking me "why closed" if it clearly says the issue in the tag ;)
diff --git a/couchpotato/core/_base/_core/main.py b/couchpotato/core/_base/_core/main.py
index c5ce39ad..c36c3fc5 100644
--- a/couchpotato/core/_base/_core/main.py
+++ b/couchpotato/core/_base/_core/main.py
@@ -10,6 +10,7 @@ from uuid import uuid4
import os
import platform
import signal
+import sys
import time
import traceback
import webbrowser
@@ -178,6 +179,7 @@ class Core(Plugin):
def signalHandler(self):
def signal_handler(signal, frame):
- fireEvent('app.do_shutdown')
+ fireEvent('app.shutdown')
signal.signal(signal.SIGINT, signal_handler)
+ signal.signal(signal.SIGTERM, signal_handler)
diff --git a/couchpotato/core/_base/scheduler/main.py b/couchpotato/core/_base/scheduler/main.py
index d442722d..4102552e 100644
--- a/couchpotato/core/_base/scheduler/main.py
+++ b/couchpotato/core/_base/scheduler/main.py
@@ -2,7 +2,6 @@ from apscheduler.scheduler import Scheduler as Sched
from couchpotato.core.event import addEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
-import logging
log = CPLog(__name__)
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')
diff --git a/couchpotato/core/notifications/email/main.py b/couchpotato/core/notifications/email/main.py
index 118ed1b6..be61e944 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,22 +25,27 @@ 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
+ 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("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
- mailserver.sendmail(from_address, to, message.as_string())
+ 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())
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/core/plugins/automation/main.py b/couchpotato/core/plugins/automation/main.py
index c216688c..f4ede40d 100644
--- a/couchpotato/core/plugins/automation/main.py
+++ b/couchpotato/core/plugins/automation/main.py
@@ -12,7 +12,7 @@ class Automation(Plugin):
fireEvent('schedule.interval', 'automation.add_movies', self.addMovies, hours = self.conf('hour', default = 12))
- if Env.get('dev'):
+ if not Env.get('dev'):
addEvent('app.load', self.addMovies)
def addMovies(self):
diff --git a/couchpotato/core/plugins/base.py b/couchpotato/core/plugins/base.py
index a3d5628a..73a2c306 100644
--- a/couchpotato/core/plugins/base.py
+++ b/couchpotato/core/plugins/base.py
@@ -78,7 +78,7 @@ class Plugin(object):
self.makeDir(os.path.dirname(path))
try:
- f = open(path, 'w' if not binary else 'wb')
+ f = open(path, 'w+' if not binary else 'w+b')
f.write(content)
f.close()
os.chmod(path, Env.getPermission('file'))
diff --git a/couchpotato/core/plugins/searcher/main.py b/couchpotato/core/plugins/searcher/main.py
index eb953cd1..8c1929af 100644
--- a/couchpotato/core/plugins/searcher/main.py
+++ b/couchpotato/core/plugins/searcher/main.py
@@ -251,7 +251,7 @@ class Searcher(Plugin):
# Remove releases that aren't found anymore
for release in movie.get('releases', []):
- if release.get('identifier') not in found_releases:
+ if release.get('status_id') == available_status.get('id') and release.get('identifier') not in found_releases:
fireEvent('release.delete', release.get('id'), single = True)
else:
diff --git a/couchpotato/core/plugins/wizard/static/wizard.css b/couchpotato/core/plugins/wizard/static/wizard.css
index a24f2b9e..8d50d9de 100644
--- a/couchpotato/core/plugins/wizard/static/wizard.css
+++ b/couchpotato/core/plugins/wizard/static/wizard.css
@@ -1,8 +1,13 @@
+.page.wizard .uniForm {
+ width: 80%;
+ margin: 0 auto 30px;
+}
+
.page.wizard h1 {
padding: 10px 30px;
margin: 0;
display: block;
- font-size: 40px;
+ font-size: 30px;
margin-top: 80px;
}
diff --git a/couchpotato/core/plugins/wizard/static/wizard.js b/couchpotato/core/plugins/wizard/static/wizard.js
index fd6eb14b..eb41cb59 100644
--- a/couchpotato/core/plugins/wizard/static/wizard.js
+++ b/couchpotato/core/plugins/wizard/static/wizard.js
@@ -41,8 +41,7 @@ Page.Wizard = new Class({
},
'providers': {
'title': 'Are you registered at any of these sites?',
- 'description': 'CP uses these sites to search for movies. A few free are enabled by default, but it\'s always better to have a few more. Check settings for the full list of available providers.',
- 'include': ['nzb_providers', 'torrent_providers']
+ 'description': 'CP uses these sites to search for movies. A few free are enabled by default, but it\'s always better to have a few more. Check settings for the full list of available providers.'
},
'renamer': {
'title': 'Move & rename the movies after downloading?',
@@ -213,8 +212,6 @@ Page.Wizard = new Class({
// Hide retention
self.el.getElement('.tab_searcher').hide();
self.el.getElement('.t_searcher').hide();
- self.el.getElement('.t_nzb_providers').hide();
- self.el.getElement('.t_torrent_providers').hide();
// Add pointer
new Element('.tab_wrapper').wraps(tabs).adopt(
diff --git a/couchpotato/core/providers/automation/imdb/main.py b/couchpotato/core/providers/automation/imdb/main.py
index 428a8b2b..75a2d75c 100644
--- a/couchpotato/core/providers/automation/imdb/main.py
+++ b/couchpotato/core/providers/automation/imdb/main.py
@@ -27,7 +27,7 @@ class IMDB(Automation, RSS):
try:
rss_data = self.getHTMLData(url)
- imdbs = getImdb(rss_data, multiple = True)
+ imdbs = getImdb(rss_data, multiple = True) if rss_data else []
for imdb in imdbs:
movies.append(imdb)
diff --git a/couchpotato/core/providers/nzb/__init__.py b/couchpotato/core/providers/nzb/__init__.py
index a704a94e..651ae8b9 100644
--- a/couchpotato/core/providers/nzb/__init__.py
+++ b/couchpotato/core/providers/nzb/__init__.py
@@ -4,6 +4,7 @@ config = {
{
'label': 'Usenet',
'description': 'Providers searching usenet for new releases',
+ 'wizard': True,
'type': 'list',
'name': 'nzb_providers',
'tab': 'searcher',
diff --git a/couchpotato/core/providers/nzb/binsearch/__init__.py b/couchpotato/core/providers/nzb/binsearch/__init__.py
index bf45f668..f4288b11 100644
--- a/couchpotato/core/providers/nzb/binsearch/__init__.py
+++ b/couchpotato/core/providers/nzb/binsearch/__init__.py
@@ -12,6 +12,7 @@ config = [{
'list': 'nzb_providers',
'name': 'binsearch',
'description': 'Free provider, less accurate. See BinSearch',
+ 'wizard': True,
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/core/providers/nzb/ftdworld/__init__.py b/couchpotato/core/providers/nzb/ftdworld/__init__.py
index 76985648..ca60ac4d 100644
--- a/couchpotato/core/providers/nzb/ftdworld/__init__.py
+++ b/couchpotato/core/providers/nzb/ftdworld/__init__.py
@@ -12,6 +12,7 @@ config = [{
'list': 'nzb_providers',
'name': 'FTDWorld',
'description': 'Free provider, less accurate. See FTDWorld',
+ 'wizard': True,
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/core/providers/nzb/nzbclub/__init__.py b/couchpotato/core/providers/nzb/nzbclub/__init__.py
index 310f4b09..7859fe9c 100644
--- a/couchpotato/core/providers/nzb/nzbclub/__init__.py
+++ b/couchpotato/core/providers/nzb/nzbclub/__init__.py
@@ -12,6 +12,7 @@ config = [{
'list': 'nzb_providers',
'name': 'NZBClub',
'description': 'Free provider, less accurate. See NZBClub',
+ 'wizard': True,
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/core/providers/nzb/nzbindex/__init__.py b/couchpotato/core/providers/nzb/nzbindex/__init__.py
index bad0557d..29eb0d38 100644
--- a/couchpotato/core/providers/nzb/nzbindex/__init__.py
+++ b/couchpotato/core/providers/nzb/nzbindex/__init__.py
@@ -12,6 +12,7 @@ config = [{
'list': 'nzb_providers',
'name': 'nzbindex',
'description': 'Free provider, less accurate. See NZBIndex',
+ 'wizard': True,
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/core/providers/nzb/nzbsrus/__init__.py b/couchpotato/core/providers/nzb/nzbsrus/__init__.py
index 5c4586d7..3a042784 100644
--- a/couchpotato/core/providers/nzb/nzbsrus/__init__.py
+++ b/couchpotato/core/providers/nzb/nzbsrus/__init__.py
@@ -12,7 +12,7 @@ config = [{
'list': 'nzb_providers',
'name': 'nzbsrus',
'label': 'Nzbsrus',
- 'description': 'See NZBsRus',
+ 'description': 'See NZBsRus. You need a VIP account!',
'wizard': True,
'options': [
{
diff --git a/couchpotato/core/providers/nzb/nzbsrus/main.py b/couchpotato/core/providers/nzb/nzbsrus/main.py
index f6a16aaa..d52212a7 100644
--- a/couchpotato/core/providers/nzb/nzbsrus/main.py
+++ b/couchpotato/core/providers/nzb/nzbsrus/main.py
@@ -53,7 +53,7 @@ class Nzbsrus(NZBProvider, RSS):
'name': title,
'age': age,
'size': size,
- 'url': self.urls['download'] % id + self.getApiExt() + self.getTextElement(nzb, 'key'),
+ 'url': self.urls['download'] % nzb_id + self.getApiExt() + self.getTextElement(nzb, 'key'),
'detail_url': self.urls['detail'] % nzb_id,
'description': self.getTextElement(nzb, 'addtext'),
})
diff --git a/couchpotato/core/providers/nzb/nzbx/__init__.py b/couchpotato/core/providers/nzb/nzbx/__init__.py
index 2063a5e8..9ce9226b 100644
--- a/couchpotato/core/providers/nzb/nzbx/__init__.py
+++ b/couchpotato/core/providers/nzb/nzbx/__init__.py
@@ -12,6 +12,7 @@ config = [{
'list': 'nzb_providers',
'name': 'nzbX',
'description': 'Free provider. See nzbX',
+ 'wizard': True,
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/core/providers/nzb/omgwtfnzbs/__init__.py b/couchpotato/core/providers/nzb/omgwtfnzbs/__init__.py
index 74fee0a8..287ced49 100644
--- a/couchpotato/core/providers/nzb/omgwtfnzbs/__init__.py
+++ b/couchpotato/core/providers/nzb/omgwtfnzbs/__init__.py
@@ -12,6 +12,7 @@ config = [{
'list': 'nzb_providers',
'name': 'OMGWTFNZBs',
'description': 'See OMGWTFNZBs',
+ 'wizard': True,
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/core/providers/torrent/__init__.py b/couchpotato/core/providers/torrent/__init__.py
index df6cd9ad..191e132e 100644
--- a/couchpotato/core/providers/torrent/__init__.py
+++ b/couchpotato/core/providers/torrent/__init__.py
@@ -4,6 +4,7 @@ config = {
{
'label': 'Torrent',
'description': 'Providers searching torrent sites for new releases',
+ 'wizard': True,
'type': 'list',
'name': 'torrent_providers',
'tab': 'searcher',
diff --git a/couchpotato/core/providers/torrent/passthepopcorn/__init__.py b/couchpotato/core/providers/torrent/passthepopcorn/__init__.py
index ce9d3822..06be7a89 100644
--- a/couchpotato/core/providers/torrent/passthepopcorn/__init__.py
+++ b/couchpotato/core/providers/torrent/passthepopcorn/__init__.py
@@ -12,6 +12,7 @@ config = [{
'list': 'torrent_providers',
'name': 'PassThePopcorn',
'description': 'See PassThePopcorn.me',
+ 'wizard': True,
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/core/providers/torrent/publichd/__init__.py b/couchpotato/core/providers/torrent/publichd/__init__.py
index 06be3354..2c356e20 100644
--- a/couchpotato/core/providers/torrent/publichd/__init__.py
+++ b/couchpotato/core/providers/torrent/publichd/__init__.py
@@ -12,6 +12,7 @@ config = [{
'list': 'torrent_providers',
'name': 'PublicHD',
'description': 'Public Torrent site with only HD content. See PublicHD',
+ 'wizard': True,
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/core/providers/torrent/sceneaccess/__init__.py b/couchpotato/core/providers/torrent/sceneaccess/__init__.py
index 13614820..e12bf8bd 100644
--- a/couchpotato/core/providers/torrent/sceneaccess/__init__.py
+++ b/couchpotato/core/providers/torrent/sceneaccess/__init__.py
@@ -12,6 +12,7 @@ config = [{
'list': 'torrent_providers',
'name': 'SceneAccess',
'description': 'See SceneAccess',
+ 'wizard': True,
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/core/providers/torrent/scenehd/__init__.py b/couchpotato/core/providers/torrent/scenehd/__init__.py
index 032e7055..10c5e385 100644
--- a/couchpotato/core/providers/torrent/scenehd/__init__.py
+++ b/couchpotato/core/providers/torrent/scenehd/__init__.py
@@ -12,6 +12,7 @@ config = [{
'list': 'torrent_providers',
'name': 'SceneHD',
'description': 'See SceneHD',
+ 'wizard': True,
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/core/providers/torrent/torrentday/__init__.py b/couchpotato/core/providers/torrent/torrentday/__init__.py
index 2ebf0d94..1a4d3c7f 100644
--- a/couchpotato/core/providers/torrent/torrentday/__init__.py
+++ b/couchpotato/core/providers/torrent/torrentday/__init__.py
@@ -12,6 +12,7 @@ config = [{
'list': 'torrent_providers',
'name': 'TorrentDay',
'description': 'See TorrentDay',
+ 'wizard': True,
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/core/providers/torrent/torrentleech/__init__.py b/couchpotato/core/providers/torrent/torrentleech/__init__.py
index 5d1de874..d96ac064 100644
--- a/couchpotato/core/providers/torrent/torrentleech/__init__.py
+++ b/couchpotato/core/providers/torrent/torrentleech/__init__.py
@@ -12,6 +12,7 @@ config = [{
'list': 'torrent_providers',
'name': 'TorrentLeech',
'description': 'See TorrentLeech',
+ 'wizard': True,
'options': [
{
'name': 'enabled',
diff --git a/couchpotato/runner.py b/couchpotato/runner.py
index d3a49f02..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):
@@ -212,6 +212,7 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En
config = {
'use_reloader': reloader,
'port': tryInt(Env.setting('port', default = 5000)),
+ 'host': Env.setting('host', default = ''),
'ssl_cert': Env.setting('ssl_cert', default = None),
'ssl_key': Env.setting('ssl_key', default = None),
}
diff --git a/couchpotato/static/scripts/page/settings.js b/couchpotato/static/scripts/page/settings.js
index a050b3fe..ddb2abf1 100644
--- a/couchpotato/static/scripts/page/settings.js
+++ b/couchpotato/static/scripts/page/settings.js
@@ -301,7 +301,7 @@ Page.Settings = new Class({
createList: function(content_container){
return new Element('div.option_list').grab(
new Element('h3', {
- 'text': 'Enable more providers'
+ 'text': 'Enable another'
})
).inject(content_container)
}
diff --git a/couchpotato/static/style/page/settings.css b/couchpotato/static/style/page/settings.css
index b9c9ea4e..bcd0b774 100644
--- a/couchpotato/static/style/page/settings.css
+++ b/couchpotato/static/style/page/settings.css
@@ -163,6 +163,7 @@
.page .option_list .enabler {
padding: 0;
+ margin-left: 5px !important;
}
.page .option_list .enabler:not(.disabled) {
@@ -175,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;
@@ -188,7 +189,7 @@
display: inline-block;
margin: 3px 3px 3px 20px;
padding: 4px 0;
- width: 159px;
+ width: 173px;
vertical-align: top;
}
@@ -628,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;
}