NZB/Torrent provider base

This commit is contained in:
Ruud
2011-04-12 10:43:37 +02:00
parent 3833b6ead1
commit 05f6d57ea3
21 changed files with 395 additions and 73 deletions
+10 -1
View File
@@ -7,7 +7,10 @@ import os.path
class Plugin():
def conf(self, attr):
return Env.setting(attr, self.__class__.__name__.lower())
return Env.setting(attr, self.getName().lower())
def getName(self):
return self.__class__.__name__
def registerStatic(self, file_path):
@@ -25,3 +28,9 @@ class Plugin():
dir = os.path.join(plugin_dir, 'static')
return send_from_directory(dir, file)
def isDisabled(self):
return not self.isEnabled()
def isEnabled(self):
return self.conf('enabled', True)
+41 -32
View File
@@ -1,33 +1,42 @@
def start():
pass
from couchpotato.core.plugins.renamer.main import Renamer
#config = [{
# 'name': 'Renamer',
# 'tab': 'renaming',
# 'options': {
# 'enabled': {
# 'default': False,
# 'type': 'bool',
# 'description': 'Enable renaming',
# },
# 'from': {
# 'default': '',
# 'type': 'directory',
# 'label': 'From',
# 'description': 'Folder where the movies are downloaded to.',
# },
# 'to': {
# 'default': '',
# 'type': 'directory',
# 'label': 'To',
# 'description': 'Folder where the movies will be moved to.',
# },
# 'run_every': {
# 'default': 1,
# 'type': 'int',
# 'unit': 'min(s)',
# 'description': 'Search for new movies inside the folder every X minutes.',
# }
# }
#}]
config = []
def start():
return Renamer()
config = [{
'name': 'renamer',
'groups': [
{
'tab': 'renamer',
'name': 'tmdb',
'label': 'TheMovieDB',
'advanced': True,
'description': 'Move and rename your downloaded movies to your movie directory.',
'options': [
{
'name': 'enabled',
'default': False,
'type': 'enabler',
},
{
'name': 'from',
'type': 'directory',
'description': 'Folder where the movies are downloaded to.',
},
{
'name': 'to',
'type': 'directory',
'description': 'Folder where the movies will be moved to.',
},
{
'name': 'run_every',
'label': 'Run every',
'default': 1,
'type': 'int',
'unit': 'min(s)',
'description': 'Search for new movies inside the folder every X minutes.',
}
],
},
],
}]
+10
View File
@@ -0,0 +1,10 @@
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
log = CPLog(__name__)
class Renamer(Plugin):
def __init__(self):
pass