Skip to content

Commit

Permalink
10.9
Browse files Browse the repository at this point in the history
  • Loading branch information
crobibero committed Mar 25, 2024
1 parent 24d30df commit ce49b8e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>enable</Nullable>
Expand All @@ -19,7 +19,7 @@
<ItemGroup>
<PackageReference Include="Jellyfin.Common" Version="10.*-*" />
<PackageReference Include="Jellyfin.Controller" Version="10.*-*" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Expand Down
5 changes: 1 addition & 4 deletions Jellyfin.Plugin.OpenSubtitles/OpenSubtitleDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ public Task<SubtitleResponse> GetSubtitles(string id, CancellationToken cancella
/// <inheritdoc />
public async Task<IEnumerable<RemoteSubtitleInfo>> Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
{
if (request == null)
{
throw new ArgumentNullException(nameof(request));
}
ArgumentNullException.ThrowIfNull(request);

await Login(cancellationToken).ConfigureAwait(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ public static async Task<ApiResponse<LoginInfo>> LogInAsync(string username, str
/// <returns>logout status.</returns>
public static async Task<bool> LogOutAsync(LoginInfo user, string apiKey, CancellationToken cancellationToken)
{
if (string.IsNullOrEmpty(user.Token))
{
throw new ArgumentNullException(nameof(user.Token), "Token is null or empty");
}
ArgumentException.ThrowIfNullOrEmpty(user.Token);

var headers = new Dictionary<string, string> { { "Authorization", user.Token } };

Expand All @@ -60,10 +57,7 @@ public static async Task<bool> LogOutAsync(LoginInfo user, string apiKey, Cancel
/// <returns>The encapsulated user info.</returns>
public static async Task<ApiResponse<EncapsulatedUserInfo>> GetUserInfo(LoginInfo user, string apiKey, CancellationToken cancellationToken)
{
if (string.IsNullOrEmpty(user.Token))
{
throw new ArgumentNullException(nameof(user.Token), "Token is null or empty");
}
ArgumentException.ThrowIfNullOrEmpty(user.Token);

var headers = new Dictionary<string, string> { { "Authorization", user.Token } };

Expand All @@ -82,10 +76,7 @@ public static async Task<ApiResponse<EncapsulatedUserInfo>> GetUserInfo(LoginInf
/// <returns>The subtitle download info.</returns>
public static async Task<ApiResponse<SubtitleDownloadInfo>> GetSubtitleLinkAsync(int file, LoginInfo user, string apiKey, CancellationToken cancellationToken)
{
if (string.IsNullOrEmpty(user.Token))
{
throw new ArgumentNullException(nameof(user.Token), "Token is null or empty");
}
ArgumentException.ThrowIfNullOrEmpty(user.Token);

var headers = new Dictionary<string, string> { { "Authorization", user.Token } };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ public static async Task<HttpResponse> SendRequestAsync(
throw new ArgumentException("Provided API key is blank", nameof(apiKey));
}

if (!headers.ContainsKey("Api-Key"))
{
headers.Add("Api-Key", apiKey);
}

headers.TryAdd("Api-Key", apiKey);
if (_hRemaining == 0)
{
await Task.Delay(1000 * _hReset, cancellationToken).ConfigureAwait(false);
Expand Down
4 changes: 2 additions & 2 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: "Open Subtitles"
guid: "4b9ed42f-5185-48b5-9803-6ff2989014c4"
imageUrl: "https://repo.jellyfin.org/releases/plugin/images/jellyfin-plugin-opensubtitles.png"
version: 19
targetAbi: "10.8.10.0"
framework: "net6.0"
targetAbi: "10.9.0.0"
framework: "net8.0"
owner: "jellyfin"
overview: "Download subtitles for your media"
description: "Download subtitles from the internet to use with your media files."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down

0 comments on commit ce49b8e

Please sign in to comment.