Skip to content

Commit 93a7473

Browse files
authored
Umar/7287 filter thumbnail group (#244)
* added filtering for thumbnail groups on param * added changelog
1 parent 9cf3a16 commit 93a7473

File tree

2 files changed

+53
-5
lines changed

2 files changed

+53
-5
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!--
2+
A new scriv changelog fragment.
3+
4+
Uncomment the section that is right (remove the HTML comment wrapper).
5+
For top level release notes, leave all the headers commented out.
6+
-->
7+
8+
<!--
9+
### Removed
10+
11+
- A bullet item for the Removed category.
12+
13+
-->
14+
### Added
15+
16+
- Added filter for thumbnail groupss
17+
18+
<!--
19+
### Changed
20+
21+
- A bullet item for the Changed category.
22+
23+
-->
24+
<!--
25+
### Deprecated
26+
27+
- A bullet item for the Deprecated category.
28+
29+
-->
30+
<!--
31+
### Fixed
32+
33+
- A bullet item for the Fixed category.
34+
35+
-->
36+
<!--
37+
### Security
38+
39+
- A bullet item for the Security category.
40+
41+
-->

src/transcoding/mitol/transcoding/api.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,21 @@ def add_group_settings(job_dict: dict, file_config: FileConfig) -> None:
136136
Args:
137137
job_dict (dict): MediaConvert job dictionary.
138138
file_config (FileConfig): Configuration for file paths and settings.
139-
140139
"""
141140
output_groups = job_dict["Settings"]["OutputGroups"]
141+
exclude_mp4 = file_config.group_settings.get("exclude_mp4", False)
142+
exclude_thumbnail = file_config.group_settings.get("exclude_thumbnail", False)
143+
144+
# Apply all filters sequentially
145+
if exclude_mp4:
146+
output_groups = filter_mp4_groups(output_groups)
147+
148+
if exclude_thumbnail:
149+
output_groups = [
150+
group for group in output_groups if not is_thumbnail_group(group)
151+
]
142152

143-
if file_config.group_settings.get("exclude_mp4", False):
144-
filtered_groups = filter_mp4_groups(output_groups)
145-
job_dict["Settings"]["OutputGroups"] = filtered_groups
146-
output_groups = filtered_groups
153+
job_dict["Settings"]["OutputGroups"] = output_groups
147154

148155
for group in output_groups:
149156
output_group_settings = group["OutputGroupSettings"]

0 commit comments

Comments
 (0)