refactor split time parsing
This commit is contained in:
parent
49b72cbe5d
commit
8a4afe2548
|
@ -31,20 +31,16 @@ public class YoutubeParsingHelper {
|
|||
public static long parseDurationString(String input)
|
||||
throws ParsingException, NumberFormatException {
|
||||
|
||||
String[] splitInput;
|
||||
|
||||
// If time separator : is not detected, try . instead
|
||||
|
||||
if (input.contains(":")) {
|
||||
splitInput = input.split(":");
|
||||
} else {
|
||||
splitInput = input.split("\\.");
|
||||
}
|
||||
|
||||
|
||||
final String[] splitInput = input.contains(":")
|
||||
? input.split(":")
|
||||
: input.split("\\.");
|
||||
|
||||
String days = "0";
|
||||
String hours = "0";
|
||||
String minutes = "0";
|
||||
String seconds;
|
||||
final String seconds;
|
||||
|
||||
switch (splitInput.length) {
|
||||
case 4:
|
||||
|
|
Loading…
Reference in New Issue