Ejemplo n.º 1
0
    async def post(self, *args, **kwargs):
        pp_options = {
            'proc_dir': self.get_argument('proc_dir'),
            'nzbname': self.get_argument('nzbname', ''),
            'process_method': self.get_argument('process_method'),
            'proc_type': self.get_argument('proc_type'),
            'force': arg_to_bool(self.get_argument('force', 'false')),
            'is_priority': arg_to_bool(self.get_argument('is_priority', 'false')),
            'delete_on': arg_to_bool(self.get_argument('delete_on', 'false')),
            'force_next': arg_to_bool(self.get_argument('force_next', 'false')),
            'failed': arg_to_bool(self.get_argument('failed', 'false')),
            'quiet': arg_to_bool(self.get_argument('quiet', 'false')),
        }

        proc_dir = pp_options.pop("proc_dir")
        quiet = pp_options.pop("quiet")

        if not proc_dir:
            return self.redirect("/home/postprocess/")

        result = sickrage.app.postprocessor_queue.put(proc_dir, **pp_options)
        if quiet:
            return self.write(result)

        return self._genericMessage(_("Postprocessing results"), result.replace("\n", "<br>\n"))
Ejemplo n.º 2
0
    def post(self, *args, **kwargs):
        pp_options = {
            'proc_dir': self.get_argument('proc_dir'),
            'nzbname': self.get_argument('nzbname', ''),
            'process_method': self.get_argument('process_method', sickrage.app.config.general.process_method),
            'proc_type': self.get_argument('proc_type', 'manual'),
            'force': arg_to_bool(self.get_argument('force', 'false')),
            'is_priority': arg_to_bool(self.get_argument('is_priority', 'false')),
            'delete_on': arg_to_bool(self.get_argument('delete_on', 'false')),
            'force_next': arg_to_bool(self.get_argument('force_next', 'false')),
            'failed': arg_to_bool(self.get_argument('failed', 'false')),
            'quiet': arg_to_bool(self.get_argument('quiet', 'false')),
        }

        proc_dir = pp_options.pop("proc_dir")
        quiet = pp_options.pop("quiet")

        if not proc_dir:
            return self.redirect("/home/postprocess/")

        if not isinstance(pp_options['process_method'], ProcessMethod):
            pp_options['process_method'] = ProcessMethod[pp_options['process_method'].upper()]

        result = sickrage.app.postprocessor_queue.put(proc_dir, **pp_options)
        if quiet:
            return result

        return self._genericMessage(_("Postprocessing results"), result.replace("\n", "<br>\n"))