public void AddOrUpdate(string uuid, IWorkshopPublishFileDetails d, List <string> tags) { // Mods may have the same UUID, so use the WorkshopID instead. var cachedData = Mods.FirstOrDefault(x => x.WorkshopID == d.publishedfileid); if (cachedData != null) { cachedData.LastUpdated = d.time_updated; cachedData.Created = d.time_created; cachedData.Tags = tags; } else { Mods.Add(new DivinityModWorkshopCachedData() { Created = d.time_created, LastUpdated = d.time_updated, UUID = uuid, WorkshopID = d.publishedfileid, Tags = tags }); } NonWorkshopMods.Remove(uuid); CacheUpdated = true; }
public void AddNonWorkshopMod(string uuid) { if (!NonWorkshopMods.Any(x => x == uuid)) { NonWorkshopMods.Add(uuid); } CacheUpdated = true; }