/// <summary> /// Scans common system paths for music. Will clear existing library. /// </summary> /// <returns></returns> private async Task ScanForMusic() { List <MusicFile> musicFiles = new List <MusicFile>(); System.Environment.SpecialFolder[] defaultMusicPaths = { System.Environment.SpecialFolder.CommonMusic, System.Environment.SpecialFolder.MyMusic }; foreach (var folder in defaultMusicPaths) { var path = System.Environment.GetFolderPath(folder); var files = await GetFiles(path); musicFiles.AddRange(files); } JukeboxDb db = JukeboxDb.GetInstance(); await db.MusicFiles.Clear(); var numInserted = await db.MusicFiles.Add(musicFiles); }
public PlaylistController() : base() { _db = JukeboxDb.GetInstance(); _pdb = PlaylistDb.GetInstance(); }
public ConfigController() : base() { _db = new JukeboxDb(); }
public MediaManagerController() : base() { _db = JukeboxDb.GetInstance(); }
public ConfigController() : base() { _db = JukeboxDb.GetInstance(); }
public MusicPlayerController() { _db = JukeboxDb.GetInstance(); }