Esempio n. 1
0
        public static ModDetailList GetModDetails(PublishedFileDetailsResponse response, string modsRootFolder)
        {
            var result = new ModDetailList();

            if (response != null && response.publishedfiledetails != null)
            {
                foreach (var detail in response.publishedfiledetails)
                {
                    result.Add(ModDetail.GetModDetail(detail));
                }
                result.SetPublishedFileIndex();
                result.PopulateExtended(modsRootFolder);
            }
            return(result);
        }
Esempio n. 2
0
        public static ModDetailList GetModDetails(PublishedFileDetailsResponse response, string modsRootFolder, List <string> modIdList)
        {
            var result = new ModDetailList();

            if (modIdList != null)
            {
                foreach (var modId in modIdList)
                {
                    result.Add(new ModDetail()
                    {
                        AppId       = "",
                        ModId       = modId,
                        TimeUpdated = 0,
                        Title       = "Mod details not available",
                        IsValid     = false,
                    });
                }
            }

            if (response != null && response.publishedfiledetails != null)
            {
                foreach (var detail in response.publishedfiledetails)
                {
                    var temp = result.FirstOrDefault(d => d.ModId == detail.publishedfileid);
                    if (temp == null)
                    {
                        result.Add(ModDetail.GetModDetail(detail));
                    }
                    else
                    {
                        temp.AppId       = detail.creator_app_id;
                        temp.ModId       = detail.publishedfileid;
                        temp.TimeUpdated = detail.time_updated;
                        temp.Title       = detail.title;
                        temp.IsValid     = true;
                    }
                }
            }

            result.SetPublishedFileIndex();
            result.PopulateExtended(modsRootFolder);
            return(result);
        }