forked from j62/ctbrec
Improve logging/exception messages in RecordingPreconditions
This commit is contained in:
parent
2afd0820e5
commit
4e5287c177
|
@ -1,5 +1,12 @@
|
|||
package ctbrec.recorder;
|
||||
import static ctbrec.recorder.NextGenLocalRecorder.*;
|
||||
|
||||
import ctbrec.Config;
|
||||
import ctbrec.Model;
|
||||
import ctbrec.ModelGroup;
|
||||
import ctbrec.Recording;
|
||||
import ctbrec.recorder.download.Download;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.InvalidKeyException;
|
||||
|
@ -11,14 +18,7 @@ import java.util.Optional;
|
|||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ctbrec.Config;
|
||||
import ctbrec.Model;
|
||||
import ctbrec.ModelGroup;
|
||||
import ctbrec.Recording;
|
||||
import ctbrec.recorder.download.Download;
|
||||
import static ctbrec.recorder.NextGenLocalRecorder.IGNORE_CACHE;
|
||||
|
||||
public class RecordingPreconditions {
|
||||
|
||||
|
@ -168,8 +168,14 @@ public class RecordingPreconditions {
|
|||
return;
|
||||
} else {
|
||||
Optional<Model> otherModel = getModelForUrl(modelUrl);
|
||||
if (otherModel.isPresent() && (otherModelIsRecorded(otherModel.get()) || otherModelCanBeRecorded(otherModel.get()))) {
|
||||
if (otherModel.isPresent()) {
|
||||
if (otherModelIsRecorded(otherModel.get())) {
|
||||
throw new PreconditionNotMetException(otherModel.get() + " from the same group is already recorded");
|
||||
} else if (otherModelCanBeRecorded(otherModel.get())) {
|
||||
throw new PreconditionNotMetException(otherModel.get() + " from the same group can be recorded");
|
||||
}
|
||||
} else {
|
||||
LOG.warn("Couldn't check if model from same group has higer prio for {}", modelUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue