add option to prefer directlinks
This commit is contained in:
@@ -66,7 +66,7 @@ public class ModpackFactory
|
|||||||
var releases = await github.Repository.Release.GetAll(repo.Id);
|
var releases = await github.Repository.Release.GetAll(repo.Id);
|
||||||
return releases.Select(r => new KeyValuePair<string, string>(r.Name ?? r.TagName, r.TagName)).ToArray();
|
return releases.Select(r => new KeyValuePair<string, string>(r.Name ?? r.TagName, r.TagName)).ToArray();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,9 @@ public class ModpackInstaller(ModpackConfig updateConfig, ModpackInfo modpackInf
|
|||||||
foreach (InstallAction iaction in checkResult.Actions)
|
foreach (InstallAction iaction in checkResult.Actions)
|
||||||
{
|
{
|
||||||
var destFilePath = Path.Combine(modpackInfo.LocaLPath, iaction.DestPath);
|
var destFilePath = Path.Combine(modpackInfo.LocaLPath, iaction.DestPath);
|
||||||
var sourceUrl = await factory.ResolveSourceUrl(iaction);
|
var sourceUrl = updateConfig.PreferDirectLinks && !string.IsNullOrWhiteSpace(iaction.SourceUrl)
|
||||||
|
? iaction.SourceUrl
|
||||||
|
: await factory.ResolveSourceUrl(iaction);
|
||||||
|
|
||||||
if (iaction is UpdateAction uaction)
|
if (iaction is UpdateAction uaction)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ public class ModpackConfig
|
|||||||
public string InstallUrl { get; set; }
|
public string InstallUrl { get; set; }
|
||||||
public string UnleashApiUrl { get; set; }
|
public string UnleashApiUrl { get; set; }
|
||||||
public string UnleashInstanceId { get; set; }
|
public string UnleashInstanceId { get; set; }
|
||||||
|
public bool PreferDirectLinks { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string ConfigUrl { get; set; }
|
public string ConfigUrl { get; set; }
|
||||||
|
|||||||
Reference in New Issue
Block a user