Fix finding hearing impaired flag changes

This commit is contained in:
RatzzFatzz
2025-12-17 13:32:23 +01:00
parent 957295127a
commit 76d25fca1b
5 changed files with 12 additions and 6 deletions

View File

@@ -123,7 +123,7 @@ public class AttributeChangeProcessor {
public void findHearingImpairedTracksAndApplyChanges(FileInfo fileInfo) {
fileInfo.getTracks().stream()
.filter(track -> !track.commentary())
.filter(track -> !track.hearingImpaired())
.filter(track -> track.trackName() != null)
.filter(track -> hearingImpairedKeywords.stream().anyMatch(keyword -> track.trackName().toLowerCase().contains(keyword.toLowerCase(Locale.ROOT))))
.forEach(attr -> {

View File

@@ -127,7 +127,7 @@ public class MkvFileProcessor implements FileProcessor {
(Boolean) properties.getOrDefault("default_track", false),
(Boolean) properties.getOrDefault("forced_track", false),
(Boolean) properties.getOrDefault("commentary_track", false),
(Boolean) properties.getOrDefault("hearing_impaired_track", false),
(Boolean) properties.getOrDefault("flag_hearing_impaired", false),
TrackType.valueOf(((String) attribute.get("type")).toUpperCase(Locale.ENGLISH))));
}
}

View File

@@ -16,6 +16,8 @@ public record TrackAttributes(int id, String language, String trackName,
return id == attribute.id
&& defaultt == attribute.defaultt
&& forced == attribute.forced
&& commentary == attribute.commentary
&& hearingImpaired == attribute.hearingImpaired
&& Objects.equals(language, attribute.language)
&& Objects.equals(trackName, attribute.trackName)
&& type == attribute.type;
@@ -28,6 +30,8 @@ public record TrackAttributes(int id, String language, String trackName,
", trackName='" + trackName + '\'' +
", defaultt=" + defaultt +
", forced=" + forced +
", commentary=" + commentary +
", hearingImpaired=" + hearingImpaired +
", type=" + type +
']';
}