Ariver
2026-06-04 be83948fab7b643634ede2403abdca27e6b45f29
Apptag/AppLibraryController.swift
@@ -17,9 +17,14 @@
    let summary: SmartStartSummary?
}
struct AppLibrarySystemSchemeApplyResult {
    let snapshot: AppLibrarySnapshot
    let summary: SmartStartSummary?
}
enum AppLibraryController {
    static func refresh() -> AppLibraryRefreshResult {
        let scannedApps = AppIndexer.scan()
    static func refresh(useCache: Bool = true) -> AppLibraryRefreshResult {
        let scannedApps = AppIndexer.scan(useCache: useCache)
        let reconciledStore = TagEditor.reconcileScannedApps(scannedApps)
        let smartStartResult = SmartStartService.runIfNeeded(
            apps: scannedApps,
@@ -42,6 +47,15 @@
        )
    }
    static func applySystemInitialScheme() -> AppLibrarySystemSchemeApplyResult {
        let scannedApps = AppIndexer.scan(useCache: false)
        let result = SmartStartService.applySystemInitialScheme(apps: scannedApps)
        return AppLibrarySystemSchemeApplyResult(
            snapshot: makeSnapshot(scannedApps: scannedApps, store: result.store),
            summary: result.summary
        )
    }
    private static func makeSnapshot(
        scannedApps: [AppInfo],
        store: TagDatabase.Store