def __init__(self):
     addEvent('info.search', self.search, priority = 3)
     addEvent('movie.search', self.search, priority = 3)
     addEvent('movie.info', self.getInfo, priority = 3)
     addEvent('movie.info_by_tmdb', self.getInfo)
     addEvent('app.load', self.config)
     self.language = Env.setting('dl_language')
Example #2
0
    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.bookmark', self.bookmark)

        addEvent('userscript.get_version', self.getVersion)
Example #3
0
    def registerPlugin(self):
        addEvent('app.do_shutdown', self.doShutdown)
        addEvent('plugin.running', self.isRunning)
        self._running = []

        if self.auto_register_static:
            self.registerStatic(inspect.getfile(self.__class__))
Example #4
0
    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'},
            },
        })

        addApiView('searcher.full_search', self.allMoviesView, docs = {
            'desc': 'Starts a full search for all wanted movies',
        })

        addApiView('searcher.progress', self.getProgress, docs = {
            'desc': 'Get the progress of current full search',
            'return': {'type': 'object', 'example': """{
    'progress': False || object, total & to_go,
}"""},
        })

        # Schedule cronjob
        fireEvent('schedule.cron', 'searcher.all', self.allMovies, day = self.conf('cron_day'), hour = self.conf('cron_hour'), minute = self.conf('cron_minute'))
Example #5
0
    def __init__(self):

        if Env.get('desktop'):
            self.updater = DesktopUpdater()
        elif os.path.isdir(os.path.join(Env.get('app_dir'), '.git')):
            self.updater = GitUpdater(self.conf('git_command', default = 'git'))
        else:
            self.updater = SourceUpdater()

        fireEvent('schedule.interval', 'updater.check', self.autoUpdate, hours = 6)
        addEvent('app.load', self.autoUpdate)
        addEvent('updater.info', self.info)

        addApiView('updater.info', self.getInfo, docs = {
            'desc': 'Get updater information',
            'return': {
                'type': 'object',
                'example': """{
        'last_check': "last checked for update",
        'update_version': "available update version or empty",
        'version': current_cp_version
}"""}
        })
        addApiView('updater.update', self.doUpdateView)
        addApiView('updater.check', self.checkView, docs = {
            'desc': 'Check for available update',
            'return': {'type': 'see updater.info'}
        })
Example #6
0
    def __init__(self):
        addEvent("movie.info", self.getInfo, priority=3)
        addEvent("movie.info_by_tmdb", self.getInfo)

        # Configure TMDB settings
        tmdb3.set_key(self.conf("api_key"))
        tmdb3.set_cache("null")
Example #7
0
    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)
Example #8
0
    def __init__(self):
        super(Plex, self).__init__()

        self.clients = {}
        self.clients_updated = None

        addEvent('renamer.after', self.addToLibrary)
Example #9
0
    def __init__(self):
        super(Growl, self).__init__()

        self.growl = None

        if self.isEnabled():
            addEvent('app.load', self.register)
Example #10
0
    def addSignals(self):

        signal.signal(signal.SIGINT, self.onExit)
        signal.signal(signal.SIGTERM, lambda signum, stack_frame: sys.exit(1))

        from couchpotato.core.event import addEvent
        addEvent('app.after_shutdown', self.afterShutdown)
Example #11
0
    def __init__(self):

        if Env.get("desktop"):
            self.updater = DesktopUpdater()
        elif os.path.isdir(os.path.join(Env.get("app_dir"), ".git")):
            self.updater = GitUpdater(self.conf("git_command", default="git"))
        else:
            self.updater = SourceUpdater()

        fireEvent("schedule.interval", "updater.check", self.autoUpdate, hours=6)
        addEvent("app.load", self.autoUpdate)
        addEvent("updater.info", self.info)

        addApiView(
            "updater.info",
            self.getInfo,
            docs={
                "desc": "Get updater information",
                "return": {
                    "type": "object",
                    "example": """{
        'last_check': "last checked for update",
        'update_version': "available update version or empty",
        'version': current_cp_version
}""",
                },
            },
        )
        addApiView("updater.update", self.doUpdateView)
        addApiView(
            "updater.check",
            self.checkView,
            docs={"desc": "Check for available update", "return": {"type": "see updater.info"}},
        )
