public IndexingService( ISQLiteConnectionFactory factory, ICacheService cacheService, IInfoDownloadService infoDownloadService, ITerminationService cancellationService, ITrackRepository trackRepository, IFolderRepository folderRepository, IAlbumArtworkRepository albumArtworkRepository) { this.cacheService = cacheService; this.infoDownloadService = infoDownloadService; this.cancellationService = cancellationService; this.trackRepository = trackRepository; this.folderRepository = folderRepository; this.albumArtworkRepository = albumArtworkRepository; this.sqliteConnectionFactory = factory; this.watcherManager = new FolderWatcherManager(this.folderRepository); this.cache = new IndexerCache(this.sqliteConnectionFactory); SettingsClient.SettingChanged += SettingsClient_SettingChanged; this.watcherManager.FoldersChanged += WatcherManager_FoldersChanged; this.isIndexing = false; }
public EditMetadataBase(ICacheService cacheService, IInfoDownloadService infoDownloadService) { this.cacheService = cacheService; this.infoDownloadService = infoDownloadService; this.artwork = new MetadataArtworkValue(); this.ExportArtworkCommand = new DelegateCommand(async() => await this.ExportArtworkAsync(), () => this.CanExportArtwork()); }
public EditTrackViewModel(IList <string> paths, IMetadataService metadataService, IDialogService dialogService, ICacheService cacheService, IInfoDownloadService infoDownloadService) : base(cacheService, infoDownloadService) { this.multipleValuesText = "<" + ResourceUtils.GetString("Language_Multiple_Values") + ">"; this.metadataService = metadataService; this.dialogService = dialogService; this.infoDownloadService = infoDownloadService; this.paths = paths; this.HasMultipleArtwork = false; this.UpdateAlbumArtwork = false; this.LoadedCommand = new DelegateCommand(async() => { this.NagivateToSelectedPage(); await this.GetFilesMetadataAsync(); }); this.ChangeArtworkCommand = new DelegateCommand(async() => { if (!await OpenFileUtils.OpenImageFileAsync(new Action <byte[]>(this.UpdateArtwork))) { this.dialogService.ShowNotification( 0xe711, 16, ResourceUtils.GetString("Language_Error"), ResourceUtils.GetString("Language_Error_Changing_Image"), ResourceUtils.GetString("Language_Ok"), true, ResourceUtils.GetString("Language_Log_File")); } }); this.RemoveArtworkCommand = new DelegateCommand(() => this.UpdateArtwork(null)); this.DownloadArtworkCommand = new DelegateCommand(async() => await this.DownloadArtworkAsync(), () => this.CanDownloadArtwork()); }
public EditAlbumViewModel(AlbumViewModel albumViewModel, IMetadataService metadataService, IDialogService dialogService, ICacheService cacheService, IInfoDownloadService infoDownloadService) : base(cacheService, infoDownloadService) { this.albumViewModel = albumViewModel; this.metadataService = metadataService; this.dialogService = dialogService; this.cacheService = cacheService; this.infoDownloadService = infoDownloadService; this.LoadedCommand = new DelegateCommand(async() => await this.GetAlbumArtworkAsync()); this.ChangeArtworkCommand = new DelegateCommand(async() => { if (!await OpenFileUtils.OpenImageFileAsync(new Action <byte[]>(this.UpdateArtwork))) { this.dialogService.ShowNotification(0xe711, 16, ResourceUtils.GetString("Language_Error"), ResourceUtils.GetString("Language_Error_Changing_Image"), ResourceUtils.GetString("Language_Ok"), true, ResourceUtils.GetString("Language_Log_File")); } }); this.RemoveArtworkCommand = new DelegateCommand(() => this.UpdateArtwork(null)); this.DownloadArtworkCommand = new DelegateCommand(async() => await this.DownloadArtworkAsync(), () => this.CanDownloadArtwork()); }