mirror of
https://github.com/jellyfin/jellyfin-plugin-fanart.git
synced 2024-11-26 23:20:31 +00:00
Merge pull request #16 from crobibero/joshuaboniface-patch-1
Fix Build for 10.5 update
This commit is contained in:
commit
8980fe4975
@ -5,5 +5,6 @@ namespace Jellyfin.Plugin.Fanart.Configuration
|
||||
public class PluginConfiguration : BasePluginConfiguration
|
||||
{
|
||||
public string PersonalApiKey { get; set; }
|
||||
public const int DefaultBufferSize = 4096;
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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; }
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user