Remove unused postProcessing setting

This commit is contained in:
0xb00bface 2020-09-26 17:22:42 +02:00
parent b8ffdb32ce
commit 93deeb3e52
11 changed files with 4 additions and 68 deletions

View File

@ -8,7 +8,7 @@
<parent>
<groupId>ctbrec</groupId>
<artifactId>master</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
<relativePath>../master</relativePath>
</parent>

View File

@ -8,7 +8,7 @@
<parent>
<groupId>ctbrec</groupId>
<artifactId>master</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
<relativePath>../master</relativePath>
</parent>

View File

@ -92,7 +92,6 @@ public class Settings {
public boolean onlineCheckSkipsPausedModels = false;
public int overviewUpdateIntervalInSecs = 10;
public String password = ""; // chaturbate password TODO maybe rename this onetime
public String postProcessing = "";
public int postProcessingThreads = 2;
public List<PostProcessor> postProcessors = new ArrayList<>();
public String proxyHost;

View File

@ -1,59 +1,11 @@
package ctbrec.recorder.download;
import java.io.File;
import java.io.IOException;
import java.time.Instant;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ctbrec.Config;
import ctbrec.OS;
import ctbrec.Recording;
import ctbrec.io.StreamRedirectThread;
public abstract class AbstractDownload implements Download {
private static final Logger LOG = LoggerFactory.getLogger(AbstractDownload.class);
protected Instant startTime;
protected void runPostProcessingScript(Recording recording) throws IOException, InterruptedException {
String postProcessing = Config.getInstance().getSettings().postProcessing;
if (postProcessing != null && !postProcessing.isEmpty()) {
File target = recording.getAbsoluteFile();
Runtime rt = Runtime.getRuntime();
String[] args = new String[] {
postProcessing,
target.getParentFile().getAbsolutePath(),
target.getAbsolutePath(),
getModel().getName(),
getModel().getSite().getName(),
Long.toString(recording.getStartDate().getEpochSecond())
};
if(LOG.isDebugEnabled()) {
LOG.debug("Running {}", Arrays.toString(args));
}
Process process = rt.exec(args, OS.getEnvironment());
// TODO maybe write these to a separate log file, e.g. recname.ts.pp.log
Thread std = new Thread(new StreamRedirectThread(process.getInputStream(), System.out));
std.setName("Process stdout pipe");
std.setDaemon(true);
std.start();
Thread err = new Thread(new StreamRedirectThread(process.getErrorStream(), System.err));
err.setName("Process stderr pipe");
err.setDaemon(true);
err.start();
int exitCode = process.waitFor();
LOG.debug("Process finished with exit code {}", exitCode);
if (exitCode != 0) {
throw new ProcessExitedUncleanException("Post-Processing finished with exit code " + exitCode);
}
}
}
@Override
public Instant getStartTime() {
return startTime;

View File

@ -398,7 +398,6 @@ public class DashDownload extends AbstractDownload {
new FfmpegMuxer(dir, file);
targetFile = file;
recording.setPath(path.substring(0, path.length() - 5));
runPostProcessingScript(recording);
} catch (Exception e) {
throw new PostProcessingException(e);
}

View File

@ -125,12 +125,6 @@ public class FFmpegDownload extends AbstractHlsDownload {
@Override
public void postprocess(Recording recording) {
Thread.currentThread().setName("PP " + model.getName());
try {
runPostProcessingScript(recording);
} catch (Exception e) {
throw new PostProcessingException(e);
}
}
@Override

View File

@ -215,7 +215,6 @@ public class HlsDownload extends AbstractHlsDownload {
try {
generatePlaylist(recording);
recording.setStatusWithEvent(State.POST_PROCESSING);
runPostProcessingScript(recording);
} catch (Exception e) {
throw new PostProcessingException(e);
}

View File

@ -489,12 +489,6 @@ public class MergedFfmpegHlsDownload extends AbstractHlsDownload {
@Override
public void postprocess(Recording recording) {
Thread.currentThread().setName("PP " + model.getName());
try {
runPostProcessingScript(recording);
} catch (Exception e) {
throw new PostProcessingException(e);
}
}
public void downloadFinishedRecording(String segmentPlaylistUri, File target, ProgressListener progressListener, long sizeInBytes) throws Exception {

View File

@ -6,7 +6,7 @@
<groupId>ctbrec</groupId>
<artifactId>master</artifactId>
<packaging>pom</packaging>
<version>3.9.0</version>
<version>3.10.0</version>
<modules>
<module>../common</module>

View File

@ -8,7 +8,7 @@
<parent>
<groupId>ctbrec</groupId>
<artifactId>master</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
<relativePath>../master</relativePath>
</parent>

View File

@ -59,7 +59,6 @@ public class ConfigServlet extends AbstractCtbrecServlet {
addParameter("maximumResolution", "Maximum Resolution", DataType.INTEGER, settings.maximumResolution, json);
addParameter("minimumSpaceLeftInBytes", "Leave Space On Device (GiB)", DataType.LONG, settings.minimumSpaceLeftInBytes, json);
addParameter("onlineCheckIntervalInSecs", "Online Check Interval (secs)", DataType.INTEGER, settings.onlineCheckIntervalInSecs, json);
addParameter("postProcessing", "Post-Processing", DataType.STRING, settings.postProcessing, json);
addParameter("postProcessingThreads", "Post-Processing Threads", DataType.INTEGER, settings.postProcessingThreads, json);
addParameter("recordingsDir", "Recordings Directory", DataType.STRING, settings.recordingsDir, json);
addParameter("recordSingleFile", "Record Single File", DataType.BOOLEAN, settings.recordSingleFile, json);