예제 #1
0
        /// <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);
        }
예제 #2
0
 public PlaylistController() : base()
 {
     _db  = JukeboxDb.GetInstance();
     _pdb = PlaylistDb.GetInstance();
 }
예제 #3
0
 public ConfigController() : base()
 {
     _db = new JukeboxDb();
 }
예제 #4
0
 public MediaManagerController() : base()
 {
     _db = JukeboxDb.GetInstance();
 }
예제 #5
0
 public ConfigController() : base()
 {
     _db = JukeboxDb.GetInstance();
 }
예제 #6
0
 public MusicPlayerController()
 {
     _db = JukeboxDb.GetInstance();
 }