Add ability to filter for subtitle track title

pull/1561/head
YozoraXCII 1 year ago
parent 5fa5eb0fd0
commit 3ce529014f

@ -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 | &#9989; | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989; | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989; |
| `audio_track_title` | Uses the audio track titles to match | &#9989; | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989; | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989; |
| `subtitle_track_title` | Uses the subtitle track titles to match | &#9989; | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989; | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989; |
| `video_codec` | Uses the video codec tags to match | &#9989; | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989; | &#10060; | &#10060; | &#10060; |
| `video_profile` | Uses the video profile tags to match | &#9989; | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989; | &#10060; | &#10060; | &#10060; |
| `audio_codec` | Uses the audio codec tags to match | &#9989; | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989; | &#10060; | &#10060; | &#10060; |

@ -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…
Cancel
Save