Example #12
0
    def __init__(self):
        super(CoreNotifier, self).__init__()

        addEvent('notify', self.notify)
        addEvent('notify.frontend', self.frontend)

        addApiView('notification.markread', self.markAsRead, docs = {
            'desc': 'Mark notifications as read',
            'params': {
                'ids': {'desc': 'Notification id you want to mark as read.', 'type': 'int (comma separated)'},
            },
        })

        addApiView('notification.list', self.listView, docs = {
            'desc': 'Get list of notifications',
            'params': {
                'limit_offset': {'desc': 'Limit and offset the notification list. Examples: "50" or "50,30"'},
            },
            'return': {'type': 'object', 'example': """{
    'success': True,
    'empty': bool, any notification returned or not,
    'notifications': array, notifications found,
}"""}
        })

        addApiView('notification.listener', self.listener)

        self.registerEvents()
Example #13
0
    def __init__(self):
        addEvent('release.add', self.add)

        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.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'}
            }
        })
        addApiView('release.for_movie', self.forMovieView, docs = {
            'desc': 'Returns all releases for a movie. Ordered by score(desc)',
            'params': {
                'id': {'type': 'id', 'desc': 'ID of the movie'}
            }
        })

        addEvent('release.for_movie', self.forMovie)
        addEvent('release.delete', self.delete)
        addEvent('release.clean', self.clean)
        addEvent('release.update_status', self.updateStatus)
Example #14
0
    def __init__(self):
        addEvent('movie.info', self.getInfo, priority = 3)
        addEvent('movie.info_by_tmdb', self.getInfo)

        # Configure TMDB settings
        tmdb3.set_key(self.conf('api_key'))
        tmdb3.set_cache('null')
Example #15
0
    def __init__(self):
        super(SearcherBase, self).__init__()

        addEvent('searcher.progress', self.getProgress)
        addEvent('%s.searcher.progress' % self.getType(), self.getProgress)

        self.initCron()
Example #16
0
    def __init__(self):
        #addApiView('movie.suggest', self.suggestView)

        addEvent('movie.info', self.getInfo, priority = 1)
        addEvent('movie.search', self.search, priority = 1)
        addEvent('movie.release_date', self.getReleaseDate)
        addEvent('movie.suggest', self.suggest)
        addEvent('movie.is_movie', self.isMovie)
Example #17
0
    def __init__(self):

        addEvent('notify', self.notify)
        addEvent('notify.frontend', self.frontend)

        addApiView('core_notifier.listener', self.listener)

        self.registerEvents()
Example #18
0
    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)
Example #19
0
    def __init__(self):
        addEvent('profile.all', self.all)

        addApiView('profile.save', self.save)
        addApiView('profile.save_order', self.saveOrder)
        addApiView('profile.delete', self.delete)

        addEvent('app.initialize', self.fill, priority = 90)
Example #20
0
    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'))
Example #21
0
    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)
Example #22
0
    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"))
Example #23
0
    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"))
Example #24
0
    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)
Example #25
0
    def __init__(self):
        super(Plex, self).__init__()

        self.server = PlexServer(self)

        self.client_protocols = {"http": PlexClientHTTP(self), "json": PlexClientJSON(self)}

        addEvent("renamer.after", self.addToLibrary)
Example #26
0
    def __init__(self):

        addEvent('scanner.create_file_identifier', self.createStringIdentifier)
        addEvent('scanner.remove_cptag', self.removeCPTag)

        addEvent('scanner.scan', self.scan)
        addEvent('scanner.name_year', self.getReleaseNameYear)
        addEvent('scanner.partnumber', self.getPartNumber)
Example #27
0
    def __init__(self):

        # Initialize this type
        super(MovieBase, self).__init__()
        self.initType()

        addApiView('movie.list', self.listView, docs = {
            'desc': 'List movies in wanted list',
            'params': {
                'status': {'type': 'array or csv', 'desc': 'Filter movie by status. Example:"active,done"'},
                'release_status': {'type': 'array or csv', 'desc': 'Filter movie by status of its releases. Example:"snatched,available"'},
                'limit_offset': {'desc': 'Limit and offset the movie list. Examples: "50" or "50,30"'},
                'starts_with': {'desc': 'Starts with these characters. Example: "a" returns all movies starting with the letter "a"'},
                'search': {'desc': 'Search movie title'},
            },
            'return': {'type': 'object', 'example': """{
    'success': True,
    'empty': bool, any movies returned or not,
    'movies': array, movies found,
}"""}
        })
        addApiView('movie.get', self.getView, docs = {
            'desc': 'Get a movie by id',
            'params': {
                'id': {'desc': 'The id of the movie'},
            }
        })
        addApiView('movie.available_chars', self.charView)
        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.'},
                'default_title': {'desc': 'Movie title to use for searches. Has to be one of the titles returned by movie.search.'},
            }
        })
        addApiView('movie.delete', self.deleteView, docs = {
            'desc': 'Delete a movie from the wanted list',
            'params': {
                'id': {'desc': 'Movie ID(s) you want to delete.', 'type': 'int (comma separated)'},
                'delete_from': {'desc': 'Delete movie from this page', 'type': 'string: all (default), wanted, manage'},
            }
        })

        addEvent('movie.add', self.add)
        addEvent('movie.delete', self.delete)
        addEvent('movie.get', self.get)
        addEvent('movie.list', self.list)
        addEvent('movie.restatus', self.restatus)
