From d3f0c8e4d2d9ada099cba67c359c5df1d69a1257 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 24 Sep 2017 01:10:17 -0400 Subject: add support for update checks from the Chucklefish mod site (#336) --- src/StardewModdingAPI.Web/Controllers/ModsController.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/StardewModdingAPI.Web/Controllers') diff --git a/src/StardewModdingAPI.Web/Controllers/ModsController.cs b/src/StardewModdingAPI.Web/Controllers/ModsController.cs index 8fc2cb51..c5c79600 100644 --- a/src/StardewModdingAPI.Web/Controllers/ModsController.cs +++ b/src/StardewModdingAPI.Web/Controllers/ModsController.cs @@ -5,9 +5,9 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Options; +using StardewModdingAPI.Models; using StardewModdingAPI.Web.Framework.ConfigModels; using StardewModdingAPI.Web.Framework.ModRepositories; -using StardewModdingAPI.Models; namespace StardewModdingAPI.Web.Controllers { @@ -41,14 +41,21 @@ namespace StardewModdingAPI.Web.Controllers this.Cache = cache; this.CacheMinutes = config.CacheMinutes; + string version = this.GetType().Assembly.GetName().Version.ToString(3); this.Repositories = new IModRepository[] { + new ChucklefishRepository( + vendorKey: config.ChucklefishKey, + userAgent: string.Format(config.ChucklefishUserAgent, version), + baseUrl: config.ChucklefishBaseUrl, + modPageUrlFormat: config.ChucklefishModPageUrlFormat + ), new GitHubRepository( vendorKey: config.GitHubKey, baseUrl: config.GitHubBaseUrl, releaseUrlFormat: config.GitHubReleaseUrlFormat, - userAgent: config.GitHubUserAgent, + userAgent: string.Format(config.GitHubUserAgent, version), acceptHeader: config.GitHubAcceptHeader, username: config.GitHubUsername, password: config.GitHubPassword -- cgit