From 292409f5dc564f4341d6a8fa257bed1ae0ab2675 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Wed, 11 Mar 2020 15:46:17 +0100 Subject: [PATCH] Improves checking for whether a subtitle is full or partial --- .../ffmpegconverter/streams/SubtitleStream.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java b/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java index 06fedc7..547cbdd 100644 --- a/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java +++ b/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java @@ -37,14 +37,9 @@ public class SubtitleStream extends StreamObject { return false; } String titleLowercase = getTitle().toLowerCase(); - return !(titleLowercase.contains("songs and signs") || - titleLowercase.contains("signs and songs") || - titleLowercase.contains("songs & signs") || - titleLowercase.contains("signs & songs") || - titleLowercase.contains("signs/song") || - titleLowercase.contains("songs/sign") || - titleLowercase.contains("[forced]") || - titleLowercase.contains("(forced)")); + return !titleLowercase.matches("signs?[ &\\/a-z]+songs?") && + !titleLowercase.matches("songs?[ &\\/a-z]+signs?") && + !titleLowercase.matches("forced"); } public String getLanguage() {