diff --git a/VERSION b/VERSION index 68f32d64..d1293656 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.16.0-develop21 +1.16.0-develop22 diff --git a/docs/metadata/dynamic.md b/docs/metadata/dynamic.md index 0c467d12..24cc7c69 100644 --- a/docs/metadata/dynamic.md +++ b/docs/metadata/dynamic.md @@ -64,16 +64,15 @@ dynamic_collections: France: French ``` -* Using the `addons` attribute to combine multiple `keys`, i.e. merging "MTV", "MTV2", "MTV3" and "MTV (UK)" into one "MTV Worldwide" collection. - * When doing this, individual collections will not be created for the individual MTV collections, instead they will be merged within the "MTV Worldwide" collection. +* Using the `addons` attribute to combine multiple `keys`, i.e. merging "MTV2", "MTV3" and "MTV (UK)" into one "MTV" collection. + * When doing this, individual collections will not be created for the individual MTV collections, instead they will be merged within the "MTV" collection. ```yaml dynamic_collections: networks: type: network addons: - MTV Worldwide: - - MTV + MTV: - MTV2 - MTV3 - MTV (UK) @@ -123,6 +122,7 @@ Depending on the `type` of dynamic collection, `data` is used to specify the opt | [`year`](#year) | Create a collection for each year found in the library | ❌ | ✅ | ✅ | ❌ | ❌ | | [`decade`](#decade) | Create a collection for each decade found in the library | ❌ | ✅ | ❌ | ❌ | ❌ | | [`country`](#country) | Create a collection for each country found in the library | ❌ | ✅ | ❌ | ✅ | ✅ | +| [`resolution`](#resolution) | Create a collection for each resolution found in the library | ❌ | ✅ | ❌ | ❌ | ❌ | | [`network`](#network) | Create a collection for each network found in the library | ❌ | ❌ | ✅ | ❌ | ❌ | | [`mood`](#mood) | Create a collection for each mood found in the library | ❌ | ❌ | ❌ | ✅ | ❌ | | [`style`](#style) | Create a collection for each style found in the library | ❌ | ❌ | ❌ | ✅ | ❌ | @@ -1150,6 +1150,65 @@ dynamic_collections: India: Indian ``` +### Resolution + +Create a collection for each resolution found in the library + + + + + + + + + + + + + + + + + + + + + + + + + + +
type Optionresolution
data ValueNot Used
KeysResolution
Key NamesResolution
Default title_format<<key_name>> <<library_type>>s
Default Template + +```yaml +default_template: + smart_filter: + limit: 50 + sort_by: title.asc + any: + resolution: <> +``` + +
+ +#### Example: + +* Create a collection for each resolution found in the library +* Name the collection "[Resolution] Movies" +* Combine 480p, 576p and SD into a collection called "SD Movies" +```yaml +dynamic_collections: + Resolutions: # mapping name does not matter just needs to be unique + type: resolution + addons: + 480p: + - 576p + - SD + title_override: + 480p: SD Movies +``` + ### Network Create a collection for each network found in the library. @@ -1355,16 +1414,15 @@ dynamic_collections: Defines how multiple `keys` can be combined under a parent key. -For example, the `addons` attribute can be used to combine multiple `keys`, i.e. merging "MTV", "MTV2", "MTV3" and "MTV (UK)" into one "MTV Worldwide" collection. - * When doing this, individual collections will not be created for the individual MTV collections, instead they will be merged within the "MTV Worldwide" collection. +For example, the `addons` attribute can be used to combine multiple `keys`, i.e. merging "MTV2", "MTV3" and "MTV (UK)" into the "MTV" collection. + ```yaml dynamic_collections: networks: type: network addons: - MTV Worldwide: - - MTV + MTV: - MTV2 - MTV3 - MTV (UK) diff --git a/modules/meta.py b/modules/meta.py index 18225098..045c2a2d 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -16,7 +16,7 @@ ms_auto = [ "trakt_user_lists", "trakt_liked_lists", "trakt_people_list" ] auto = { - "Movie": ["tmdb_collection", "decade", "country", "director", "producer", "writer", "subtitle_language", "audio_language"] + all_auto + ms_auto, + "Movie": ["tmdb_collection", "decade", "country", "director", "producer", "writer", "subtitle_language", "audio_language", "resolution"] + all_auto + ms_auto, "Show": ["network", "origin_country"] + all_auto + ms_auto, "Artist": ["mood", "style", "country"] + all_auto, "Video": ["country", "content_rating"] + all_auto @@ -281,7 +281,7 @@ class MetadataFile(DataFile): for ck, cv in check_dict.items(): if ck not in exclude and cv not in exclude: auto_list[ck] = cv - if auto_type in ["genre", "mood", "style", "country", "network", "year", "decade", "content_rating", "subtitle_language", "audio_language"]: + if auto_type in ["genre", "mood", "style", "country", "network", "year", "decade", "content_rating", "subtitle_language", "audio_language", "resolution"]: search_tag = auto_type_translation[auto_type] if auto_type in auto_type_translation else auto_type if auto_type in ["subtitle_language", "audio_language"]: auto_list = {i.key: i.title for i in library.get_tags(search_tag) if i.title not in exclude and i.key not in exclude} @@ -290,6 +290,9 @@ class MetadataFile(DataFile): if library.is_music: default_template = {"smart_filter": {"limit": 50, "sort_by": "plays.desc", "any": {f"artist_{auto_type}": f"<<{auto_type}>>"}}} default_title_format = "Most Played <> <>s" + elif auto_type == "resolution": + default_template = {"smart_filter": {"sort_by": "title.asc", "any": {auto_type: f"<<{auto_type}>>"}}} + default_title_format = "<> <>s" else: default_template = {"smart_filter": {"limit": 50, "sort_by": "critic_rating.desc", "any": {auto_type: f"<<{auto_type}>>"}}} default_title_format = "Best <>s of <>" if auto_type in ["year", "decade"] else "Top <> <>s"