mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2025-03-03 06:47:30 +00:00
Add ability to filter for subtitle track title
This commit is contained in:
parent
5fa5eb0fd0
commit
3ce529014f
3 changed files with 8 additions and 3 deletions
|
@ -77,6 +77,7 @@ String filters can take multiple values **only as a list**.
|
|||
| `folder` | Uses the item's folder to match | ❌ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
|
||||
| `filepath` | Uses the item's filepath to match | ✅ | ✅<sup>**[1](#table-annotations)**</sup> | ✅<sup>**[1](#table-annotations)**</sup> | ✅ | ✅<sup>**[1](#table-annotations)**</sup> | ✅<sup>**[1](#table-annotations)**</sup> | ✅ |
|
||||
| `audio_track_title` | Uses the audio track titles to match | ✅ | ✅<sup>**[1](#table-annotations)**</sup> | ✅<sup>**[1](#table-annotations)**</sup> | ✅ | ✅<sup>**[1](#table-annotations)**</sup> | ✅<sup>**[1](#table-annotations)**</sup> | ✅ |
|
||||
| `subtitle_track_title` | Uses the subtitle track titles to match | ✅ | ✅<sup>**[1](#table-annotations)**</sup> | ✅<sup>**[1](#table-annotations)**</sup> | ✅ | ✅<sup>**[1](#table-annotations)**</sup> | ✅<sup>**[1](#table-annotations)**</sup> | ✅ |
|
||||
| `video_codec` | Uses the video codec tags to match | ✅ | ✅<sup>**[1](#table-annotations)**</sup> | ✅<sup>**[1](#table-annotations)**</sup> | ✅ | ❌ | ❌ | ❌ |
|
||||
| `video_profile` | Uses the video profile tags to match | ✅ | ✅<sup>**[1](#table-annotations)**</sup> | ✅<sup>**[1](#table-annotations)**</sup> | ✅ | ❌ | ❌ | ❌ |
|
||||
| `audio_codec` | Uses the audio codec tags to match | ✅ | ✅<sup>**[1](#table-annotations)**</sup> | ✅<sup>**[1](#table-annotations)**</sup> | ✅ | ❌ | ❌ | ❌ |
|
||||
|
|
|
@ -67,11 +67,11 @@ sonarr_details = [
|
|||
]
|
||||
album_details = ["non_item_remove_label", "item_label", "item_album_sorting"]
|
||||
sub_filters = [
|
||||
"filepath", "audio_track_title", "resolution", "audio_language", "subtitle_language", "has_dolby_vision",
|
||||
"filepath", "audio_track_title", "subtitle_track_title", "resolution", "audio_language", "subtitle_language", "has_dolby_vision",
|
||||
"channels", "height", "width", "aspect", "audio_codec", "audio_profile", "video_codec", "video_profile", "versions"
|
||||
]
|
||||
filters_by_type = {
|
||||
"movie_show_season_episode_artist_album_track": ["title", "summary", "collection", "has_collection", "added", "last_played", "user_rating", "plays", "filepath", "label", "audio_track_title", "versions"],
|
||||
"movie_show_season_episode_artist_album_track": ["title", "summary", "collection", "has_collection", "added", "last_played", "user_rating", "plays", "filepath", "label", "audio_track_title", "subtitle_track_title", "versions"],
|
||||
"movie_show_season_episode_album_track": ["year"],
|
||||
"movie_show_season_episode_artist_album": ["has_overlay"],
|
||||
"movie_show_season_episode": ["resolution", "audio_language", "subtitle_language", "has_dolby_vision", "channels", "height", "width", "aspect", "audio_codec", "audio_profile", "video_codec", "video_profile"],
|
||||
|
@ -105,7 +105,7 @@ tmdb_filters = [
|
|||
]
|
||||
imdb_filters = ["imdb_keyword"]
|
||||
string_filters = [
|
||||
"title", "summary", "studio", "edition", "record_label", "folder", "filepath", "audio_track_title", "tmdb_title",
|
||||
"title", "summary", "studio", "edition", "record_label", "folder", "filepath", "audio_track_title", "subtitle_track_title", "tmdb_title",
|
||||
"audio_codec", "audio_profile", "video_codec", "video_profile"
|
||||
]
|
||||
string_modifiers = ["", ".not", ".is", ".isnot", ".begins", ".ends", ".regex"]
|
||||
|
|
|
@ -1594,6 +1594,10 @@ class Plex(Library):
|
|||
for media in item.media:
|
||||
for part in media.parts:
|
||||
values.extend([a.extendedDisplayTitle for a in part.audioStreams() if a.extendedDisplayTitle])
|
||||
elif filter_attr == "subtitle_track_title":
|
||||
for media in item.media:
|
||||
for part in media.parts:
|
||||
values.extend([a.extendedDisplayTitle for a in part.subtitleStreams() if a.extendedDisplayTitle])
|
||||
elif filter_attr in ["audio_codec", "audio_profile", "video_codec", "video_profile"]:
|
||||
for media in item.media:
|
||||
attr = getattr(media, filter_actual)
|
||||
|
|
Loading…
Add table
Reference in a new issue