| | |
| | | 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, |
| | |
| | | ) |
| | | } |
| | | |
| | | 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 |