private async Task LoadDb() { Settings = SettingsRepo.Load().Result; SetThrottleSpeed( Settings.ThrottleSpeed == 0 || Settings.ThrottleSpeed == -1 ? "-1" : (Convert.ToDouble(Settings.ThrottleSpeed) / 1000000).ToString()); var initialFilesCount = await MusicFileRepo.CountAll(); var issueCount = await MusicFileRepo.CountIssues(); var uploadsCount = await MusicFileRepo.CountUploaded(); await RegistrySettings.SetStartWithWindows(Settings.StartWithWindows); SetStartWithWindows(Settings.StartWithWindows); SetDiscoveredFilesLabel(InitialFilesCount.ToString()); await BindWatchFoldersList(); await InitialiseFolderWatchers(); InitialFilesCount = Task.FromResult(initialFilesCount).Result; SetIssuesLabel(Task.FromResult(issueCount).Result.ToString()); SetUploadedLabel(Task.FromResult(uploadsCount).Result.ToString()); RunDebugCommands(); }
public void RepopulateAmountLables(bool includeDiscoveredFiles = false) { SetIssuesLabel(MusicFileRepo.CountIssues().Result.ToString()); SetUploadedLabel(MusicFileRepo.CountUploaded().Result.ToString()); if (includeDiscoveredFiles) { InitialFilesCount = MusicFileRepo.CountAll().Result; SetDiscoveredFilesLabel(InitialFilesCount.ToString()); } }
private async Task LoadDb() { Settings = SettingsRepo.Load().Result; SetThrottleSpeed( Settings.ThrottleSpeed == 0 || Settings.ThrottleSpeed == -1 ? "-1" : (Convert.ToDouble(Settings.ThrottleSpeed) / 1000000).ToString()); await RegistrySettings.SetStartWithWindows(Settings.StartWithWindows); SetStartWithWindows(Settings.StartWithWindows); SetAlsoUploadPlaylists(Settings.UploadPlaylists); await BindWatchFoldersList(); await InitialiseFolderWatchers(); if (WatchFolders.Count == 0) { SetAmountLabelsToZero(); } int initialFilesCount = await MusicFileRepo.CountAll(); int issueCount = await MusicFileRepo.CountIssues(); int uploadsCount = await MusicFileRepo.CountUploaded(); InitialFilesCount = Task.FromResult(initialFilesCount).Result; SetDiscoveredFilesLabel(InitialFilesCount.ToString()); SetIssuesLabel(Task.FromResult(issueCount).Result.ToString()); SetUploadedLabel(Task.FromResult(uploadsCount).Result.ToString()); Logger.ClearHistoricLogs(); RunDebugCommands(); EnableOptionButtons(true); }