mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-09-20 06:22:07 +00:00
fix arr error and add custom sort to flixpatrol builders
This commit is contained in:
parent
03e77ab2ac
commit
4b40ca2a68
4 changed files with 21 additions and 3 deletions
|
@ -151,6 +151,7 @@ custom_sort_builders = [
|
||||||
"tvdb_list", "imdb_list", "stevenlu_popular", "anidb_popular",
|
"tvdb_list", "imdb_list", "stevenlu_popular", "anidb_popular",
|
||||||
"trakt_list", "trakt_trending", "trakt_popular", "trakt_boxoffice",
|
"trakt_list", "trakt_trending", "trakt_popular", "trakt_boxoffice",
|
||||||
"trakt_collected_daily", "trakt_collected_weekly", "trakt_collected_monthly", "trakt_collected_yearly", "trakt_collected_all",
|
"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_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",
|
"trakt_watched_daily", "trakt_watched_weekly", "trakt_watched_monthly", "trakt_watched_yearly", "trakt_watched_all",
|
||||||
"tautulli_popular", "tautulli_watched", "letterboxd_list", "icheckmovies_list",
|
"tautulli_popular", "tautulli_watched", "letterboxd_list", "icheckmovies_list",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import logging
|
import logging
|
||||||
from datetime import datetime, timedelta
|
|
||||||
from modules import util
|
from modules import util
|
||||||
from modules.util import Failed
|
from modules.util import Failed
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ class Radarr:
|
||||||
|
|
||||||
added = []
|
added = []
|
||||||
exists = []
|
exists = []
|
||||||
|
skipped = []
|
||||||
invalid = []
|
invalid = []
|
||||||
movies = []
|
movies = []
|
||||||
for i, item in enumerate(tmdb_ids, 1):
|
for i, item in enumerate(tmdb_ids, 1):
|
||||||
|
@ -64,7 +65,7 @@ class Radarr:
|
||||||
if self.config.Cache:
|
if self.config.Cache:
|
||||||
_id = self.config.Cache.query_radarr_adds(tmdb_id, self.library.original_mapping_name)
|
_id = self.config.Cache.query_radarr_adds(tmdb_id, self.library.original_mapping_name)
|
||||||
if _id:
|
if _id:
|
||||||
exists.append(item)
|
skipped.append(item)
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
movie = self.api.get_movie(tmdb_id=tmdb_id)
|
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)
|
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")
|
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:
|
if len(invalid) > 0:
|
||||||
logger.info("")
|
logger.info("")
|
||||||
for tmdb_id in invalid:
|
for tmdb_id in invalid:
|
||||||
|
|
|
@ -81,6 +81,7 @@ class Sonarr:
|
||||||
|
|
||||||
added = []
|
added = []
|
||||||
exists = []
|
exists = []
|
||||||
|
skipped = []
|
||||||
invalid = []
|
invalid = []
|
||||||
shows = []
|
shows = []
|
||||||
for i, item in enumerate(tvdb_ids, 1):
|
for i, item in enumerate(tvdb_ids, 1):
|
||||||
|
@ -90,7 +91,7 @@ class Sonarr:
|
||||||
if self.config.Cache:
|
if self.config.Cache:
|
||||||
_id = self.config.Cache.query_sonarr_adds(tvdb_id, self.library.original_mapping_name)
|
_id = self.config.Cache.query_sonarr_adds(tvdb_id, self.library.original_mapping_name)
|
||||||
if _id:
|
if _id:
|
||||||
exists.append(item)
|
skipped.append(item)
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
show = self.api.get_series(tvdb_id=tvdb_id)
|
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)
|
self.config.Cache.update_sonarr_adds(series.tvdbId, self.library.original_mapping_name)
|
||||||
logger.info(f"{len(exists)} Series already existing in Sonarr")
|
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:
|
if len(invalid) > 0:
|
||||||
for tvdb_id in invalid:
|
for tvdb_id in invalid:
|
||||||
logger.info("")
|
logger.info("")
|
||||||
|
|
Loading…
Reference in a new issue