summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Web/Controllers
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-09-24 01:10:17 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-09-24 01:10:17 -0400
commitd3f0c8e4d2d9ada099cba67c359c5df1d69a1257 (patch)
tree992e6bbf83bb19357f7486f902998fec53c9f214 /src/StardewModdingAPI.Web/Controllers
parent0863f9b7e5f165f2b1db8750b20ed35bc0c3701a (diff)
downloadSMAPI-d3f0c8e4d2d9ada099cba67c359c5df1d69a1257.tar.gz
SMAPI-d3f0c8e4d2d9ada099cba67c359c5df1d69a1257.tar.bz2
SMAPI-d3f0c8e4d2d9ada099cba67c359c5df1d69a1257.zip
add support for update checks from the Chucklefish mod site (#336)
Diffstat (limited to 'src/StardewModdingAPI.Web/Controllers')
-rw-r--r--src/StardewModdingAPI.Web/Controllers/ModsController.cs11
1 files changed, 9 insertions, 2 deletions
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