38 changed files with 3107 additions and 3165 deletions
@ -1,8 +1,55 @@ |
|||
from .main import Automation |
|||
from couchpotato.core.event import addEvent, fireEvent |
|||
from couchpotato.core.logger import CPLog |
|||
from couchpotato.core.plugins.base import Plugin |
|||
from couchpotato.environment import Env |
|||
|
|||
log = CPLog(__name__) |
|||
|
|||
autoload = 'Automation' |
|||
|
|||
|
|||
class Automation(Plugin): |
|||
|
|||
def __init__(self): |
|||
|
|||
addEvent('app.load', self.setCrons) |
|||
|
|||
if not Env.get('dev'): |
|||
addEvent('app.load', self.addMovies) |
|||
|
|||
addEvent('setting.save.automation.hour.after', self.setCrons) |
|||
|
|||
def setCrons(self): |
|||
fireEvent('schedule.interval', 'automation.add_movies', self.addMovies, hours = self.conf('hour', default = 12)) |
|||
|
|||
def addMovies(self): |
|||
|
|||
movies = fireEvent('automation.get_movies', merge = True) |
|||
movie_ids = [] |
|||
|
|||
for imdb_id in movies: |
|||
|
|||
if self.shuttingDown(): |
|||
break |
|||
|
|||
prop_name = 'automation.added.%s' % imdb_id |
|||
added = Env.prop(prop_name, default = False) |
|||
if not added: |
|||
added_movie = fireEvent('movie.add', params = {'identifier': imdb_id}, force_readd = False, search_after = False, update_library = True, single = True) |
|||
if added_movie: |
|||
movie_ids.append(added_movie['id']) |
|||
Env.prop(prop_name, True) |
|||
|
|||
for movie_id in movie_ids: |
|||
|
|||
if self.shuttingDown(): |
|||
break |
|||
|
|||
movie_dict = fireEvent('media.get', movie_id, single = True) |
|||
fireEvent('movie.searcher.single', movie_dict) |
|||
|
|||
return True |
|||
|
|||
def start(): |
|||
return Automation() |
|||
|
|||
config = [{ |
|||
'name': 'automation', |
@ -1,49 +0,0 @@ |
|||
from couchpotato.core.event import addEvent, fireEvent |
|||
from couchpotato.core.logger import CPLog |
|||
from couchpotato.core.plugins.base import Plugin |
|||
from couchpotato.environment import Env |
|||
|
|||
log = CPLog(__name__) |
|||
|
|||
|
|||
class Automation(Plugin): |
|||
|
|||
def __init__(self): |
|||
|
|||
addEvent('app.load', self.setCrons) |
|||
|
|||
if not Env.get('dev'): |
|||
addEvent('app.load', self.addMovies) |
|||
|
|||
addEvent('setting.save.automation.hour.after', self.setCrons) |
|||
|
|||
def setCrons(self): |
|||
fireEvent('schedule.interval', 'automation.add_movies', self.addMovies, hours = self.conf('hour', default = 12)) |
|||
|
|||
def addMovies(self): |
|||
|
|||
movies = fireEvent('automation.get_movies', merge = True) |
|||
movie_ids = [] |
|||
|
|||
for imdb_id in movies: |
|||
|
|||
if self.shuttingDown(): |
|||
break |
|||
|
|||
prop_name = 'automation.added.%s' % imdb_id |
|||
added = Env.prop(prop_name, default = False) |
|||
if not added: |
|||
added_movie = fireEvent('movie.add', params = {'identifier': imdb_id}, force_readd = False, search_after = False, update_library = True, single = True) |
|||
if added_movie: |
|||
movie_ids.append(added_movie['id']) |
|||
Env.prop(prop_name, True) |
|||
|
|||
for movie_id in movie_ids: |
|||
|
|||
if self.shuttingDown(): |
|||
break |
|||
|
|||
movie_dict = fireEvent('media.get', movie_id, single = True) |
|||
fireEvent('movie.searcher.single', movie_dict) |
|||
|
|||
return True |
@ -1,7 +0,0 @@ |
|||
from .main import FileBrowser |
|||
|
|||
|
|||
def start(): |
|||
return FileBrowser() |
|||
|
|||
config = [] |
@ -1,7 +0,0 @@ |
|||
from .main import Custom |
|||
|
|||
|
|||
def start(): |
|||
return Custom() |
|||
|
|||
config = [] |
@ -1,7 +0,0 @@ |
|||
from .main import Dashboard |
|||
|
|||
|
|||
def start(): |
|||
return Dashboard() |
|||
|
|||
config = [] |
@ -1,7 +0,0 @@ |
|||
from .main import FileManager |
|||
|
|||
|
|||
def start(): |
|||
return FileManager() |
|||
|
|||
config = [] |
@ -1,43 +0,0 @@ |
|||
from .main import Manage |
|||
|
|||
|
|||
def start(): |
|||
return Manage() |
|||
|
|||
config = [{ |
|||
'name': 'manage', |
|||
'groups': [ |
|||
{ |
|||
'tab': 'manage', |
|||
'label': 'Movie Library Manager', |
|||
'description': 'Add your existing movie folders.', |
|||
'options': [ |
|||
{ |
|||
'name': 'enabled', |
|||
'default': False, |
|||
'type': 'enabler', |
|||
}, |
|||
{ |
|||
'name': 'library', |
|||
'type': 'directories', |
|||
'description': 'Folder where the movies should be moved to.', |
|||
}, |
|||
{ |
|||
'label': 'Cleanup After', |
|||
'name': 'cleanup', |
|||
'type': 'bool', |
|||
'description': 'Remove movie from db if it can\'t be found after re-scan.', |
|||
'default': True, |
|||
}, |
|||
{ |
|||
'label': 'Scan at startup', |
|||
'name': 'startup_scan', |
|||
'type': 'bool', |
|||
'default': True, |
|||
'advanced': True, |
|||
'description': 'Do a quick scan on startup. On slow systems better disable this.', |
|||
}, |
|||
], |
|||
}, |
|||
], |
|||
}] |
@ -1,7 +1,7 @@ |
|||
from .main import QualityPlugin |
|||
|
|||
|
|||
def start(): |
|||
def autoload(): |
|||
return QualityPlugin() |
|||
|
|||
config = [] |
|||
|
@ -1,178 +0,0 @@ |
|||
from couchpotato.core.plugins.renamer.main import Renamer |
|||
import os |
|||
|
|||
|
|||
def start(): |
|||
return Renamer() |
|||
|
|||
rename_options = { |
|||
'pre': '<', |
|||
'post': '>', |
|||
'choices': { |
|||
'ext': 'Extention (mkv)', |
|||
'namethe': 'Moviename, The', |
|||
'thename': 'The Moviename', |
|||
'year': 'Year (2011)', |
|||
'first': 'First letter (M)', |
|||
'quality': 'Quality (720p)', |
|||
'quality_type': '(HD) or (SD)', |
|||
'video': 'Video (x264)', |
|||
'audio': 'Audio (DTS)', |
|||
'group': 'Releasegroup name', |
|||
'source': 'Source media (Bluray)', |
|||
'resolution_width': 'resolution width (1280)', |
|||
'resolution_height': 'resolution height (720)', |
|||
'audio_channels': 'audio channels (7.1)', |
|||
'original': 'Original filename', |
|||
'original_folder': 'Original foldername', |
|||
'imdb_id': 'IMDB id (tt0123456)', |
|||
'cd': 'CD number (cd1)', |
|||
'cd_nr': 'Just the cd nr. (1)', |
|||
'mpaa': 'MPAA Rating', |
|||
'category': 'Category label', |
|||
}, |
|||
} |
|||
|
|||
config = [{ |
|||
'name': 'renamer', |
|||
'order': 40, |
|||
'description': 'Move and rename your downloaded movies to your movie directory.', |
|||
'groups': [ |
|||
{ |
|||
'tab': 'renamer', |
|||
'name': 'renamer', |
|||
'label': 'Rename downloaded movies', |
|||
'wizard': True, |
|||
'options': [ |
|||
{ |
|||
'name': 'enabled', |
|||
'default': False, |
|||
'type': 'enabler', |
|||
}, |
|||
{ |
|||
'name': 'from', |
|||
'type': 'directory', |
|||
'description': 'Folder where CP searches for movies.', |
|||
}, |
|||
{ |
|||
'name': 'to', |
|||
'type': 'directory', |
|||
'description': 'Default folder where the movies are moved to.', |
|||
}, |
|||
{ |
|||
'name': 'folder_name', |
|||
'label': 'Folder naming', |
|||
'description': 'Name of the folder. Keep empty for no folder.', |
|||
'default': '<namethe> (<year>)', |
|||
'type': 'choice', |
|||
'options': rename_options |
|||
}, |
|||
{ |
|||
'name': 'file_name', |
|||
'label': 'File naming', |
|||
'description': 'Name of the file', |
|||
'default': '<thename><cd>.<ext>', |
|||
'type': 'choice', |
|||
'options': rename_options |
|||
}, |
|||
{ |
|||
'name': 'unrar', |
|||
'type': 'bool', |
|||
'description': 'Extract rar files if found.', |
|||
'default': False, |
|||
}, |
|||
{ |
|||
'name': 'cleanup', |
|||
'type': 'bool', |
|||
'description': 'Cleanup leftover files after successful rename.', |
|||
'default': False, |
|||
}, |
|||
{ |
|||
'advanced': True, |
|||
'name': 'run_every', |
|||
'label': 'Run every', |
|||
'default': 1, |
|||
'type': 'int', |
|||
'unit': 'min(s)', |
|||
'description': ('Detect movie status every X minutes.', 'Will start the renamer if movie is <strong>completed</strong> or handle <strong>failed</strong> download if these options are enabled'), |
|||
}, |
|||
{ |
|||
'advanced': True, |
|||
'name': 'force_every', |
|||
'label': 'Force every', |
|||
'default': 2, |
|||
'type': 'int', |
|||
'unit': 'hour(s)', |
|||
'description': 'Forces the renamer to scan every X hours', |
|||
}, |
|||
{ |
|||
'advanced': True, |
|||
'name': 'next_on_failed', |
|||
'default': True, |
|||
'type': 'bool', |
|||
'description': 'Try the next best release for a movie after a download failed.', |
|||
}, |
|||
{ |
|||
'name': 'move_leftover', |
|||
'type': 'bool', |
|||
'description': 'Move all leftover file after renaming, to the movie folder.', |
|||
'default': False, |
|||
'advanced': True, |
|||
}, |
|||
{ |
|||
'advanced': True, |
|||
'name': 'separator', |
|||
'label': 'File-Separator', |
|||
'description': ('Replace all the spaces with a character.', 'Example: ".", "-" (without quotes). Leave empty to use spaces.'), |
|||
}, |
|||
{ |
|||
'advanced': True, |
|||
'name': 'foldersep', |
|||
'label': 'Folder-Separator', |
|||
'description': ('Replace all the spaces with a character.', 'Example: ".", "-" (without quotes). Leave empty to use spaces.'), |
|||
}, |
|||
{ |
|||
'name': 'file_action', |
|||
'label': 'Torrent File Action', |
|||
'default': 'link', |
|||
'type': 'dropdown', |
|||
'values': [('Link', 'link'), ('Copy', 'copy'), ('Move', 'move')], |
|||
'description': ('<strong>Link</strong>, <strong>Copy</strong> or <strong>Move</strong> after download completed.', |
|||
'Link first tries <a href="http://en.wikipedia.org/wiki/Hard_link">hard link</a>, then <a href="http://en.wikipedia.org/wiki/Sym_link">sym link</a> and falls back to Copy. It is perfered to use link when downloading torrents as it will save you space, while still beeing able to seed.'), |
|||
'advanced': True, |
|||
}, |
|||
{ |
|||
'advanced': True, |
|||
'name': 'ntfs_permission', |
|||
'label': 'NTFS Permission', |
|||
'type': 'bool', |
|||
'hidden': os.name != 'nt', |
|||
'description': 'Set permission of moved files to that of destination folder (Windows NTFS only).', |
|||
'default': False, |
|||
}, |
|||
], |
|||
}, { |
|||
'tab': 'renamer', |
|||
'name': 'meta_renamer', |
|||
'label': 'Advanced renaming', |
|||
'description': 'Meta data file renaming. Use <filename> to use the above "File naming" settings, without the file extention.', |
|||
'advanced': True, |
|||
'options': [ |
|||
{ |
|||
'name': 'rename_nfo', |
|||
'label': 'Rename .NFO', |
|||
'description': 'Rename original .nfo file', |
|||
'type': 'bool', |
|||
'default': True, |
|||
}, |
|||
{ |
|||
'name': 'nfo_name', |
|||
'label': 'NFO naming', |
|||
'default': '<filename>.orig.<ext>', |
|||
'type': 'choice', |
|||
'options': rename_options |
|||
}, |
|||
], |
|||
}, |
|||
], |
|||
}] |
@ -1,7 +0,0 @@ |
|||
from .main import Scanner |
|||
|
|||
|
|||
def start(): |
|||
return Scanner() |
|||
|
|||
config = [] |
@ -1,35 +0,0 @@ |
|||
from .main import Subtitle |
|||
|
|||
|
|||
def start(): |
|||
return Subtitle() |
|||
|
|||
config = [{ |
|||
'name': 'subtitle', |
|||
'groups': [ |
|||
{ |
|||
'tab': 'renamer', |
|||
'name': 'subtitle', |
|||
'label': 'Download subtitles', |
|||
'description': 'after rename', |
|||
'options': [ |
|||
{ |
|||
'name': 'enabled', |
|||
'label': 'Search and download subtitles', |
|||
'default': False, |
|||
'type': 'enabler', |
|||
}, |
|||
{ |
|||
'name': 'languages', |
|||
'description': ('Comma separated, 2 letter country code.', 'Example: en, nl. See the codes at <a href="http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes">on Wikipedia</a>'), |
|||
}, |
|||
# { |
|||
# 'name': 'automatic', |
|||
# 'default': True, |
|||
# 'type': 'bool', |
|||
# 'description': 'Automaticly search & download for movies in library', |
|||
# }, |
|||
], |
|||
}, |
|||
], |
|||
}] |
@ -1,38 +0,0 @@ |
|||
from .main import Trailer |
|||
|
|||
|
|||
def start(): |
|||
return Trailer() |
|||
|
|||
config = [{ |
|||
'name': 'trailer', |
|||
'groups': [ |
|||
{ |
|||
'tab': 'renamer', |
|||
'name': 'trailer', |
|||
'label': 'Download trailer', |
|||
'description': 'after rename', |
|||
'options': [ |
|||
{ |
|||
'name': 'enabled', |
|||
'label': 'Search and download trailers', |
|||
'default': False, |
|||
'type': 'enabler', |
|||
}, |
|||
{ |
|||
'name': 'quality', |
|||
'default': '720p', |
|||
'type': 'dropdown', |
|||
'values': [('1080p', '1080p'), ('720p', '720p'), ('480P', '480p')], |
|||
}, |
|||
{ |
|||
'name': 'name', |
|||
'label': 'Naming', |
|||
'default': '<filename>-trailer', |
|||
'advanced': True, |
|||
'description': 'Use <strong><filename></strong> to use above settings.' |
|||
}, |
|||
], |
|||
}, |
|||
], |
|||
}] |
Loading…
Reference in new issue