-- @query import_enumeration_counts -- @db importDrive 1.0 -- @param enumeration_id TEXT -- EnumerationID from active import session -- @param last_import_time INT -- Unix timestamp of last import (0 for first-time) -- -- Counts total files and new files (modified after last import) in an enumeration. -- Used to populate "New" and "All" tab counts in the import panel. SELECT COUNT(*) as AllCount, SUM(CASE WHEN ModTime > ?last_import_time THEN 1 ELSE 0 END) as NewCount FROM importDrive.EnumerationContents WHERE EnumerationID = ?enumeration_id AND IsDirectory = 0