Version 15
This commit is contained in:
@@ -22,6 +22,8 @@ class ScanWorker(QThread):
|
||||
def run(self):
|
||||
try:
|
||||
from local.local_db import get_libraries
|
||||
from local.tag_reader import is_supported
|
||||
import os
|
||||
libraries = get_libraries(active_only=True)
|
||||
|
||||
if not libraries:
|
||||
@@ -34,12 +36,20 @@ class ScanWorker(QThread):
|
||||
from pathlib import Path
|
||||
path = Path(lib["path"])
|
||||
name = path.name
|
||||
|
||||
if not path.exists():
|
||||
self.status_update.emit(f"⚠ Mappe ikke fundet: {path}")
|
||||
continue
|
||||
|
||||
self.status_update.emit(f"Scanner: {name}...")
|
||||
|
||||
# Tæl filer først så vi kan vise fremgang
|
||||
from local.tag_reader import is_supported
|
||||
files = [f for f in path.rglob("*") if f.is_file() and is_supported(f)]
|
||||
count = len(files)
|
||||
# Tæl filer med os.walk — håndterer permission-fejl sikkert
|
||||
count = 0
|
||||
for dirpath, _, filenames in os.walk(str(path), followlinks=False):
|
||||
for f in filenames:
|
||||
if is_supported(f):
|
||||
count += 1
|
||||
|
||||
self.status_update.emit(f"Scanner: {name} ({count} filer)...")
|
||||
|
||||
# Kør scanning
|
||||
|
||||
Reference in New Issue
Block a user