From 85032f6fba136f86b0decba202aaf523711a7004 Mon Sep 17 00:00:00 2001 From: SurfaceS Date: Sat, 9 Sep 2023 14:26:11 +0200 Subject: [PATCH] fix scanner --- src/main/java/net/pms/library/LibraryScanner.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/pms/library/LibraryScanner.java b/src/main/java/net/pms/library/LibraryScanner.java index 07d0e273055..7e5fa03bdda 100644 --- a/src/main/java/net/pms/library/LibraryScanner.java +++ b/src/main/java/net/pms/library/LibraryScanner.java @@ -105,13 +105,6 @@ public void startScan() { GuiManager.setStatusLine(null); } - public void stopScan() { - if (running) { - running = false; - GuiManager.setScanLibraryStatus(CONFIGURATION.getUseCache(), false); - } - } - /** * Starts partial rescan * @@ -192,7 +185,8 @@ public void discoverChildren() { List sharedContents = SharedContentConfiguration.getSharedContentArray(); for (SharedContent sharedContent : sharedContents) { if (sharedContent instanceof FolderContent folder && folder.getFile() != null && folder.isActive()) { - addChild(new RealFile(renderer, folder.getFile()), true, false); + LibraryResource realSystemFileResource = renderer.getRootFolder().createResourceFromFile(folder.getFile()); + addChild(realSystemFileResource, true, false); } } } @@ -254,7 +248,8 @@ public static void scanFileOrFolder(String filename) { public static void stopScanLibrary() { if (isScanLibraryRunning()) { - INSTANCE.stopScan(); + running = false; + GuiManager.setScanLibraryStatus(CONFIGURATION.getUseCache(), false); } }