From c9bd64843761c4450c001572ae9b7792b852c519 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Tue, 26 Jan 2021 18:08:51 +0100 Subject: [PATCH] Fixes only getting a partial regex match when deciding whether a subtitle is partial/forced or not --- .../knarcraft/ffmpegconverter/streams/SubtitleStream.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java b/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java index 3ba216b..ba840fe 100644 --- a/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java +++ b/src/main/java/net/knarcraft/ffmpegconverter/streams/SubtitleStream.java @@ -36,7 +36,7 @@ public class SubtitleStream extends AbstractStream implements StreamObject { * * @return

The title of the subtitle stream.

*/ - private String getTitle() { + public String getTitle() { return this.title; } @@ -87,8 +87,8 @@ public class SubtitleStream extends AbstractStream implements StreamObject { return false; } String titleLowercase = getTitle().toLowerCase(); - return !titleLowercase.matches("signs?[ &\\/a-z]+songs?") && - !titleLowercase.matches("songs?[ &\\/a-z]+signs?") && - !titleLowercase.matches("forced"); + return !titleLowercase.matches(".*signs?[ &/a-z]+songs?.*") && + !titleLowercase.matches(".*songs?[ &/a-z]+signs?.*") && + !titleLowercase.matches(".*forced.*"); } } \ No newline at end of file