update the updater

This commit is contained in:
Luke Pulverenti 2016-01-06 13:16:01 -05:00
parent 0996872738
commit 8b93bd6eab

View File

@ -88,7 +88,7 @@ namespace MediaBrowser.Common.Implementations.Updates
return null;
}
var asset = (obj.assets ?? new List<Asset>()).FirstOrDefault(i => string.Equals(assetFilename, Path.GetFileName(i.browser_download_url), StringComparison.OrdinalIgnoreCase));
var asset = (obj.assets ?? new List<Asset>()).FirstOrDefault(i => IsAsset(i, assetFilename));
if (asset == null)
{
@ -114,6 +114,18 @@ namespace MediaBrowser.Common.Implementations.Updates
};
}
private bool IsAsset(Asset asset, string assetFilename)
{
var downloadFilename = Path.GetFileName(asset.browser_download_url) ?? string.Empty;
if (downloadFilename.IndexOf(assetFilename, StringComparison.OrdinalIgnoreCase) != -1)
{
return true;
}
return string.Equals(assetFilename, downloadFilename, StringComparison.OrdinalIgnoreCase);
}
public class Uploader
{
public string login { get; set; }