mirror of
https://github.com/RatzzFatzz/MKVAudioSubtitleChanger.git
synced 2026-02-11 10:05:58 +01:00
Differentiate between already fits config and no suitable config found
This commit is contained in:
@@ -3,22 +3,27 @@ package at.pcgamingfreaks.mkvaudiosubtitlechanger.model;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@Getter
|
||||
public class ResultStatistic {
|
||||
private static final String result = "Total files: %s%n" +
|
||||
"├─ Should change: %s%n" +
|
||||
"├─ Successfully changed: %s%n" +
|
||||
"│ ├─ Failed changing: %s%n" +
|
||||
"│ └─ Successfully changed: %s%n" +
|
||||
"├─ No suitable config found: %s%n" +
|
||||
"├─ Already fit config: %s%n" +
|
||||
"└─ Failed: %s%n" +
|
||||
"Runtime: %ss";
|
||||
|
||||
private int filesTotal = 0;
|
||||
private int filesShouldChange = 0;
|
||||
private int filesSuccessfullyChanged = 0;
|
||||
private int filesFailed = 0;
|
||||
private int filesAlreadyFit = 0;
|
||||
|
||||
private int shouldChange = 0;
|
||||
private int failedChanging = 0;
|
||||
private int successfullyChanged = 0;
|
||||
|
||||
private int noSuitableConfigFound = 0;
|
||||
private int alreadyFits = 0;
|
||||
private int failed = 0;
|
||||
|
||||
@Getter(AccessLevel.NONE)
|
||||
private long startTime = 0;
|
||||
private long runtime = 0;
|
||||
@@ -28,19 +33,27 @@ public class ResultStatistic {
|
||||
}
|
||||
|
||||
public synchronized void shouldChange() {
|
||||
filesShouldChange++;
|
||||
shouldChange++;
|
||||
}
|
||||
|
||||
public synchronized void success() {
|
||||
filesSuccessfullyChanged++;
|
||||
successfullyChanged++;
|
||||
}
|
||||
|
||||
public synchronized void failedChanging() {
|
||||
failedChanging++;
|
||||
}
|
||||
|
||||
public synchronized void noSuitableConfigFound() {
|
||||
noSuitableConfigFound++;
|
||||
}
|
||||
|
||||
public synchronized void alreadyFits() {
|
||||
alreadyFits++;
|
||||
}
|
||||
|
||||
public synchronized void failure() {
|
||||
filesFailed++;
|
||||
}
|
||||
|
||||
public synchronized void fits() {
|
||||
filesAlreadyFit++;
|
||||
failed++;
|
||||
}
|
||||
|
||||
public void startTimer() {
|
||||
@@ -53,7 +66,7 @@ public class ResultStatistic {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(result, filesTotal, filesShouldChange, filesSuccessfullyChanged, filesAlreadyFit,
|
||||
filesFailed, runtime / 1000);
|
||||
return String.format(result, filesTotal, shouldChange, failedChanging, successfullyChanged,
|
||||
noSuitableConfigFound, alreadyFits, failed, runtime / 1000);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user