forked from j62/ctbrec
Update mark unmark model immediately in remote mode
This commit is contained in:
parent
4a2f7c2d27
commit
87f7bd6e83
|
@ -706,17 +706,21 @@ public class RemoteRecorder implements Recorder {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void markForLaterRecording(Model model, boolean mark) throws InvalidKeyException, NoSuchAlgorithmException, IOException {
|
public void markForLaterRecording(Model model, boolean mark) throws InvalidKeyException, NoSuchAlgorithmException, IOException {
|
||||||
|
model.setMarkedForLaterRecording(mark);
|
||||||
|
LOG.info("Marking model {} {}", model, mark);
|
||||||
if (mark) {
|
if (mark) {
|
||||||
sendRequest("markForLater", model);
|
sendRequest("markForLater", model);
|
||||||
} else {
|
} else {
|
||||||
sendRequest("unmarkForLater", model);
|
sendRequest("unmarkForLater", model);
|
||||||
}
|
}
|
||||||
model.setMarkedForLaterRecording(mark);
|
// update locally cached model
|
||||||
// update cached model
|
|
||||||
int index = models.indexOf(model);
|
int index = models.indexOf(model);
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
Model m = models.get(index);
|
Model m = models.get(index);
|
||||||
m.setSuspended(mark);
|
m.setMarkedForLaterRecording(mark);
|
||||||
|
models.remove(index);
|
||||||
|
} else {
|
||||||
|
models.add(model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue