Преглед изворни кода

fixed backuped wallpapers unloading after restart

UwU пре 2 месеци
родитељ
комит
8660af6c99
2 измењених фајлова са 6 додато и 3 уклоњено
  1. 1 1
      package.json
  2. 5 2
      src/main/services/library.service.ts

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "we-manager",
-  "version": "0.3.0",
+  "version": "0.3.1",
   "type": "module",
   "description": "Wallpaper Engine workshop manager",
   "author": "UwU <260361707+WallpaperEngineLover@users.noreply.github.com>",

+ 5 - 2
src/main/services/library.service.ts

@@ -350,10 +350,13 @@ export async function scanLibrary(): Promise<{ imported: number; skipped: number
   let skipped = 0
   let removed = 0
 
-  // Remove wallpapers whose directories no longer exist on disk, unless Steam
+  // Remove workshop wallpapers whose directories no longer exist on disk, unless Steam
   // still has them subscribed (those get tracked below instead, so a failed
-  // or never-started download doesn't just vanish from the library)
+  // or never-started download doesn't just vanish from the library). Only source:'workshop'
+  // entries live under workshopPath - local imports and backups (source:'local'/'backup') are
+  // never on disk here, so including them in this check would delete them on every scan.
   for (const id of Object.keys(wallpapers)) {
+    if (wallpapers[id].source !== 'workshop') continue
     if (!onDisk.has(id) && !subscribedIds.has(id)) {
       delete wallpapers[id]
       removed++