mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-22 12:33:10 +00:00
[58] Fix Radarr Adds
This commit is contained in:
parent
27835b5935
commit
002b6d669e
4 changed files with 11 additions and 5 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.18.0-develop57
|
||||
1.18.0-develop58
|
||||
|
|
|
@ -52,6 +52,7 @@ class FlixPatrol:
|
|||
|
||||
def _parse_list(self, list_url, language, is_movie, limit=0):
|
||||
flixpatrol_urls = []
|
||||
logger.trace(f"URL: {list_url}")
|
||||
if list_url.startswith(urls["top10"]):
|
||||
platform = list_url[len(urls["top10"]):].split("/")[0]
|
||||
flixpatrol_urls = self._request(
|
||||
|
@ -70,7 +71,7 @@ class FlixPatrol:
|
|||
list_url, language,
|
||||
f"//a[contains(@class, 'flex group') and .//span[.='{'Movie' if is_movie else 'TV Show'}']]/@href"
|
||||
)
|
||||
return flixpatrol_urls if limit == 0 else flixpatrol_urls[:limit]
|
||||
return flixpatrol_urls if limit == 0 else flixpatrol_urls[:limit]
|
||||
|
||||
def validate_flixpatrol_lists(self, flixpatrol_lists, language, is_movie):
|
||||
valid_lists = []
|
||||
|
|
|
@ -66,7 +66,9 @@ class MyLogger:
|
|||
_handler = RotatingFileHandler(log_file, delay=True, mode="w", backupCount=count, encoding="utf-8")
|
||||
self._formatter(_handler)
|
||||
if os.path.isfile(log_file):
|
||||
self._logger.removeHandler(_handler)
|
||||
_handler.doRollover()
|
||||
self._logger.addHandler(_handler)
|
||||
return _handler
|
||||
|
||||
def _formatter(self, handler, border=True):
|
||||
|
|
|
@ -53,6 +53,7 @@ class Radarr:
|
|||
logger.debug(f"Radarr Adds: {_ids if _ids else ''}")
|
||||
for tmdb_id in _paths:
|
||||
logger.debug(tmdb_id)
|
||||
logger.trace("")
|
||||
upgrade_existing = options["upgrade_existing"] if "upgrade_existing" in options else self.upgrade_existing
|
||||
folder = options["folder"] if "folder" in options else self.root_folder_path
|
||||
monitor = options["monitor"] if "monitor" in options else self.monitor
|
||||
|
@ -67,6 +68,7 @@ class Radarr:
|
|||
logger.trace(f"Quality Profile: {quality_profile}")
|
||||
logger.trace(f"Tags: {tags}")
|
||||
logger.trace(f"Search: {search}")
|
||||
logger.trace("")
|
||||
|
||||
arr_paths = {}
|
||||
arr_ids = {}
|
||||
|
@ -76,6 +78,7 @@ class Radarr:
|
|||
arr_ids[movie.tmdbId] = movie
|
||||
logger.trace(arr_paths)
|
||||
logger.trace(arr_ids)
|
||||
logger.trace("")
|
||||
|
||||
added = []
|
||||
exists = []
|
||||
|
@ -97,13 +100,13 @@ class Radarr:
|
|||
_id = self.config.Cache.query_radarr_adds(tmdb_id, self.library.original_mapping_name)
|
||||
if _id:
|
||||
skipped.append(item)
|
||||
continue
|
||||
raise Continue
|
||||
if tmdb_id in arr_ids:
|
||||
exists.append(arr_ids[tmdb_id])
|
||||
continue
|
||||
raise Continue
|
||||
if path and path.lower() in arr_paths:
|
||||
mismatched[path] = tmdb_id
|
||||
continue
|
||||
raise Continue
|
||||
if path and not path.startswith(folder):
|
||||
invalid_root.append(item)
|
||||
raise Continue
|
||||
|
|
Loading…
Reference in a new issue