diff --git a/VERSION b/VERSION index 19f03be9..a9dfae41 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.16.5-develop61 +1.16.5-develop62 diff --git a/docs/config/paths.md b/docs/config/paths.md index ca0d8264..4498c3c2 100644 --- a/docs/config/paths.md +++ b/docs/config/paths.md @@ -51,17 +51,40 @@ Below is an example of a scheduled Metadata File, Overlay File, and Playlist Fil ```yaml libraries: Movies: - schedule: weekly(saturday) metadata_path: - file: config/Movies.yml schedule: weekly(friday) + - git: PMM/actors + schedule: weekly(saturday) overlay_path: - git: PMM/overlays/imdb + schedule: weekly(monday) playlist_files: - file: config/Playlists.yml schedule: weekly(sunday) ``` +### Asset Directory + +You can define custom Asset Directories per file by adding `asset_directory` to the file call. + +```yaml +libraries: + Movies: + metadata_path: + - file: config/Movies.yml + asset_directory: assets/Movies + - git: PMM/actors + asset_directory: assets/people + overlay_path: + - git: PMM/overlays/imdb +playlist_files: + - file: config/Playlists.yml + asset_directory: + - assets/playlists1 + - assets/playlists2 +``` + ## Metadata Path The [`metadata_path`](libraries.md#metadata-path) attribute is defined under the [`libraries`](libraries) attribute in your [Configuration File](configuration). diff --git a/docs/home/guides/assets.md b/docs/home/guides/assets.md index 0938b8b3..cb86c3d8 100644 --- a/docs/home/guides/assets.md +++ b/docs/home/guides/assets.md @@ -19,7 +19,8 @@ settings: - config/assets_ahoy ``` -By default [if no `asset_directory` is specified], the program will look in the same folder as your `config.yml` for a folder called `assets`. +* You can specify an Image Asset Directory per Metadata/Playlist/Overlay File when calling the file. See [Path Types](../../config/paths.md#asset-directory) for how to define them. +* By default [if no `asset_directory` is specified], the program will look in the same folder as your `config.yml` for a folder called `assets`. ## How assets are run @@ -34,7 +35,6 @@ Assets are searched for only at specific times. show_missing_assets: false ``` - ## Asset Naming The table below shows the asset folder path structures that will be searched for. There are two options for how Plex Meta Manager looks at the files inside your Asset Directories. Choose an option with the [`asset_folders` Setting Attribute](../../config/settings.md#image-asset-folders). diff --git a/modules/config.py b/modules/config.py index 85b8a8dc..0633c98f 100644 --- a/modules/config.py +++ b/modules/config.py @@ -324,8 +324,8 @@ class ConfigFile: "assets_for_all": check_for_attribute(self.data, "assets_for_all", parent="settings", var_type="bool", default=False, save=False, do_print=False) } self.custom_repo = self.general["custom_repo"].replace("https://github.com/", "https://raw.githubusercontent.com/") if self.general["custom_repo"] else None - - self.latest_version = util.current_version(self.version, nightly=self.general["check_nightly"]) + self.check_nightly = self.general["check_nightly"] + self.latest_version = util.current_version(self.version, nightly=self.check_nightly) self.session = requests.Session() if not self.general["verify_ssl"]: diff --git a/modules/github.py b/modules/github.py index 1772a0b9..d097bbb3 100644 --- a/modules/github.py +++ b/modules/github.py @@ -14,9 +14,9 @@ class GitHub: response = self.config.get_json(f"{base_url}/releases/latest") return response["body"] - def get_develop_commits(self, dev_version): + def get_commits(self, dev_version, nightly=False): master_sha = self.config.get_json(f"{base_url}/commits/master")["sha"] - response = self.config.get_json(f"{base_url}/commits?sha=develop") + response = self.config.get_json(f"{base_url}/commits", params={"sha": "nightly" if nightly else "develop"}) commits = [] for commit in response: if commit["sha"] == master_sha: diff --git a/modules/util.py b/modules/util.py index 498399c1..71bcbe78 100644 --- a/modules/util.py +++ b/modules/util.py @@ -103,7 +103,9 @@ def current_version(version, nightly=False): return get_version("nightly") elif version[2] > 0: new_version = get_version("develop") - return get_version("nightly") if new_version[2] < version[2] else new_version + if version[1] != new_version[1] or new_version[2] >= version[2]: + return new_version + return get_version("nightly") else: return get_version("master") @@ -125,7 +127,8 @@ def add_dict_list(keys, value, dict_map): else: dict_map[key] = [value] -def get_list(data, lower=False, upper=False, split=",", int_list=False): +def get_list(data, lower=False, upper=False, split=True, int_list=False): + if split is True: split = "," if data is None: return None elif isinstance(data, list): list_data = data elif isinstance(data, dict): return [data] @@ -298,9 +301,13 @@ def load_files(files_to_load, method, schedule=None): temp_vars = {} if "template_variables" in file and file["template_variables"] and isinstance(file["template_variables"], dict): temp_vars = file["template_variables"] - asset_directory = None - if "asset_directory" in file and file["asset_directory"] and os.path.exists(file["asset_directory"]): - asset_directory = file["asset_directory"] + asset_directory = [] + if "asset_directory" in file and file["asset_directory"]: + for asset_path in get_list(file["asset_directory"], split=False): + if os.path.exists(asset_path): + asset_directory.append(asset_path) + else: + logger.error(f"Config Error: Asset Directory Does Not Exist: {asset_path}") current = [] def check_dict(attr, name): diff --git a/modules/webhooks.py b/modules/webhooks.py index c48dcfd6..3d866f31 100644 --- a/modules/webhooks.py +++ b/modules/webhooks.py @@ -55,7 +55,7 @@ class Webhooks: if version[1] != latest_version[1]: notes = self.config.GitHub.latest_release_notes() elif version[2] and version[2] < latest_version[2]: - notes = self.config.GitHub.get_develop_commits(version[2]) + notes = self.config.GitHub.get_commits(version[2], nightly=self.config.check_nightly) self._request(self.version_webhooks, {"current": version[0], "latest": latest_version[0], "notes": notes}) def end_time_hooks(self, start_time, end_time, run_time, stats):