public DlcOwnership Calculate(OfficialDlcList dlcList, ExistingDlcList existingList) { var rv = new DlcOwnership(); var dlcMatches = _dlcMatchCalculator.GetDlcMatches(dlcList.DlcList, existingList.DlcList); rv.MissingOfficialDlc = dlcMatches.Where(x => x.MatchResult == MatchResultType.UnmatchedLeftDlc).Select(x => x.LeftDlc).ToList(); rv.UnknownExisting = dlcMatches.Where(x => x.MatchResult == MatchResultType.UnmatchedRightDlc).Select(x => x.RightDlc).ToList(); rv.SongPacks = CreateSongPackDetails(dlcList.DlcList, dlcMatches); return(rv); }
private OfficialDlcList ParsePage(HtmlDocument doc, string songsXPath) { var rv = new OfficialDlcList(); var value = doc.DocumentNode .SelectNodes(songsXPath) .FirstOrDefault(); if (value == null) { rv.Errors.Add("Could not find the list of official DLC inside the page"); return(rv); } var rawList = from dlcRow in value.SelectNodes("song") select MapToOfficialDlcItem(dlcRow); rv.DlcList.AddRange(RemapOfficialDlc(rawList)); return(rv); }