show grouped total model count
(cherry picked from commit 7c1b366340662489d3e85e9a443b8c00a2bbf205)
This commit is contained in:
parent
7fe7d005d9
commit
1e590d5641
|
@ -510,7 +510,7 @@ public class CamrecApplication extends Application {
|
||||||
bytesPerSecond = 0;
|
bytesPerSecond = 0;
|
||||||
}
|
}
|
||||||
String humanReadable = ByteUnitFormatter.format(bytesPerSecond);
|
String humanReadable = ByteUnitFormatter.format(bytesPerSecond);
|
||||||
var status = String.format("Recording %s / %s models @ %s/s", activeRecordings, recorder.getModelCount(), humanReadable);
|
var status = String.format("Recording %s / %s models (%s grouped) @ %s/s", activeRecordings, recorder.getModelCount(), recorder.getGroupedModelCount(), humanReadable);
|
||||||
Platform.runLater(() -> statusLabel.setText(status));
|
Platform.runLater(() -> statusLabel.setText(status));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,6 +174,13 @@ public interface Recorder {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int getModelCount();
|
int getModelCount();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the number of model groups + ungrouped models
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int getGroupedModelCount();
|
||||||
|
|
||||||
Set<ModelGroup> getModelGroups();
|
Set<ModelGroup> getModelGroups();
|
||||||
|
|
||||||
|
|
|
@ -672,6 +672,17 @@ public class RemoteRecorder implements Recorder {
|
||||||
return (int) models.stream().filter(m -> !m.isMarkedForLaterRecording()).count();
|
return (int) models.stream().filter(m -> !m.isMarkedForLaterRecording()).count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getGroupedModelCount() {
|
||||||
|
Map<String, String> urlToGroup = new HashMap<>();
|
||||||
|
for (var group : getModelGroups()) {
|
||||||
|
for (var url : group.getModelUrls()) {
|
||||||
|
urlToGroup.putIfAbsent(url, group.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (int) models.stream().filter(m -> !m.isMarkedForLaterRecording()).map(m -> urlToGroup.getOrDefault(m.getUrl(), m.getName())).distinct().count();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<ModelGroup> getModelGroups() {
|
public Set<ModelGroup> getModelGroups() {
|
||||||
modelGroupLock.lock();
|
modelGroupLock.lock();
|
||||||
|
|
|
@ -918,6 +918,17 @@ public class SimplifiedLocalRecorder implements Recorder {
|
||||||
return (int) models.stream().filter(m -> !m.isMarkedForLaterRecording()).count();
|
return (int) models.stream().filter(m -> !m.isMarkedForLaterRecording()).count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getGroupedModelCount() {
|
||||||
|
Map<String, String> urlToGroup = new HashMap<>();
|
||||||
|
for (var group : getModelGroups()) {
|
||||||
|
for (var url : group.getModelUrls()) {
|
||||||
|
urlToGroup.putIfAbsent(url, group.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (int) models.stream().filter(m -> !m.isMarkedForLaterRecording()).map(m -> urlToGroup.getOrDefault(m.getUrl(), m.getName())).distinct().count();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<ModelGroup> getModelGroups() {
|
public Set<ModelGroup> getModelGroups() {
|
||||||
modelGroupLock.lock();
|
modelGroupLock.lock();
|
||||||
|
|
Loading…
Reference in New Issue