Example #28
0
    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)
Example #29
0
    def __init__(self):
        addApiView('downloader.putio.getfrom', self.getFromPutio, docs = {
            'desc': 'Allows you to download file from prom Put.io',
        })
        addApiView('downloader.putio.auth_url', self.getAuthorizationUrl)
        addApiView('downloader.putio.credentials', self.getCredentials)
        addEvent('putio.download', self.putioDownloader)

        return super(PutIO, self).__init__()
Example #30
0
    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)
Example #31
0
 def connectEvents(self):
     addEvent('settings.options', self.addOptions)
     addEvent('settings.register', self.registerDefaults)
     addEvent('settings.save', self.save)
Example #32
0
 def __init__(self):
     addEvent('library.add', self.add)
     addEvent('library.update', self.update)
     addEvent('library.update_release_date', self.updateReleaseDate)
Example #33
0
    def addSignals(self):
        signal.signal(signal.SIGINT, self.onExit)
        signal.signal(signal.SIGTERM, lambda signum, stack_frame: sys.exit(1))

        from couchpotato.core.event import addEvent
        addEvent('app.after_shutdown', self.afterShutdown)
Example #34
0
 def __init__(self):
     addEvent('renamer.after', self.create)
Example #35
0
    def __init__(self):
        super(rTorrent, self).__init__()

        addEvent('app.load', self.migrate)
Example #36
0
 def __init__(self):
     super(Synoindex, self).__init__()
     addEvent('renamer.after', self.addToLibrary)
Example #37
0
 def __init__(self):
     addEvent('userscript.get_includes', self.getInclude)
     addEvent('userscript.get_excludes', self.getExclude)
     addEvent('userscript.get_provider_version', self.getVersion)
     addEvent('userscript.get_movie_via_url', self.belongsTo)
Example #38
0
 def __init__(self):
     addEvent('renamer.after', self.callscript)
Example #39
0
 def __init__(self):
     addEvent('download', self.download)
     addEvent('download.status', self.getAllDownloadStatus)
     addEvent('download.remove_failed', self.removeFailed)
Example #40
0
    def __init__(self):
        addApiView('app.shutdown',
                   self.shutdown,
                   docs={
                       'desc': 'Shutdown the app.',
                       'return': {
                           'type': 'string: shutdown'
                       }
                   })
        addApiView('app.restart',
                   self.restart,
                   docs={
                       'desc': 'Restart the app.',
                       'return': {
                           'type': 'string: restart'
                       }
                   })
        addApiView('app.available',
                   self.available,
                   docs={'desc': 'Check if app available.'})
        addApiView('app.version',
                   self.versionView,
                   docs={'desc': 'Get version.'})

        addEvent('app.shutdown', self.shutdown)
        addEvent('app.restart', self.restart)
        addEvent('app.load', self.launchBrowser, priority=1)
        addEvent('app.base_url', self.createBaseUrl)
        addEvent('app.api_url', self.createApiUrl)
        addEvent('app.version', self.version)
        addEvent('app.load', self.checkDataDir)
        addEvent('app.load', self.cleanUpFolders)

        addEvent('setting.save.core.password', self.md5Password)
        addEvent('setting.save.core.api_key', self.checkApikey)

        # Make sure we can close-down with ctrl+c properly
        if not Env.get('desktop'):
            self.signalHandler()

        # Set default urlopen timeout
        import socket
        socket.setdefaulttimeout(30)

        # Don't check ssl by default
        try:
            if sys.version_info >= (2, 7, 9):
                import ssl
                ssl._create_default_https_context = ssl._create_unverified_context
        except:
            log.debug('Failed setting default ssl context: %s',
                      traceback.format_exc())
Example #41
0
 def __init__(self):
     addEvent('renamer.before', self.searchSingle)
