示例#1
0
        public static void RemoveInvalidSongFromDatabase()
        {
            List <SongModel> ListSong = SongDataAccess.GetAllUserSongList();

            foreach (SongModel song in ListSong)
            {
                if (File.Exists($@"{GeneralDataManagement.UserMusicFolderLocation}\{song.SongLocation}") == false)
                {
                    SongDataAccess.DeleteSongFromDatabase(song.SongKey);
                }
            }
        }
示例#2
0
        public static List <SongModel> GetUpNextList()
        {
            List <SongModel> song_list = new List <SongModel>();

            song_list = SongDataAccess.GetAllUserSongList();

            //String Folder = @"C:\Users\19520\Music\NovapoMusee";
            //String FileType = "*.mp3";
            //DirectoryInfo dinfo = new DirectoryInfo(Folder);
            //FileInfo[] Files = dinfo.GetFiles(FileType);
            //foreach (FileInfo file in Files)
            //{
            //    //ListAudio.Items.Add(file.Name);
            //    song_list.Add(new SongModel(file.FullName,file.Name,file.Name));
            //}
            Console.WriteLine();

            return(song_list);
        }