forked from j62/ctbrec
Sort models by prio before online check
This commit is contained in:
parent
d82c3b490b
commit
242897719b
|
@ -3,9 +3,10 @@
|
|||
* Added recording priorities for models. If you restrict the number of
|
||||
concurrent downloads, models with high priority will be favored over models
|
||||
with low prio. Running recordings of models with low prio might even get
|
||||
stopped, so that models with higher prio can get recorded.
|
||||
You can adjust the prio on the "Recroding" tab by double-clicking on the
|
||||
value or by using your scroll wheel while holding down CTRL
|
||||
stopped, so that models with higher prio can get recorded. Models with
|
||||
higher priority will also get checked first in the online check loop.
|
||||
You can adjust the prio on the "Recording" tab by double-clicking on the
|
||||
value or by using your scroll wheel while holding down CTRL.
|
||||
* Added menu entry to open the recording dir of a model
|
||||
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.io.InterruptedIOException;
|
|||
import java.net.SocketTimeoutException;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
|
@ -74,6 +75,8 @@ public class OnlineMonitor extends Thread {
|
|||
}
|
||||
|
||||
private void updateModels(List<Model> models) {
|
||||
// sort models by priority
|
||||
Collections.sort(models, (a, b) -> b.getPriority() - a.getPriority());
|
||||
// submit online check jobs to the executor for the model's site
|
||||
List<Future<?>> futures = new LinkedList<>();
|
||||
for (Model model : models) {
|
||||
|
|
Loading…
Reference in New Issue