def run(self, cli: radarr.RadarrCli, args: Namespace) -> None: super().run(cli, args) json_data = args.json if not json_data and args.file: with open(args.file, "r") as f: json_data = f.read() else: raise Exception("Invalid item data specified") info = radarr.RadarrMovieItem.from_json(json_data) res = cli.edit_movie(info) print(f"{json.dumps(res)}")
def run(self, cli: radarr.RadarrCli, args: Namespace) -> None: super().run(cli, args) # If keywords were specified, look for results and prompt for choice movie_info = None if args.terms: choices = cli.lookup_movie(term=args.terms) movie_info = select_item(args.terms, choices) # type: ignore # If no quality profile specified, list them qnd prompt for choice if not args.quality: args.quality = select_profile(cli) res = cli.add_movie( quality=args.quality, tmdb_id=args.tmdb, imdb_id=args.imdb, movie_info=movie_info, # type: ignore path=args.path, ) print(f"{json.dumps(res)}")
def run(self, cli: radarr.RadarrCli, args: Namespace) -> None: super().run(cli, args) res = cli.get_movie(args.mid) if args.json: if isinstance(res, list): json_objs = [item.to_json() for item in res] print(f"[{','.join(json_objs)}]") else: print(f"{res.to_json()}") else: print(res)
def run(self, cli: radarr.RadarrCli, args: Namespace) -> None: super().run(cli, args) res = cli.missing_movies_search() print(f"{json.dumps(res)}")
def run(self, cli: radarr.RadarrCli, args: Namespace) -> None: super().run(cli, args) res = cli.create_exclusion(args.title, args.id, args.year) print(f"{pformat(res)}\n")
def run(self, cli: radarr.RadarrCli, args: Namespace) -> None: super().run(cli, args) res = cli.rescan_movie(args.mid) print(res)
def run(self, cli: radarr.RadarrCli, args: Namespace) -> None: super().run(cli, args) res = cli.delete_movie(args.mid, delete_files=args.delfiles, add_exclusion=args.exclude) print(res)
def cli(): return RadarrCli(TEST_HOST, TEST_APIKEY)