[31] #801 add resolution, subtitle_language, and audio_language dynamic collection types

pull/811/head
meisnate12 3 years ago
parent 87f48855e6
commit d44a672d66

@ -1 +1 @@
1.16.2-develop30
1.16.2-develop31

@ -122,9 +122,10 @@ 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 | ❌ | ✅ | ❌ | ❌ | ❌ |
| [`subtitle_language`](#subtitle-language) | Create a collection for each subtitle language found in the library | ❌ | ✅ | ❌ | ❌ | ❌ |
| [`audio_language`](#audio-language) | Create a collection for each audio language found in the library | ❌ | ✅ | ❌ | ❌ | ❌ |
| [`resolution`](#resolution) | Create a collection for each resolution found in the library | ❌ | ✅ | ✅ | ❌ | ❌ |
| [`subtitle_language`](#subtitle-language) | Create a collection for each subtitle language found in the library | ❌ | ✅ | ✅ | ❌ | ❌ |
| [`audio_language`](#audio-language) | Create a collection for each audio language found in the library | ❌ | ✅ | ✅ | ❌ | ❌ |
| [`studio`](#studio) | Create a collection for each studio 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 | ❌ | ❌ | ❌ | ✅ | ❌ |
@ -161,6 +162,7 @@ Create collections based on the TMDb Collections associated with items in the li
```yaml
default_template:
tmdb_collection_details: <<value>>
minimum_items: 2
```
</td>
@ -1315,6 +1317,67 @@ dynamic_collections:
type: audio_language
```
### Studio
Create a collection for each studio found in the library.
<table class="dualTable colwidths-auto align-default table">
<tr>
<th><code>type</code> Option</th>
<td><code>studio</code></td>
</tr>
<tr>
<th><code>data</code> Value</th>
<td>Not Used</td>
</tr>
<tr>
<th>Keys</th>
<td>Studio</td>
</tr>
<tr>
<th>Key Names</th>
<td>Studio</td>
</tr>
<tr>
<th>Default <code>title_format</code></th>
<td><code>Top &lt;&lt;key_name&gt;&gt; &lt;&lt;library_type&gt;&gt;s</code></td>
</tr>
<tr>
<th>Default Template</th>
<td>
```yaml
default_template:
smart_filter:
limit: 50
sort_by: critic_rating.desc
any:
studio: <<value>>
```
</td>
</tr>
</table>
#### Example:
* Create a collection for each studio found in a Movies library
```yaml
templates:
studio collection:
smart_filter:
sort_by: critic_rating.desc
all:
studio: <<value>>
dynamic_collections:
Studios: # mapping name does not matter just needs to be unique
type: studio
title_format: <<key_name>>
template: studio collection
```
### Network
Create a collection for each network found in the library.

@ -12,11 +12,11 @@ github_base = "https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager-Co
all_auto = ["genre"]
ms_auto = [
"actor", "year", "content_rating", "original_language", "tmdb_popular_people",
"trakt_user_lists", "trakt_liked_lists", "trakt_people_list"
"actor", "year", "content_rating", "original_language", "tmdb_popular_people", "trakt_user_lists",
"trakt_liked_lists", "trakt_people_list", "subtitle_language", "audio_language", "resolution"
]
auto = {
"Movie": ["tmdb_collection", "decade", "country", "director", "producer", "writer", "subtitle_language", "audio_language", "resolution"] + all_auto + ms_auto,
"Movie": ["tmdb_collection", "decade", "country", "director", "producer", "writer"] + all_auto + ms_auto,
"Show": ["network", "origin_country"] + all_auto + ms_auto,
"Artist": ["mood", "style", "country"] + all_auto,
"Video": ["country", "content_rating"] + all_auto
@ -25,7 +25,7 @@ auto_type_translation = {"content_rating": "contentRating", "subtitle_language":
default_templates = {
"original_language": {"plex_all": True, "filters": {"original_language": "<<original_language>>"}},
"origin_country": {"plex_all": True, "filters": {"origin_country": "<<origin_country>>"}},
"tmdb_collection": {"tmdb_collection_details": "<<tmdb_collection>>"},
"tmdb_collection": {"tmdb_collection_details": "<<tmdb_collection>>", "minimum_items": 2},
"trakt_user_lists": {"trakt_list_details": "<<trakt_user_lists>>"},
"trakt_liked_lists": {"trakt_list_details": "<<trakt_liked_lists>>"},
"tmdb_popular_people": {"tmdb_person": f"<<tmdb_popular_people>>", "plex_search": {"all": {"actor": "tmdb"}}},
@ -285,9 +285,12 @@ class MetadataFile(DataFile):
all_keys.append(ck)
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", "resolution"]:
if auto_type in ["genre", "mood", "style", "country", "studio", "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
tags = library.get_tags(search_tag)
if library.is_show and auto_type in ["resolution", "subtitle_language", "audio_language"]:
tags = library.get_tags(f"episode.{search_tag}")
else:
tags = library.get_tags(search_tag)
if auto_type in ["decade", "subtitle_language", "audio_language"]:
all_keys = [str(i.key) for i in tags]
auto_list = {str(i.key): i.title for i in tags if str(i.title) not in exclude and str(i.key) not in exclude}

Loading…
Cancel
Save