Merge pull request #246 from meisnate12/develop

v1.9.1
pull/289/head v1.9.1
meisnate12 4 years ago committed by GitHub
commit 69d6fbcd62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
# Plex Meta Manager
#### Version 1.9.0
#### Version 1.9.1
The original concept for Plex Meta Manager is [Plex Auto Collections](https://github.com/mza921/Plex-Auto-Collections), but this is rewritten from the ground up to be able to include a scheduler, metadata edits, multiple libraries, and logging. Plex Meta Manager is a Python 3 script that can be continuously run using YAML configuration files to update on a schedule the metadata of the movies, shows, and collections in your libraries as well as automatically build collections based on various methods all detailed in the wiki. Some collection examples that the script can automatically build and update daily include Plex Based Searches like actor, genre, or studio collections or Collections based on TMDb, IMDb, Trakt, TVDb, AniDB, or MyAnimeList lists and various other services.

File diff suppressed because it is too large Load Diff

@ -214,7 +214,6 @@ class CollectionBuilder:
self.backgrounds = {}
self.summaries = {}
self.schedule = ""
self.rating_key_map = {}
self.add_to_radarr = None
self.add_to_sonarr = None
current_time = datetime.now()
@ -1505,7 +1504,7 @@ class CollectionBuilder:
def sync_collection(self):
logger.info("")
count_removed = 0
for ratingKey, item in self.rating_key_map.items():
for ratingKey, item in self.plex_map.items():
if item is not None:
logger.info(f"{self.name} Collection | - | {item.title}")
if self.smart_label_collection:
@ -1518,9 +1517,11 @@ class CollectionBuilder:
def update_details(self):
if not self.obj and self.smart_url:
self.library.create_smart_collection(self.name, self.smart_type_key, self.smart_url)
elif not self.obj and self.smart_label_collection:
elif self.smart_label_collection:
try:
self.library.create_smart_labels(self.name, sort=self.smart_sort)
smart_type, self.smart_url = self.library.smart_label_url(self.name, self.smart_sort)
if not self.obj:
self.library.create_smart_collection(self.name, smart_type, self.smart_url)
except Failed:
raise Failed(f"Collection Error: Label: {self.name} was not added to any items in the Library")
self.obj = self.library.get_collection(self.name)

@ -439,16 +439,16 @@ class PlexAPI:
else: method = None
self.Plex._server.query(key, method=method)
def create_smart_labels(self, title, sort):
def smart_label_url(self, title, sort):
labels = self.get_labels()
if title not in labels:
raise Failed(f"Plex Error: Label: {title} does not exist")
smart_type = 1 if self.is_movie else 2
sort_type = movie_smart_sorts[sort] if self.is_movie else show_smart_sorts[sort]
uri_args = f"?type={smart_type}&sort={sort_type}&label={labels[title]}"
self.create_smart_collection(title, smart_type, uri_args)
return smart_type, f"?type={smart_type}&sort={sort_type}&label={labels[title]}"
def create_smart_collection(self, title, smart_type, uri_args):
logger.debug(f"Smart Collection Created: {uri_args}")
args = {
"type": smart_type,
"title": title,

@ -92,7 +92,7 @@ util.centered("| |_) | |/ _ \\ \\/ / | |\\/| |/ _ \\ __/ _` | | |\\/| |/ _` | '_
util.centered("| __/| | __/> < | | | | __/ || (_| | | | | | (_| | | | | (_| | (_| | __/ | ")
util.centered("|_| |_|\\___/_/\\_\\ |_| |_|\\___|\\__\\__,_| |_| |_|\\__,_|_| |_|\\__,_|\\__, |\\___|_| ")
util.centered(" |___/ ")
util.centered(" Version: 1.9.0 ")
util.centered(" Version: 1.9.1 ")
util.separator()
def start(config_path, is_test, daily, requested_collections, requested_libraries, resume_from):

Loading…
Cancel
Save