private async Task InitializeAsync() { // Initialize Factory this.factory = new SQLiteConnectionFactory(); // Initialize Cache this.cache = new IndexerCache(); // IndexingEventArgs this.eventArgs = new IndexingStatusEventArgs(); this.eventArgs.IndexingDataChanged = IndexingDataChanged.None; this.eventArgs.IndexingAction = IndexingAction.Idle; // Get all files on disk which belong to a Collection Folder this.allDiskPaths = await this.folderRepository.GetPathsAsync(); // Find unreachable Folders this.unreachableFolderIDs = new List <long>(); var folders = await this.folderRepository.GetFoldersAsync(); foreach (Folder fol in folders) { if (!Directory.Exists(fol.Path)) { this.unreachableFolderIDs.Add(fol.FolderID); } } }
private async Task InitializeAsync() { // Initialize Cache this.cache = new IndexerCache(this.factory); // IndexingEventArgs this.eventArgs = new IndexingStatusEventArgs(); this.eventArgs.IndexingAction = IndexingAction.Idle; // Get all files on disk which belong to a Collection Folder this.allDiskPaths = await this.folderRepository.GetPathsAsync(); }
public IndexingService(ISQLiteConnectionFactory factory, ICacheService cacheService, ITrackRepository trackRepository, IAlbumRepository albumRepository, IGenreRepository genreRepository, IArtistRepository artistRepository, IFolderRepository folderRepository) { this.cacheService = cacheService; this.factory = factory; this.trackRepository = trackRepository; this.albumRepository = albumRepository; this.genreRepository = genreRepository; this.artistRepository = artistRepository; this.folderRepository = folderRepository; this.watcherManager = new FolderWatcherManager(this.folderRepository); this.cache = new IndexerCache(this.factory); SettingsClient.SettingChanged += SettingsClient_SettingChanged; this.watcherManager.FoldersChanged += WatcherManager_FoldersChanged; this.isIndexing = false; }