public async Task SaveTagsNow() { List <SongData> l = new List <SongData>(); if (songs.Count != 0) { var currSong = Library.Current.GetCurrentPlayingSong(); if (currSong == null) { return; } FileTagsUpdater tagsUpdater = new FileTagsUpdater(); foreach (var item in songs) { if (currSong.SongId != item.SongId) { await tagsUpdater.UpdateFileTags(item); } else { l.Add(item); } } songs = new List <SongData>(); ApplicationSettingsHelper.ReadResetSettingsValue("savelatertags"); foreach (var item in l) { SaveTagsLater(item); } } }
public async Task SaveRatingsNow() { List <Tuple <int, int> > l = new List <Tuple <int, int> >(); if (ratings.Count != 0) { var currSong = Library.Current.GetCurrentPlayingSong(); if (currSong == null) { return; } FileTagsUpdater tagsUpdater = new FileTagsUpdater(); foreach (var item in ratings) { if (currSong.SongId != item.Item1) { await tagsUpdater.UpdateRating(item.Item1, item.Item2); } else { l.Add(item); } } ratings = new List <Tuple <int, int> >(); ApplicationSettingsHelper.ReadResetSettingsValue("savelaterratings"); foreach (var item in l) { SaveRatingLater(item.Item1, item.Item2); } } }