-
-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add subtitles attribute to Video (#1151)
* use video.subtitles instead of video.subtitle_languages * fix test due to a bug in enzyme * add news fragment
- Loading branch information
Showing
7 changed files
with
105 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add `subtitles` attribute to Video |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from babelfish import Language # type: ignore[import-untyped] | ||
from subliminal.core import scan_video | ||
from subliminal.refiners.metadata import refine | ||
from subliminal.video import Movie | ||
|
||
|
||
def test_refine_video_metadata(mkv): | ||
scanned_video = scan_video(mkv['test5']) | ||
refine(scanned_video, embedded_subtitles=True) | ||
|
||
assert type(scanned_video) is Movie | ||
assert scanned_video.name == mkv['test5'] | ||
assert scanned_video.source is None | ||
assert scanned_video.release_group is None | ||
assert scanned_video.resolution is None | ||
assert scanned_video.video_codec == 'H.264' | ||
assert scanned_video.audio_codec == 'AAC' | ||
assert scanned_video.imdb_id is None | ||
assert scanned_video.size == 31762747 | ||
assert scanned_video.subtitle_languages == { | ||
# Language('eng'), # bug in enzyme | ||
Language('spa'), | ||
Language('deu'), | ||
Language('jpn'), | ||
Language('und'), | ||
Language('ita'), | ||
Language('fra'), | ||
Language('hun'), | ||
} | ||
assert scanned_video.title == 'test5' | ||
assert scanned_video.year is None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters