private List<Queue> MapQueue(IEnumerable<DownloadClientItem> queueItems) { var queued = new List<Queue>(); foreach (var queueItem in queueItems) { foreach (var episode in queueItem.RemoteEpisode.Episodes) { var queue = new Queue(); queue.Id = queueItem.DownloadClientId.GetHashCode() + episode.Id; queue.Series = queueItem.RemoteEpisode.Series; queue.Episode = episode; queue.Quality = queueItem.RemoteEpisode.ParsedEpisodeInfo.Quality; queue.Title = queueItem.Title; queue.Size = queueItem.TotalSize; queue.Sizeleft = queueItem.RemainingSize; queue.Timeleft = queueItem.RemainingTime; queue.Status = queueItem.Status.ToString(); queue.RemoteEpisode = queueItem.RemoteEpisode; queued.Add(queue); } } return queued; }
private List<Queue> MapQueue(IEnumerable<QueueItem> queueItems) { var queued = new List<Queue>(); foreach (var queueItem in queueItems) { foreach (var episode in queueItem.RemoteEpisode.Episodes) { var queue = new Queue(); queue.Id = queueItem.Id.GetHashCode(); queue.Series = queueItem.RemoteEpisode.Series; queue.Episode = episode; queue.Quality = queueItem.RemoteEpisode.ParsedEpisodeInfo.Quality; queue.Title = queueItem.Title; queue.Size = queueItem.Size; queue.Sizeleft = queueItem.Sizeleft; queue.Timeleft = queueItem.Timeleft; queue.Status = queueItem.Status; queued.Add(queue); } } return queued; }