Various smaller improvements
All checks were successful
KnarCraft/FFmpegConvert/pipeline/head This commit looks good
All checks were successful
KnarCraft/FFmpegConvert/pipeline/head This commit looks good
Improves Signs & Songs subtitle RegEx Adds tests for the Signs & Songs subtitle RegEx Automatically changes "enm" language to English Makes the downscale converter select HEVC if the input is HEVC
This commit is contained in:
@ -0,0 +1,30 @@
|
||||
package net.knarcraft.ffmpegconverter.utility;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* A helper class for subtitle-related tasks
|
||||
*/
|
||||
public final class SubtitleHelper {
|
||||
|
||||
private SubtitleHelper() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given subtitle is a songs & signs subtitle
|
||||
*
|
||||
* @param subtitleTitle <p>The subtitle to check</p>
|
||||
* @return <p>True if the subtitle is a songs and signs, not a full subtitle</p>
|
||||
*/
|
||||
public static boolean isSongsSignsSubtitle(@NotNull String subtitleTitle) {
|
||||
Pattern pattern = Pattern.compile("(^| |\\(|\\[\\{)si(ng|gn)s?($|[ &/+-@])+(titles)?[ &/+-@]?(songs?)?|" +
|
||||
"(^| |\\(|\\[\\{)songs?($|[ &/+-@])+(si(gn|ng)s?)?|.*forced.*|.*s&s.*");
|
||||
Matcher matcher = pattern.matcher(subtitleTitle.toLowerCase().trim());
|
||||
return matcher.find();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user