NZB/Torrent provider base
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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.',
|
||||
}
|
||||
],
|
||||
},
|
||||
],
|
||||
}]
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user