mirror of
https://github.com/RatzzFatzz/MKVAudioSubtitleChanger.git
synced 2026-02-11 02:05:56 +01:00
Fix finding hearing impaired flag changes
This commit is contained in:
@@ -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 -> {
|
||||
|
||||
@@ -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))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 +
|
||||
']';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user