Skip to content

Commit

Permalink
Fix for changed files outside of the cache
Browse files Browse the repository at this point in the history
  • Loading branch information
lanthale committed Nov 26, 2023
1 parent d9f39a1 commit 52ead80
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,8 @@ protected MediaFile call() throws Exception {
}
}
} else {
m.readEdits();
Platform.runLater(() -> {
fullMediaList.set(fullMediaList.indexOf(m), m);
});
m.readEdits();
updateValue(m);
if (cacheList.contains(m) == false) {
cacheList.add(m);
} else {
Expand All @@ -235,10 +233,6 @@ protected MediaFile call() throws Exception {
return null;
}

Platform.runLater(() -> {
lightcontroller.getSortedMediaList().setComparator(new MediaFilenameComparator());
});

//Save cache...
Thread.ofVirtual().start(() -> {
saveCacheToDisk();
Expand Down Expand Up @@ -359,9 +353,11 @@ public void loadItem(Path fileItem, MediaFile m, Thread th) throws IOException {
protected void updateValue(MediaFile v) {
if (v != null) {
super.updateValue(v);
Platform.runLater(() -> {
fullMediaList.add(v);
});
if (fullMediaList.contains(v) == false) {
Platform.runLater(() -> {
fullMediaList.add(v);
});
}
}
}

Expand Down

0 comments on commit 52ead80

Please sign in to comment.