Update mark unmark model immediately in remote mode

This commit is contained in:
0xb00bface 2021-08-07 16:31:24 +02:00
parent 4a2f7c2d27
commit 87f7bd6e83
1 changed files with 7 additions and 3 deletions

View File

@ -706,17 +706,21 @@ public class RemoteRecorder implements Recorder {
@Override
public void markForLaterRecording(Model model, boolean mark) throws InvalidKeyException, NoSuchAlgorithmException, IOException {
model.setMarkedForLaterRecording(mark);
LOG.info("Marking model {} {}", model, mark);
if (mark) {
sendRequest("markForLater", model);
} else {
sendRequest("unmarkForLater", model);
}
model.setMarkedForLaterRecording(mark);
// update cached model
// update locally cached model
int index = models.indexOf(model);
if (index >= 0) {
Model m = models.get(index);
m.setSuspended(mark);
m.setMarkedForLaterRecording(mark);
models.remove(index);
} else {
models.add(model);
}
}
}