fix arr error and add custom sort to flixpatrol builders

This commit is contained in:
meisnate12 2021-12-01 08:17:28 -05:00
parent 03e77ab2ac
commit 4b40ca2a68
4 changed files with 21 additions and 3 deletions

View file

@ -151,6 +151,7 @@ custom_sort_builders = [
"tvdb_list", "imdb_list", "stevenlu_popular", "anidb_popular",
"trakt_list", "trakt_trending", "trakt_popular", "trakt_boxoffice",
"trakt_collected_daily", "trakt_collected_weekly", "trakt_collected_monthly", "trakt_collected_yearly", "trakt_collected_all",
"flixpatrol_url", "flixpatrol_demographics", "flixpatrol_popular", "flixpatrol_top",
"trakt_recommended_daily", "trakt_recommended_weekly", "trakt_recommended_monthly", "trakt_recommended_yearly", "trakt_recommended_all",
"trakt_watched_daily", "trakt_watched_weekly", "trakt_watched_monthly", "trakt_watched_yearly", "trakt_watched_all",
"tautulli_popular", "tautulli_watched", "letterboxd_list", "icheckmovies_list",

View file

@ -1,5 +1,4 @@
import logging
from datetime import datetime, timedelta
from modules import util
from modules.util import Failed

View file

@ -55,6 +55,7 @@ class Radarr:
added = []
exists = []
skipped = []
invalid = []
movies = []
for i, item in enumerate(tmdb_ids, 1):
@ -64,7 +65,7 @@ class Radarr:
if self.config.Cache:
_id = self.config.Cache.query_radarr_adds(tmdb_id, self.library.original_mapping_name)
if _id:
exists.append(item)
skipped.append(item)
continue
try:
movie = self.api.get_movie(tmdb_id=tmdb_id)
@ -98,6 +99,14 @@ class Radarr:
self.config.Cache.update_radarr_adds(movie.tmdbId, self.library.original_mapping_name)
logger.info(f"{len(exists)} Movie{'s' if len(exists) > 1 else ''} already existing in Radarr")
if len(skipped) > 0:
logger.info("")
for movie in skipped:
logger.info(f"Skipped: In Cache | {movie}")
if self.config.Cache:
self.config.Cache.update_radarr_adds(movie[0] if isinstance(movie, tuple) else movie, self.library.original_mapping_name)
logger.info(f"{len(skipped)} Movie{'s' if len(skipped) > 1 else ''} already existing in Radarr")
if len(invalid) > 0:
logger.info("")
for tmdb_id in invalid:

View file

@ -81,6 +81,7 @@ class Sonarr:
added = []
exists = []
skipped = []
invalid = []
shows = []
for i, item in enumerate(tvdb_ids, 1):
@ -90,7 +91,7 @@ class Sonarr:
if self.config.Cache:
_id = self.config.Cache.query_sonarr_adds(tvdb_id, self.library.original_mapping_name)
if _id:
exists.append(item)
skipped.append(item)
continue
try:
show = self.api.get_series(tvdb_id=tvdb_id)
@ -124,6 +125,14 @@ class Sonarr:
self.config.Cache.update_sonarr_adds(series.tvdbId, self.library.original_mapping_name)
logger.info(f"{len(exists)} Series already existing in Sonarr")
if len(skipped) > 0:
logger.info("")
for series in skipped:
logger.info(f"Skipped: In Cache | {series}")
if self.config.Cache:
self.config.Cache.update_sonarr_adds(series[0] if isinstance(series, tuple) else series, self.library.original_mapping_name)
logger.info(f"{len(skipped)} Movie{'s' if len(skipped) > 1 else ''} already existing in Sonarr")
if len(invalid) > 0:
for tvdb_id in invalid:
logger.info("")