diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-07-29 16:43:25 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-09-14 18:59:29 -0400 |
commit | 1d085df5b796e02b3e9e6874bd4e5684e840cb92 (patch) | |
tree | 9c0bb39b7bc6e4618ed2bad4ca17af6f82b1a737 /src/SMAPI.Web/Framework/Caching | |
parent | 2b4bc2c282e17ba431f9a6ec1892b87a37eb4bb7 (diff) | |
download | SMAPI-1d085df5b796e02b3e9e6874bd4e5684e840cb92.tar.gz SMAPI-1d085df5b796e02b3e9e6874bd4e5684e840cb92.tar.bz2 SMAPI-1d085df5b796e02b3e9e6874bd4e5684e840cb92.zip |
track license info for mod GitHub repos (#651)
Diffstat (limited to 'src/SMAPI.Web/Framework/Caching')
-rw-r--r-- | src/SMAPI.Web/Framework/Caching/Mods/CachedMod.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/SMAPI.Web/Framework/Caching/Mods/CachedMod.cs b/src/SMAPI.Web/Framework/Caching/Mods/CachedMod.cs index fe8a7a1f..96eca847 100644 --- a/src/SMAPI.Web/Framework/Caching/Mods/CachedMod.cs +++ b/src/SMAPI.Web/Framework/Caching/Mods/CachedMod.cs @@ -58,6 +58,12 @@ namespace StardewModdingAPI.Web.Framework.Caching.Mods /// <summary>The URL for the mod page.</summary> public string Url { get; set; } + /// <summary>The license URL, if available.</summary> + public string LicenseUrl { get; set; } + + /// <summary>The license name, if available.</summary> + public string LicenseName { get; set; } + /********* ** Accessors @@ -86,12 +92,16 @@ namespace StardewModdingAPI.Web.Framework.Caching.Mods this.MainVersion = mod.Version; this.PreviewVersion = mod.PreviewVersion; this.Url = mod.Url; + this.LicenseUrl = mod.LicenseUrl; + this.LicenseName = mod.LicenseName; } /// <summary>Get the API model for the cached data.</summary> public ModInfoModel GetModel() { - return new ModInfoModel(name: this.Name, version: this.MainVersion, previewVersion: this.PreviewVersion, url: this.Url).WithError(this.FetchStatus, this.FetchError); + return new ModInfoModel(name: this.Name, version: this.MainVersion, url: this.Url, previewVersion: this.PreviewVersion) + .SetLicense(this.LicenseUrl, this.LicenseName) + .SetError(this.FetchStatus, this.FetchError); } } } |