Example #42
0
 def addEvent(*args, **kwargs):
     return addEvent(*args, **kwargs)
Example #43
0
    def __init__(self):

        addEvent('provider.movie.search', self.search)

        self.p = IMDb('http')
Example #44
0
 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)
Example #45
0
File: main.py Project: Arcylus/PBI
 def __init__(self):
     addEvent('renamer.after', self.searchSingle)
Example #46
0
 def __init__(self):
     addEvent('download', self._download)
     addEvent('download.enabled', self._isEnabled)
     addEvent('download.enabled_types', self.getEnabledDownloadType)
     addEvent('download.status', self._getAllDownloadStatus)
     addEvent('download.remove_failed', self._removeFailed)
Example #47
0
    def __init__(self):
        addEvent('release.add', self.add)

        addApiView('release.manual_download',
                   self.manualDownload,
                   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.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'
                           }
                       }
                   })
        addApiView(
            'release.for_movie',
            self.forMovieView,
            docs={
                'desc':
                'Returns all releases for a movie. Ordered by score(desc)',
                'params': {
                    'id': {
                        'type': 'id',
                        'desc': 'ID of the movie'
                    }
                }
            })

        addEvent('release.download', self.download)
        addEvent('release.try_download_result', self.tryDownloadResult)
        addEvent('release.create_from_search', self.createFromSearch)
        addEvent('release.for_movie', self.forMovie)
        addEvent('release.delete', self.delete)
        addEvent('release.clean', self.clean)
        addEvent('release.update_status', self.updateStatus)

        # Clean releases that didn't have activity in the last week
        addEvent('app.load', self.cleanDone)
        fireEvent('schedule.interval',
                  'movie.clean_releases',
                  self.cleanDone,
                  hours=4)
Example #48
0
    def __init__(self):
        addEvent('profile.all', self.all)

        addApiView('profile.save', self.save)
        addApiView('profile.delete', self.delete)
Example #49
0
    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)

        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)

        self.order = []
        self.addOrder()
Example #50
0
 def __init__(self):
     addEvent('info.search', self.search, priority=3)
     addEvent('movie.search', self.search, priority=3)
     addEvent('movie.info', self.getInfo, priority=3)
     addEvent('movie.info_by_tmdb', self.getInfo)
     addEvent('app.load', self.config)
Example #51
0
    def __init__(self):
        addApiView(self.testNotifyName(), self.test)
        addApiView('notify.nmj.auto_config', self.autoConfig)

        addEvent('renamer.after', self.addToLibrary)
Example #52
0
    def __init__(self):
        super(rTorrent, self).__init__()

        addEvent('app.load', self.migrate)
        addEvent('setting.save.rtorrent.*.after', self.settingsChanged)
    def __init__(self):
        addApiView('app.shutdown',
                   self.shutdown,
                   docs={
                       'desc': 'Shutdown the app.',
                       'return': {
                           'type': 'string: shutdown'
                       }
                   })
        addApiView('app.restart',
                   self.restart,
                   docs={
                       'desc': 'Restart the app.',
                       'return': {
                           'type': 'string: restart'
                       }
                   })
        addApiView('app.available',
                   self.available,
                   docs={'desc': 'Check if app available.'})
        addApiView('app.version',
                   self.versionView,
                   docs={'desc': 'Get version.'})

        addEvent('app.shutdown', self.shutdown)
        addEvent('app.restart', self.restart)
        addEvent('app.load', self.launchBrowser, priority=1)
        addEvent('app.base_url', self.createBaseUrl)
        addEvent('app.api_url', self.createApiUrl)
        addEvent('app.version', self.version)
        addEvent('app.load', self.checkDataDir)
        addEvent('app.load', self.cleanUpFolders)

        addEvent('setting.save.core.password', self.md5Password)
        addEvent('setting.save.core.api_key', self.checkApikey)

        # Make sure we can close-down with ctrl+c properly
        if not Env.get('desktop'):
            self.signalHandler()

        # Set default urlopen timeout
        import socket
        socket.setdefaulttimeout(30)
Example #54
0
 def __init__(self):
     addEvent('result.modify.movie.search', self.combineOnIMDB)
     addEvent('result.modify.movie.info', self.checkLibrary)
Example #55
0
 def __init__(self):
     addEvent('download', self.download)
     addEvent('download.status', self.getDownloadStatus)
Example #56
0
    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)
