mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-10 06:54:21 +00:00
bug fixes and added schedule never
This commit is contained in:
parent
4d27090f44
commit
c91dd7f3cc
4 changed files with 68 additions and 26 deletions
|
@ -19,19 +19,22 @@ settings: # Can be individually specified
|
|||
asset_directory: config/assets
|
||||
asset_folders: true
|
||||
create_asset_folders: false
|
||||
show_missing_season_assets: false
|
||||
sync_mode: append
|
||||
collection_minimum: 1
|
||||
delete_below_minimum: true
|
||||
delete_not_scheduled: false
|
||||
run_again_delay: 2
|
||||
missing_only_released: false
|
||||
only_filter_missing: false
|
||||
show_unmanaged: true
|
||||
show_filtered: false
|
||||
show_missing: true
|
||||
show_missing_assets: true
|
||||
save_missing: true
|
||||
run_again_delay: 2
|
||||
missing_only_released: false
|
||||
only_filter_missing: false
|
||||
collection_minimum: 1
|
||||
delete_below_minimum: true
|
||||
delete_not_scheduled: false
|
||||
tvdb_language: eng
|
||||
ignore_ids:
|
||||
ignore_imdb_ids:
|
||||
webhooks: # Can be individually specified per library as well
|
||||
error:
|
||||
run_start:
|
||||
|
|
|
@ -50,15 +50,22 @@ country_codes = [
|
|||
class AniList:
|
||||
def __init__(self, config):
|
||||
self.config = config
|
||||
self.options = {
|
||||
self._options = None
|
||||
|
||||
@property
|
||||
def options(self):
|
||||
if self._options:
|
||||
return self._options
|
||||
self._options = {
|
||||
"Tag": {}, "Tag Category": {},
|
||||
"Genre": {g.lower().replace(" ", "-"): g for g in self._request(genre_query, {})["data"]["GenreCollection"]},
|
||||
"Country": {c: c.upper() for c in country_codes},
|
||||
"Season": media_season, "Format": media_format, "Status": media_status, "Source": media_source,
|
||||
}
|
||||
for media_tag in self._request(tag_query, {})["data"]["MediaTagCollection"]:
|
||||
self.options["Tag"][media_tag["name"].lower().replace(" ", "-")] = media_tag["name"]
|
||||
self.options["Tag Category"][media_tag["category"].lower().replace(" ", "-")] = media_tag["category"]
|
||||
self._options["Tag"][media_tag["name"].lower().replace(" ", "-")] = media_tag["name"]
|
||||
self._options["Tag Category"][media_tag["category"].lower().replace(" ", "-")] = media_tag["category"]
|
||||
return self._options
|
||||
|
||||
def _request(self, query, variables, level=1):
|
||||
if self.config.trace_mode:
|
||||
|
|
|
@ -351,7 +351,7 @@ class CollectionBuilder:
|
|||
logger.debug(f"Value: {data[methods['delete_not_scheduled']]}")
|
||||
self.details["delete_not_scheduled"] = util.parse("delete_not_scheduled", self.data, datatype="bool", methods=methods, default=False)
|
||||
|
||||
if "schedule" in methods:
|
||||
if "schedule" in methods and not config.requested_collections:
|
||||
logger.debug("")
|
||||
logger.debug("Validating Method: schedule")
|
||||
if not self.data[methods["schedule"]]:
|
||||
|
@ -366,6 +366,8 @@ class CollectionBuilder:
|
|||
run_time = str(schedule).lower()
|
||||
if run_time.startswith(("day", "daily")):
|
||||
skip_collection = False
|
||||
elif run_time == "never":
|
||||
self.schedule += f"\nNever scheduled to run"
|
||||
elif run_time.startswith(("hour", "week", "month", "year", "range")):
|
||||
match = re.search("\\(([^)]+)\\)", run_time)
|
||||
if not match:
|
||||
|
|
|
@ -10,22 +10,52 @@ anime_lists_url = "https://raw.githubusercontent.com/Fribb/anime-lists/master/an
|
|||
class Convert:
|
||||
def __init__(self, config):
|
||||
self.config = config
|
||||
self.anidb_ids = {}
|
||||
self.mal_to_anidb = {}
|
||||
self.anilist_to_anidb = {}
|
||||
self.anidb_to_imdb = {}
|
||||
self.anidb_to_tvdb = {}
|
||||
for anime_id in self.config.get_json(anime_lists_url):
|
||||
if "anidb_id" in anime_id:
|
||||
self.anidb_ids[anime_id["anidb_id"]] = anime_id
|
||||
if "mal_id" in anime_id:
|
||||
self.mal_to_anidb[int(anime_id["mal_id"])] = int(anime_id["anidb_id"])
|
||||
if "anilist_id" in anime_id:
|
||||
self.anilist_to_anidb[int(anime_id["anilist_id"])] = int(anime_id["anidb_id"])
|
||||
if "imdb_id" in anime_id and str(anime_id["imdb_id"]).startswith("tt"):
|
||||
self.anidb_to_imdb[int(anime_id["anidb_id"])] = util.get_list(anime_id["imdb_id"])
|
||||
if "thetvdb_id" in anime_id:
|
||||
self.anidb_to_tvdb[int(anime_id["anidb_id"])] = int(anime_id["thetvdb_id"])
|
||||
self._loaded = False
|
||||
self._anidb_ids = {}
|
||||
self._mal_to_anidb = {}
|
||||
self._anilist_to_anidb = {}
|
||||
self._anidb_to_imdb = {}
|
||||
self._anidb_to_tvdb = {}
|
||||
|
||||
@property
|
||||
def anidb_ids(self):
|
||||
self._load_anime_conversion()
|
||||
return self._anidb_ids
|
||||
|
||||
@property
|
||||
def mal_to_anidb(self):
|
||||
self._load_anime_conversion()
|
||||
return self._mal_to_anidb
|
||||
|
||||
@property
|
||||
def anilist_to_anidb(self):
|
||||
self._load_anime_conversion()
|
||||
return self._anilist_to_anidb
|
||||
|
||||
@property
|
||||
def anidb_to_imdb(self):
|
||||
self._load_anime_conversion()
|
||||
return self._anidb_to_imdb
|
||||
|
||||
@property
|
||||
def anidb_to_tvdb(self):
|
||||
self._load_anime_conversion()
|
||||
return self._anidb_to_tvdb
|
||||
|
||||
def _load_anime_conversion(self):
|
||||
if not self._loaded:
|
||||
for anime_id in self.config.get_json(anime_lists_url):
|
||||
if "anidb_id" in anime_id:
|
||||
self._anidb_ids[anime_id["anidb_id"]] = anime_id
|
||||
if "mal_id" in anime_id:
|
||||
self._mal_to_anidb[int(anime_id["mal_id"])] = int(anime_id["anidb_id"])
|
||||
if "anilist_id" in anime_id:
|
||||
self._anilist_to_anidb[int(anime_id["anilist_id"])] = int(anime_id["anidb_id"])
|
||||
if "imdb_id" in anime_id and str(anime_id["imdb_id"]).startswith("tt"):
|
||||
self._anidb_to_imdb[int(anime_id["anidb_id"])] = util.get_list(anime_id["imdb_id"])
|
||||
if "thetvdb_id" in anime_id:
|
||||
self._anidb_to_tvdb[int(anime_id["anidb_id"])] = int(anime_id["thetvdb_id"])
|
||||
self._loaded = True
|
||||
|
||||
def anidb_to_ids(self, anidb_ids, library):
|
||||
ids = []
|
||||
|
|
Loading…
Reference in a new issue