forked from j62/ctbrec
Improve handling of postprocessing
This commit is contained in:
parent
0a58b91fec
commit
27dac97384
|
@ -780,12 +780,10 @@ public class LocalRecorder implements Recorder {
|
|||
generatePlaylist(download.getTarget());
|
||||
}
|
||||
boolean deleted = deleteIfTooShort(download);
|
||||
if(deleted) {
|
||||
// recording was too short. stop here and don't do post-processing
|
||||
return;
|
||||
if(!deleted) {
|
||||
fireRecordingStateChanged(download.getTarget(), POST_PROCESSING, download.getModel(), download.getStartTime());
|
||||
postprocess(download);
|
||||
}
|
||||
fireRecordingStateChanged(download.getTarget(), POST_PROCESSING, download.getModel(), download.getStartTime());
|
||||
postprocess(download);
|
||||
fireRecordingStateChanged(download.getTarget(), FINISHED, download.getModel(), download.getStartTime());
|
||||
};
|
||||
}
|
||||
|
@ -802,8 +800,14 @@ public class LocalRecorder implements Recorder {
|
|||
try {
|
||||
LOG.debug("Determining video length for {}", download.getTarget());
|
||||
File target = download.getTarget();
|
||||
if(!target.exists() || target.length() == 0) {
|
||||
return true;
|
||||
if(target.isDirectory()) {
|
||||
if(!target.exists() || target.list() == null || target.list().length == 0) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if(!target.exists() || target.length() == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
double duration = 0;
|
||||
|
|
Loading…
Reference in New Issue