def __init__(self): addEvent("searcher.protocols", self.getSearchProtocols) addEvent("searcher.contains_other_quality", self.containsOtherQuality) addEvent("searcher.correct_year", self.correctYear) addEvent("searcher.correct_name", self.correctName) addEvent("searcher.correct_words", self.correctWords) addEvent("searcher.download", self.download) addEvent("searcher.search", self.search) addEvent("searcher.create_releases", self.createReleases) addApiView("searcher.full_search", self.searchAllView, docs={"desc": "Starts a full search for all media"}) addApiView( "searcher.progress", self.getProgressForAll, docs={ "desc": "Get the progress of all media searches", "return": { "type": "object", "example": """{ 'movie': False || object, total & to_go, 'show': False || object, total & to_go, }""", }, }, )
def __init__(self): # Initialize this type super(MovieBase, self).__init__() self.initType() addApiView('movie.add', self.addView, docs = { 'desc': 'Add new movie to the wanted list', 'return': {'type': 'object', 'example': """{ 'success': True, 'movie': object }"""}, 'params': { 'identifier': {'desc': 'IMDB id of the movie your want to add.'}, 'profile_id': {'desc': 'ID of quality profile you want the add the movie in. If empty will use the default profile.'}, 'force_readd': {'desc': 'Force re-add even if movie already in wanted or manage. Default: True'}, 'category_id': {'desc': 'ID of category you want the add the movie in. If empty will use no category.'}, 'title': {'desc': 'Movie title to use for searches. Has to be one of the titles returned by movie.search.'}, } }) addApiView('movie.edit', self.edit, docs = { 'desc': 'Add new movie to the wanted list', 'params': { 'id': {'desc': 'Movie ID(s) you want to edit.', 'type': 'int (comma separated)'}, 'profile_id': {'desc': 'ID of quality profile you want the edit the movie to.'}, 'category_id': {'desc': 'ID of category you want the add the movie in. If empty will use no category.'}, 'default_title': {'desc': 'Movie title to use for searches. Has to be one of the titles returned by movie.search.'}, } }) addEvent('movie.add', self.add) addEvent('movie.update', self.update) addEvent('movie.update_release_dates', self.updateReleaseDate)
def __init__(self): # Initialize this type super(MovieBase, self).__init__() self.initType() addApiView('movie.add', self.addView, docs = { 'desc': 'Add new movie to the wanted list', 'return': {'type': 'object', 'example': """{ 'success': True, 'movie': object }"""}, 'params': { 'identifier': {'desc': 'IMDB id of the movie your want to add.'}, 'profile_id': {'desc': 'ID of quality profile you want the add the movie in. If empty will use the default profile.'}, 'category_id': {'desc': 'ID of category you want the add the movie in. If empty will use no category.'}, 'title': {'desc': 'Movie title to use for searches. Has to be one of the titles returned by movie.search.'}, } }) addApiView('movie.edit', self.edit, docs = { 'desc': 'Add new movie to the wanted list', 'params': { 'id': {'desc': 'Movie ID(s) you want to edit.', 'type': 'int (comma separated)'}, 'profile_id': {'desc': 'ID of quality profile you want the edit the movie to.'}, 'category_id': {'desc': 'ID of category you want the add the movie in. If empty will use no category.'}, 'default_title': {'desc': 'Movie title to use for searches. Has to be one of the titles returned by movie.search.'}, } }) addEvent('movie.add', self.add) addEvent('movie.update', self.update) addEvent('movie.update_release_dates', self.updateReleaseDate)
def __init__(self): # Initialize this type super(MovieBase, self).__init__() self.initType() addApiView('movie.add', self.addView, docs = { 'desc': 'Add new movie to the wanted list', 'params': { 'identifier': {'desc': 'IMDB id of the movie your want to add.'}, 'profile_id': {'desc': 'ID of quality profile you want the add the movie in. If empty will use the default profile.'}, 'category_id': {'desc': 'ID of category you want the add the movie in. If empty will use no category.'}, 'title': {'desc': 'Movie title to use for searches. Has to be one of the titles returned by movie.search.'}, } }) addApiView('movie.edit', self.edit, docs = { 'desc': 'Add new movie to the wanted list', 'params': { 'id': {'desc': 'Movie ID(s) you want to edit.', 'type': 'int (comma separated)'}, 'profile_id': {'desc': 'ID of quality profile you want the edit the movie to.'}, 'category_id': {'desc': 'ID of category you want the add the movie in. If empty will use no category.'}, 'default_title': {'desc': 'Movie title to use for searches. Has to be one of the titles returned by movie.search.'}, } }) addEvent('movie.add', self.add)
def __init__(self): addEvent('searcher.all', self.allMovies) addEvent('searcher.single', self.single) addEvent('searcher.correct_movie', self.correctMovie) addEvent('searcher.download', self.download) addEvent('searcher.try_next_release', self.tryNextRelease) addApiView( 'searcher.try_next', self.tryNextReleaseView, docs={ 'desc': 'Marks the snatched results as ignored and try the next best release', 'params': { 'id': { 'desc': 'The id of the movie' }, }, }) # Schedule cronjob fireEvent('schedule.cron', 'searcher.all', self.allMovies, day=self.conf('cron_day'), hour=self.conf('cron_hour'), minute=self.conf('cron_minute'))
def __init__(self): addApiView('directory.list', self.view, docs={ 'desc': 'Return the directory list of a given directory', 'params': { 'path': { 'desc': 'The directory to scan' }, 'show_hidden': { 'desc': 'Also show hidden files' } }, 'return': { 'type': 'object', 'example': """{ 'is_root': bool, //is top most folder 'parent': string, //parent folder of requested path 'home': string, //user home folder 'empty': bool, //directory is empty 'dirs': array, //directory names }""" } })
def __init__(self): fireEvent('scheduler.interval', identifier = 'manage.update_library', handle = self.updateLibrary, hours = 2) addEvent('manage.update', self.updateLibrary) addEvent('manage.diskspace', self.getDiskSpace) # Add files after renaming def after_rename(message = None, group = None): if not group: group = {} return self.scanFilesToLibrary(folder = group['destination_dir'], files = group['renamed_files']) addEvent('renamer.after', after_rename, priority = 110) addApiView('manage.update', self.updateLibraryView, docs = { 'desc': 'Update the library by scanning for new movies', 'params': { 'full': {'desc': 'Do a full update or just recently changed/added movies.'}, } }) addApiView('manage.progress', self.getProgress, docs = { 'desc': 'Get the progress of current manage update', 'return': {'type': 'object', 'example': """{ 'progress': False || object, total & to_go, }"""}, }) if not Env.get('dev') and self.conf('startup_scan'): addEvent('app.load', self.updateLibraryQuick)
def __init__(self): addEvent('searcher.protocols', self.getSearchProtocols) addEvent('searcher.contains_other_quality', self.containsOtherQuality) addEvent('searcher.correct_3d', self.correct3D) addEvent('searcher.correct_year', self.correctYear) addEvent('searcher.correct_name', self.correctName) addEvent('searcher.correct_words', self.correctWords) addEvent('searcher.correct_language', self.correctLanguage) addEvent('searcher.search', self.search) addApiView('searcher.full_search', self.searchAllView, docs={ 'desc': 'Starts a full search for all media', }) addApiView('searcher.progress', self.getProgressForAll, docs={ 'desc': 'Get the progress of all media searches', 'return': { 'type': 'object', 'example': """{ 'movie': False || object, total & to_go, 'show': False || object, total & to_go, }""" }, })
def __init__(self): super(Twitter, self).__init__() addApiView('notify.%s.auth_url' % self.getName().lower(), self.getAuthorizationUrl) addApiView('notify.%s.credentials' % self.getName().lower(), self.getCredentials)
def __init__(self): addApiView('renamer.scan', self.scanView, docs={ 'desc': 'For the renamer to check for new files to rename', }) addEvent('renamer.scan', self.scan) addEvent('renamer.check_snatched', self.checkSnatched) addEvent('app.load', self.scan) addEvent('app.load', self.checkSnatched) if self.conf('run_every') > 0: fireEvent('schedule.interval', 'renamer.check_snatched', self.checkSnatched, minutes=self.conf('run_every')) if self.conf('force_every') > 0: fireEvent('schedule.interval', 'renamer.check_snatched_forced', self.scan, hours=self.conf('force_every'))
def __init__(self): addEvent('quality.all', self.all) addEvent('quality.single', self.single) addEvent('quality.guess', self.guess) addEvent('quality.pre_releases', self.preReleases) addEvent('quality.order', self.getOrder) addEvent('quality.ishigher', self.isHigher) addEvent('quality.isfinish', self.isFinish) addEvent('quality.fill', self.fill) addApiView('quality.size.save', self.saveSize) addApiView('quality.list', self.allView, docs = { 'desc': 'List all available qualities', 'return': {'type': 'object', 'example': """{ 'success': True, 'list': array, qualities }"""} }) addEvent('app.initialize', self.fill, priority = 10) addEvent('app.load', self.fillBlank, priority = 120) addEvent('app.test', self.doTest) self.order = [] self.addOrder()
def __init__(self): addEvent('quality.all', self.all) addEvent('quality.single', self.single) addEvent('quality.guess', self.guess) addEvent('quality.pre_releases', self.preReleases) addApiView('quality.size.save', self.saveSize) addApiView('quality.list', self.allView, docs={ 'desc': 'List all available qualities', 'return': { 'type': 'object', 'example': """{ 'success': True, 'list': array, qualities }""" } }) addEvent('app.initialize', self.fill, priority=10) addEvent('app.test', self.doTest)
def __init__(self): addEvent('quality.all', self.all) addEvent('quality.single', self.single) addEvent('quality.guess', self.guess) addEvent('quality.pre_releases', self.preReleases) addEvent('quality.order', self.getOrder) addEvent('quality.ishigher', self.isHigher) addEvent('quality.isfinish', self.isFinish) addEvent('quality.fill', self.fill) addApiView('quality.size.save', self.saveSize) addApiView('quality.list', self.allView, docs={ 'desc': 'List all available qualities', 'return': { 'type': 'object', 'example': """{ 'success': True, 'list': array, qualities }""" } }) addEvent('app.initialize', self.fill, priority=10) addEvent('app.load', self.fillBlank, priority=120) addEvent('app.test', self.doTest) self.order = [] self.addOrder()
def __init__(self): addApiView( 'search', self.search, docs={ 'desc': 'Search the info in providers for a movie', 'params': { 'q': { 'desc': 'The (partial) movie name you want to search for' }, 'type': { 'desc': 'Search for a specific media type. Leave empty to search all.' }, }, 'return': { 'type': 'object', 'example': """{ 'success': True, 'movies': array, 'show': array, etc }""" } }) addEvent('app.load', self.addSingleSearches)
def addSingleCharView(self): for media_type in fireEvent('media.types', merge=True): def tempChar(*args, **kwargs): return self.charView(types=media_type, *args, **kwargs) addApiView('%s.available_chars' % media_type, tempChar)
def __init__(self): addEvent('status.add', self.add) addEvent('status.get', self.add) # Alias for .add addEvent('status.get_by_id', self.getById) addEvent('status.all', self.all) addEvent('app.initialize', self.fill) addApiView('status.list', self.list)
def addSingleDeleteView(self): for media_type in fireEvent("media.types", merge=True): def tempDelete(*args, **kwargs): return self.deleteView(types=media_type, *args, **kwargs) addApiView("%s.delete" % media_type, tempDelete)
def addSingleCharView(self): for media_type in fireEvent("media.types", merge=True): def tempChar(*args, **kwargs): return self.charView(types=media_type, *args, **kwargs) addApiView("%s.available_chars" % media_type, tempChar)
def addSingleListView(self): for media_type in fireEvent("media.types", merge=True): def tempList(*args, **kwargs): return self.listView(types=media_type, *args, **kwargs) addApiView("%s.list" % media_type, tempList)
def __init__(self): addApiView('renamer.scan', self.scanView, docs = { 'desc': 'For the renamer to check for new files to rename', }) addEvent('renamer.scan', self.scan) addEvent('app.load', self.scan)
def addSingleListView(self): for media_type in fireEvent('media.types', merge=True): def tempList(*args, **kwargs): return self.listView(types=media_type, *args, **kwargs) addApiView('%s.list' % media_type, tempList)
def __init__(self): addApiView("renamer.scan", self.scanView) addEvent("renamer.scan", self.scan) addEvent("app.load", self.scan) fireEvent("schedule.interval", "renamer.scan", self.scan, minutes=self.conf("run_every"))
def addSingleDeleteView(self): for media_type in fireEvent('media.types', merge=True): def tempDelete(*args, **kwargs): return self.deleteView(types=media_type, *args, **kwargs) addApiView('%s.delete' % media_type, tempDelete)
def __init__(self): addEvent('quality.all', self.all) addEvent('quality.single', self.single) addEvent('quality.guess', self.guess) addApiView('quality.size.save', self.saveSize) addEvent('app.initialize', self.fill, priority = 10)
def __init__(self): addApiView('renamer.scan', self.scanView) addEvent('renamer.scan', self.scan) addEvent('app.load', self.scan) fireEvent('schedule.interval', 'renamer.scan', self.scan, minutes = self.conf('run_every'))
def __init__(self): addApiView('userscript.get/<random>/<path:filename>', self.getUserScript, static = True) addApiView('userscript', self.iFrame) addApiView('userscript.add_via_url', self.getViaUrl) addApiView('userscript.includes', self.getIncludes) addApiView('userscript.bookmark', self.bookmark) addEvent('userscript.get_version', self.getVersion)
def __init__(self): super(Trakt, self).__init__() addApiView('automation.trakt.auth_url', self.getAuthorizationUrl) addApiView('automation.trakt.credentials', self.getCredentials) fireEvent('schedule.interval', 'updater.check', self.refreshToken, hours = 24) addEvent('app.load', self.refreshToken)
def __init__(self): addEvent('notify', self.notify) addEvent('notify.frontend', self.frontend) addApiView('core_notifier.listener', self.listener) self.registerEvents()
def __init__(self): addApiView("renamer.scan", self.scanView, docs={"desc": "For the renamer to check for new files to rename"}) addEvent("renamer.scan", self.scan) addEvent("app.load", self.scan) fireEvent("schedule.interval", "renamer.scan", self.scan, minutes=self.conf("run_every"))
def __init__(self): addEvent('download', self._download) addEvent('download.enabled', self._isEnabled) addEvent('download.enabled_protocols', self.getEnabledProtocol) addEvent('download.status', self._getAllDownloadStatus) addEvent('download.remove_failed', self._removeFailed) addEvent('download.pause', self._pause) addEvent('download.process_complete', self._processComplete) addApiView('download.%s.test' % self.getName().lower(), self._test)
def __init__(self): addEvent('notify.%s' % self.getName().lower(), self._notify) addApiView(self.testNotifyName(), self.test) # Attach listeners for listener in self.listen_to: if not listener in self.dont_listen_to: addEvent(listener, self.createNotifyHandler(listener))
def __init__(self): addEvent("release.add", self.add) addApiView( "release.add2", self.add2, docs={ "desc": "Add a release manually to a movie", "params": { "lib_id": {"type": "id", "desc": "ID of the Library in library-table"}, "qua_id": {"type": "id", "desc": "ID of the Quality in quality-table"}, "name": {"type": "string", "desc": "Name of the NZB file"}, }, }, ) addApiView( "release.download", self.download, docs={ "desc": "Send a release manually to the downloaders", "params": {"id": {"type": "id", "desc": "ID of the release object in release-table"}}, }, ) addApiView( "release.delete", self.deleteView, docs={ "desc": "Delete releases", "params": {"id": {"type": "id", "desc": "ID of the release object in release-table"}}, }, ) addApiView( "release.status", self.statusView, docs={ "desc": "Change the status of release", "params": { "id": {"type": "id", "desc": "ID of the release object in release-table"}, "status": { "type": "string: done, available, snatched, deleted", "desc": "New status for the release", }, }, }, ) addApiView( "release.ignore", self.ignore, docs={ "desc": "Toggle ignore, for bad or wrong releases", "params": {"id": {"type": "id", "desc": "ID of the release object in release-table"}}, }, ) addEvent("release.delete", self.delete) addEvent("release.status", self.status) addEvent("release.clean", self.clean)
def __init__(self): addApiView('userscript.get/(.*)/(.*)', self.getUserScript, static=True) addApiView('userscript', self.iFrame) addApiView('userscript.add_via_url', self.getViaUrl) addApiView('userscript.includes', self.getIncludes) addApiView('userscript.bookmark', self.bookmark) addEvent('userscript.get_version', self.getVersion)
def __init__(self): addApiView('media.refresh', self.refresh, docs = { 'desc': 'Refresh a any media type by ID', 'params': { 'id': {'desc': 'Movie, Show, Season or Episode ID(s) you want to refresh.', 'type': 'int (comma separated)'}, } }) addApiView('media.list', self.listView, docs = { 'desc': 'List media', 'params': { 'type': {'type': 'string', 'desc': 'Media type to filter on.'}, 'status': {'type': 'array or csv', 'desc': 'Filter media by status. Example:"active,done"'}, 'release_status': {'type': 'array or csv', 'desc': 'Filter media by status of its releases. Example:"snatched,available"'}, 'limit_offset': {'desc': 'Limit and offset the media list. Examples: "50" or "50,30"'}, 'starts_with': {'desc': 'Starts with these characters. Example: "a" returns all media starting with the letter "a"'}, 'search': {'desc': 'Search media title'}, }, 'return': {'type': 'object', 'example': """{ 'success': True, 'empty': bool, any media returned or not, 'media': array, media found, }"""} }) addApiView('media.get', self.getView, docs = { 'desc': 'Get media by id', 'params': { 'id': {'desc': 'The id of the media'}, } }) addApiView('media.delete', self.deleteView, docs = { 'desc': 'Delete a media from the wanted list', 'params': { 'id': {'desc': 'Media ID(s) you want to delete.', 'type': 'int (comma separated)'}, 'delete_from': {'desc': 'Delete media from this page', 'type': 'string: all (default), wanted, manage'}, } }) addApiView('media.available_chars', self.charView) addEvent('app.load', self.addSingleRefreshView, priority = 100) addEvent('app.load', self.addSingleListView, priority = 100) addEvent('app.load', self.addSingleCharView, priority = 100) addEvent('app.load', self.addSingleDeleteView, priority = 100) addEvent('app.load', self.cleanupFaults) addEvent('media.get', self.get) addEvent('media.with_status', self.withStatus) addEvent('media.with_identifiers', self.withIdentifiers) addEvent('media.list', self.list) addEvent('media.delete', self.delete) addEvent('media.restatus', self.restatus) addEvent('media.tag', self.tag) addEvent('media.untag', self.unTag)
def __init__(self): add_event('download', self._download) add_event('download.enabled', self._is_enabled) add_event('download.enabled_protocols', self.get_enabled_protocol) add_event('download.status', self._get_all_download_status) add_event('download.remove_failed', self._remove_failed) add_event('download.pause', self._pause) add_event('download.process_complete', self._process_complete) addApiView('download.%s.test' % self.getName().lower(), self._test)
def __init__(self): fireEvent('scheduler.interval', identifier = 'manage.update_library', handle = self.updateLibrary, hours = 2) addEvent('manage.update', self.updateLibrary) addApiView('manage.update', self.updateLibraryView) if not Env.setting('development'): addEvent('app.load', self.updateLibrary)
def __init__(self): addEvent('queue.sort', self.queueSort) addApiView('queue.sort', self.queueSortView, docs = { 'desc': 'Sort the view', 'params': { 'full': {'desc': 'Do a full update or just recently changed/added movies.'}, } })
def __init__(self): addApiView( "settings", self.view, docs={ "desc": "Return the options and its values of settings.conf. Including the default values and group ordering used on the settings page.", "return": { "type": "object", "example": """{ // objects like in __init__.py of plugin "options": { "moovee" : { "groups" : [{ "description" : "SD movies only", "name" : "#alt.binaries.moovee", "options" : [{ "default" : false, "name" : "enabled", "type" : "enabler" }], "tab" : "providers" }], "name" : "moovee" } }, // object structured like settings.conf "values": { "moovee": { "enabled": false } } }""", }, }, ) addApiView( "settings.save", self.saveView, docs={ "desc": "Save setting to config file (settings.conf)", "params": { "section": {"desc": "The section name in settings.conf"}, "name": {"desc": "The option name"}, "value": {"desc": "The value you want to save"}, }, }, ) addEvent("database.setup", self.databaseSetup) self.file = None self.p = None self.log = None self.directories_delimiter = "::"
def __init__(self): addApiView('media.refresh', self.refresh, docs = { 'desc': 'Refresh a any media type by ID', 'params': { 'id': {'desc': 'Movie, Show, Season or Episode ID(s) you want to refresh.', 'type': 'int (comma separated)'}, } }) addApiView('media.list', self.listView, docs = { 'desc': 'List media', 'params': { 'type': {'type': 'string', 'desc': 'Media type to filter on.'}, 'status': {'type': 'array or csv', 'desc': 'Filter media by status. Example:"active,done"'}, 'release_status': {'type': 'array or csv', 'desc': 'Filter media by status of its releases. Example:"snatched,available"'}, 'limit_offset': {'desc': 'Limit and offset the media list. Examples: "50" or "50,30"'}, 'starts_with': {'desc': 'Starts with these characters. Example: "a" returns all media starting with the letter "a"'}, 'search': {'desc': 'Search media title'}, }, 'return': {'type': 'object', 'example': """{ 'success': True, 'empty': bool, any media returned or not, 'media': array, media found, }"""} }) addApiView('media.get', self.getView, docs = { 'desc': 'Get media by id', 'params': { 'id': {'desc': 'The id of the media'}, } }) addApiView('media.delete', self.deleteView, docs = { 'desc': 'Delete a media from the wanted list', 'params': { 'id': {'desc': 'Media ID(s) you want to delete.', 'type': 'int (comma separated)'}, 'delete_from': {'desc': 'Delete media from this page', 'type': 'string: all (default), wanted, manage'}, } }) addApiView('media.available_chars', self.charView) addEvent('app.load', self.addSingleRefreshView, priority = 100) addEvent('app.load', self.addSingleListView, priority = 100) addEvent('app.load', self.addSingleCharView, priority = 100) addEvent('app.load', self.addSingleDeleteView, priority = 100) addEvent('media.get', self.get) addEvent('media.with_status', self.withStatus) addEvent('media.with_identifiers', self.withIdentifiers) addEvent('media.list', self.list) addEvent('media.delete', self.delete) addEvent('media.restatus', self.restatus) addEvent('media.tag', self.tag) addEvent('media.untag', self.unTag)
def __init__(self): addApiView('media.refresh', self.refresh, docs = { 'desc': 'Refresh a any media type by ID', 'params': { 'id': {'desc': 'Movie, Show, Season or Episode ID(s) you want to refresh.', 'type': 'int (comma separated)'}, } }) addEvent('app.load', self.addSingleRefresh)
def __init__(self): addApiView('renamer.scan', self.scanView, docs = { 'desc': 'For the renamer to check for new files to rename', }) addEvent('renamer.scan', self.scan) addEvent('app.load', self.scan) fireEvent('schedule.interval', 'renamer.scan', self.scan, minutes = self.conf('run_every'))
def __init__(self): self.repo = LocalRepository(Env.get('app_dir'), command = self.conf('git_command', default = 'git')) fireEvent('schedule.interval', 'updater.check', self.check, hours = 6) addEvent('app.load', self.check) addApiView('updater.info', self.getInfo) addApiView('updater.update', self.doUpdateView)
def __init__(self): addApiView('userscript.get/(.*)/(.*)', self.getUserScript, static = True) addApiView('userscript', self.iFrame) addApiView('userscript.add_via_url', self.getViaUrl) addApiView('userscript.includes', self.getIncludes) addApiView('userscript.bookmark', self.bookmark) addEvent('userscript.get_version', self.getVersion) addEvent('app.test', self.doTest)
def __init__(self): addApiView('suggestion.view', self.suggestView) addApiView('suggestion.ignore', self.ignoreView) def test(): time.sleep(1) self.suggestView() addEvent('app.load', test)
def __init__(self): self.repo = LocalRepository(Env.get('app_dir')) fireEvent('schedule.interval', 'updater.check', self.check, hours=6) addEvent('app.load', self.check) addApiView('updater.info', self.getInfo) addApiView('updater.update', self.doUpdateView)
def __init__(self): addApiView('database.list_documents', self.listDocuments) addApiView('database.reindex', self.reindex) addApiView('database.compact', self.compact) addApiView('database.document.update', self.updateDocument) addApiView('database.document.delete', self.deleteDocument) addEvent('database.setup_index', self.setupIndex) addEvent('app.migrate', self.migrate)
def addSingleDeleteView(self): for media_type in fireEvent('media.types', merge = True): tempDelete = lambda *args, **kwargs : self.deleteView(type = media_type, **kwargs) addApiView('%s.delete' % media_type, tempDelete, docs = { 'desc': 'Delete a ' + media_type + ' from the wanted list', 'params': { 'id': {'desc': 'Media ID(s) you want to delete.', 'type': 'int (comma separated)'}, 'delete_from': {'desc': 'Delete ' + media_type + ' from this page', 'type': 'string: all (default), wanted, manage'}, } })
def __init__(self): addApiView('renamer.scan', self.scanView, docs={ 'desc': 'For the renamer to check for new files to rename', }) addEvent('renamer.scan', self.scan) addEvent('app.load', self.scan)
def __init__(self): addApiView('database.list_documents', self.listDocuments) addApiView('database.reindex', self.reindex) addApiView('database.compact', self.compact) addApiView('database.document.update', self.updateDocument) addApiView('database.document.delete', self.deleteDocument) addEvent('database.setup_index', self.setupIndex) addEvent('app.migrate', self.migrate) addEvent('app.after_shutdown', self.close)
def __init__(self): addApiView( 'settings', self.view, docs={ 'desc': 'Return the options and its values of settings.conf. Including the default values and group ordering used on the settings page.', 'return': { 'type': 'object', 'example': """{ // objects like in __init__.py of plugin "options": { "moovee" : { "groups" : [{ "description" : "SD movies only", "name" : "#alt.binaries.moovee", "options" : [{ "default" : false, "name" : "enabled", "type" : "enabler" }], "tab" : "providers" }], "name" : "moovee" } }, // object structured like settings.conf "values": { "moovee": { "enabled": false } } }""" } }) addApiView('settings.save', self.saveView, docs={ 'desc': 'Save setting to config file (settings.conf)', 'params': { 'section': { 'desc': 'The section name in settings.conf' }, 'option': { 'desc': 'The option name' }, 'value': { 'desc': 'The value you want to save' }, } })
def __init__(self): addEvent('file.add', self.add) addEvent('file.download', self.download) addEvent('file.types', self.getTypes) addApiView('file.cache/(.*)', self.showCacheFile, static=True, docs={ 'desc': 'Return a file from the cp_data/cache directory', 'params': { 'filename': { 'desc': 'path/filename of the wanted file' } }, 'return': { 'type': 'file' } }) addApiView('file.types', self.getTypesView, docs={ 'desc': 'Return a list of all the file types and their ids.', 'return': { 'type': 'object', 'example': """{ 'types': [ { "identifier": "poster_original", "type": "image", "id": 1, "name": "Poster_original" }, { "identifier": "poster", "type": "image", "id": 2, "name": "Poster" }, etc ] }""" } }) addEvent('app.load', self.cleanup) addEvent('app.load', self.init)
def __init__(self): addEvent('status.get', self.get) addEvent('status.get_by_id', self.getById) addEvent('status.all', self.all) addEvent('app.initialize', self.fill) addEvent('app.load', self.all) # Cache all statuses addApiView('status.list', self.list, docs = { 'desc': 'Check for available update', 'return': {'type': 'object', 'example': """{ 'success': True, 'list': array, statuses }"""} })