public bool InsertAllElements(T element, int playListId) { bool result = false; ProgressHelper.SetProgress("Loading playlist info...", 0); var playListInfo = element.GetAllElements(); int idx = 0; foreach (var item in playListInfo) { double percent = ((double)++idx / (double)playListInfo.Count) * 100.0; ProgressHelper.SetProgress($"Saving playlist info {idx + 1} of {playListInfo.Count}", (int)percent); int id = -1; id = _playlistItemRepository.InsertItem(new Persistence.Models.PlaylistItem() { NewName = item.Name, Address = item.Id, PlayListId = playListId, }); result |= id != -1; } ProgressHelper.SetProgress("Finished.", 0); return(result); }
public bool InsertAllElements(T element, int playListId) { bool result = -1 != _playlistItemRepository.InsertItem(new Persistence.Models.PlaylistItem() { NewName = element.Name, Address = element.Id, PlayListId = playListId, }); return(result); }
public bool InsertAllElements(T element, int playListId) { bool result = false; foreach (var item in element.GetAllElements()) { _playlistItemRepository.InsertItem(new Persistence.Models.PlaylistItem() { NewName = item.Name, Address = item.Id, PlayListId = playListId, }); } return(result); }