Merge pull request #16 from crobibero/joshuaboniface-patch-1

Fix Build for 10.5 update
This commit is contained in:
Joshua M. Boniface 2020-03-24 18:20:44 -04:00 committed by GitHub
commit 8980fe4975
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 10 deletions

View File

@ -5,5 +5,6 @@ namespace Jellyfin.Plugin.Fanart.Configuration
public class PluginConfiguration : BasePluginConfiguration
{
public string PersonalApiKey { get; set; }
public const int DefaultBufferSize = 4096;
}
}

View File

@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<RootNamespace>Jellyfin.Plugin.Fanart</RootNamespace>
<AssemblyVersion>3.0.0</AssemblyVersion>
<FileVersion>3.0.0</FileVersion>
<AssemblyVersion>4.0.0</AssemblyVersion>
<FileVersion>4.0.0</FileVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

View File

@ -10,6 +10,7 @@ namespace Jellyfin.Plugin.Fanart
{
public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
{
private readonly Guid _id = new Guid("170a157f-ac6c-437a-abdd-ca9c25cebd39");
public const string ApiKey = "184e1a2b1fe3b94935365411f919f638";
public const string BaseUrl = "https://webservice.fanart.tv/v3/{2}/{1}?api_key={0}";
@ -23,7 +24,7 @@ namespace Jellyfin.Plugin.Fanart
public override string Name => "Fanart";
/// <inheritdoc />
public override Guid Id { get; } = new Guid("170a157f-ac6c-437a-abdd-ca9c25cebd39");
public override Guid Id => _id;
public static Plugin Instance { get; private set; }

View File

@ -7,6 +7,7 @@ using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Plugin.Fanart.Configuration;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
@ -253,9 +254,9 @@ namespace Jellyfin.Plugin.Fanart.Providers
},
HttpMethod.Get).ConfigureAwait(false))
using (var response = httpResponse.Content)
using (var saveFileStream = new FileStream(jsonPath, FileMode.Create, FileAccess.Write, FileShare.Read, StreamDefaults.DefaultFileStreamBufferSize, true))
using (var saveFileStream = new FileStream(jsonPath, FileMode.Create, FileAccess.Write, FileShare.Read, PluginConfiguration.DefaultBufferSize, FileOptions.Asynchronous))
{
await response.CopyToAsync(saveFileStream).ConfigureAwait(false);
await response.CopyToAsync(saveFileStream, CancellationToken.None).ConfigureAwait(false);
}
}
catch (HttpException ex)

View File

@ -7,6 +7,7 @@ using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Plugin.Fanart.Configuration;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
@ -271,9 +272,9 @@ namespace Jellyfin.Plugin.Fanart.Providers
},
HttpMethod.Get).ConfigureAwait(false))
using (var response = httpResponse.Content)
using (var fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read, StreamDefaults.DefaultFileStreamBufferSize, true))
using (var fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read, PluginConfiguration.DefaultBufferSize, FileOptions.Asynchronous))
{
await response.CopyToAsync(fileStream).ConfigureAwait(false);
await response.CopyToAsync(fileStream, CancellationToken.None).ConfigureAwait(false);
}
}
catch (HttpException exception)

View File

@ -7,6 +7,7 @@ using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Plugin.Fanart.Configuration;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
@ -316,9 +317,9 @@ namespace Jellyfin.Plugin.Fanart.Providers
},
HttpMethod.Get).ConfigureAwait(false))
using (var response = httpResponse.Content)
using (var fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read, StreamDefaults.DefaultFileStreamBufferSize, true))
using (var fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read, PluginConfiguration.DefaultBufferSize, FileOptions.Asynchronous))
{
await response.CopyToAsync(fileStream).ConfigureAwait(false);
await response.CopyToAsync(fileStream, CancellationToken.None).ConfigureAwait(false);
}
}
catch (HttpException exception)