public void Handle(SetBackgroundAudioFiles message) { this.log.Information("Set background audio files"); this.backgroundAudioTracks = message.Filenames .Select(x => Path.Combine(FileStoragePath, FileTypes.AudioBackground.ToString(), x)).ToList(); if (this.backgroundAudioPlaying) { PlayNextBackground(); } }
public void Handle(SetBackgroundAudioFiles message) { lock (this.downloadQueue) { foreach (string filename in message.Filenames) { if (!this.downloadQueue.Contains(filename)) { this.downloadQueue.Add(filename); } } } if (this.downloadQueue.Any()) { Task.Run(() => { CheckDownloadQueue(); }); } this.main.Handle(message); }