Fix streamtags remove list
This commit is contained in:
@@ -184,6 +184,64 @@ class SubtrackMappingBundleTests(unittest.TestCase):
|
||||
["video-0", "audio-2", "audio-1", "subtitle-3"],
|
||||
)
|
||||
|
||||
def test_no_pattern_stream_remove_list_clears_copied_stream_metadata(self):
|
||||
source_filename = "remove_tags_s01e01.mkv"
|
||||
self.write_config(
|
||||
{
|
||||
"metadata": {
|
||||
"streams": {
|
||||
"remove": ["BPS"],
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
source_path = create_source_fixture(
|
||||
self.workdir,
|
||||
source_filename,
|
||||
[
|
||||
SourceTrackSpec(
|
||||
TrackType.VIDEO,
|
||||
identity="video-0",
|
||||
extra_tags={"BPS": "remove-me", "KEEP_ME": "video-keep"},
|
||||
),
|
||||
SourceTrackSpec(
|
||||
TrackType.AUDIO,
|
||||
identity="audio-1",
|
||||
language="eng",
|
||||
title="Main Audio",
|
||||
extra_tags={"BPS": "remove-me", "KEEP_ME": "audio-keep"},
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
completed = run_ffx_convert(
|
||||
self.workdir,
|
||||
self.home_dir,
|
||||
self.database_path,
|
||||
"--video-encoder",
|
||||
"copy",
|
||||
"--no-pattern",
|
||||
"--no-tmdb",
|
||||
"--no-prompt",
|
||||
"--no-signature",
|
||||
str(source_path),
|
||||
)
|
||||
self.assertCompleted(completed)
|
||||
|
||||
output_path = expected_output_path(self.workdir, source_filename)
|
||||
streams = ffprobe_json(output_path)["streams"]
|
||||
|
||||
self.assertEqual(
|
||||
[stream["codec_type"] for stream in streams],
|
||||
["video", "audio"],
|
||||
)
|
||||
self.assertEqual(get_tag(streams[0], "THIS_IS"), "video-0")
|
||||
self.assertEqual(get_tag(streams[0], "KEEP_ME"), "video-keep")
|
||||
self.assertIsNone(get_tag(streams[0], "BPS"))
|
||||
self.assertEqual(get_tag(streams[1], "THIS_IS"), "audio-1")
|
||||
self.assertEqual(get_tag(streams[1], "KEEP_ME"), "audio-keep")
|
||||
self.assertIsNone(get_tag(streams[1], "BPS"))
|
||||
|
||||
def test_pattern_validation_fails_for_nonexistent_source_track_reference(self):
|
||||
source_filename = "invalid_s01e01.mkv"
|
||||
source_path = create_source_fixture(
|
||||
|
||||
Reference in New Issue
Block a user