Example #57
0
    def __init__(self):
        addApiView(
            'movie.search',
            self.search,
            docs={
                'desc': 'Search the movie providers for a movie',
                'params': {
                    'q': {
                        'desc':
                        'The (partial) movie name you want to search for'
                    },
                },
                'return': {
                    'type':
                    'object',
                    'example':
                    """{
    'success': True,
    'empty': bool, any movies returned or not,
    'movies': array, movies found,
}"""
                }
            })
        addApiView(
            'movie.list',
            self.listView,
            docs={
                'desc': 'List movies in wanted list',
                'params': {
                    'status': {
                        'type': 'array or csv',
                        'desc': 'Filter movie by status. Example:"active,done"'
                    },
                    'release_status': {
                        'type':
                        'array or csv',
                        'desc':
                        'Filter movie by status of its releases. Example:"snatched,available"'
                    },
                    'limit_offset': {
                        'desc':
                        'Limit and offset the movie list. Examples: "50" or "50,30"'
                    },
                    'starts_with': {
                        'desc':
                        'Starts with these characters. Example: "a" returns all movies starting with the letter "a"'
                    },
                    'search': {
                        'desc': 'Search movie title'
                    },
                },
                'return': {
                    'type':
                    'object',
                    'example':
                    """{
    'success': True,
    'empty': bool, any movies returned or not,
    'movies': array, movies found,
}"""
                }
            })
        addApiView('movie.get',
                   self.getView,
                   docs={
                       'desc': 'Get a movie by id',
                       'params': {
                           'id': {
                               'desc': 'The id of the movie'
                           },
                       }
                   })
        addApiView('movie.refresh',
                   self.refresh,
                   docs={
                       'desc': 'Refresh a movie by id',
                       'params': {
                           'id': {
                               'desc': 'Movie ID(s) you want to refresh.',
                               'type': 'int (comma separated)'
                           },
                       }
                   })
        addApiView('movie.available_chars', self.charView)
        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.'
                    },
                    '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.'
                    },
                    'default_title': {
                        'desc':
                        'Movie title to use for searches. Has to be one of the titles returned by movie.search.'
                    },
                }
            })
        addApiView('movie.delete',
                   self.deleteView,
                   docs={
                       'desc': 'Delete a movie from the wanted list',
                       'params': {
                           'id': {
                               'desc': 'Movie ID(s) you want to delete.',
                               'type': 'int (comma separated)'
                           },
                           'delete_from': {
                               'desc': 'Delete movie from this page',
                               'type': 'string: all (default), wanted, manage'
                           },
                       }
                   })

        addEvent('movie.add', self.add)
        addEvent('movie.delete', self.delete)
        addEvent('movie.get', self.get)
        addEvent('movie.list', self.list)
        addEvent('movie.restatus', self.restatus)

        # Clean releases that didn't have activity in the last week
        addEvent('app.load', self.cleanReleases)
        fireEvent('schedule.interval',
                  'movie.clean_releases',
                  self.cleanReleases,
                  hours=4)
Example #58
0
File: base.py Project: Arcylus/PBI
 def registerPlugin(self):
     addEvent('app.do_shutdown', self.doShutdown)
     addEvent('plugin.running', self.isRunning)
Example #59
0
    def __init__(self):
        addEvent('renaming.after', self.add)

        addEvent('app.load', self.add)
Example #60
0
    def __init__(self):
        super(MovieSearcher, self).__init__()

        addEvent('movie.searcher.all', self.searchAll)
        addEvent('movie.searcher.all_view', self.searchAllView)
        addEvent('movie.searcher.single', self.single)
        addEvent('movie.searcher.try_next_release', self.tryNextRelease)
        addEvent('movie.searcher.could_be_released', self.couldBeReleased)
        addEvent('searcher.correct_release', self.correctRelease)
        addEvent('searcher.get_search_title', self.getSearchTitle)

        addApiView('movie.searcher.try_next', self.tryNextReleaseView, docs = {
            'desc': 'Marks the snatched results as ignored and try the next best release',
            'params': {
                'media_id': {'desc': 'The id of the media'},
            },
        })

        addApiView('movie.searcher.full_search', self.searchAllView, docs = {
            'desc': 'Starts a full search for all wanted movies',
        })

        addApiView('movie.searcher.progress', self.getProgress, docs = {
            'desc': 'Get the progress of current full search',
            'return': {'type': 'object', 'example': """{
    'progress': False || object, total & to_go,
}"""},
        })

        if self.conf('run_on_launch'):
            addEvent('app.load', self.searchAll)