Compare commits

...

42 Commits

Author SHA1 Message Date
DarkFighterLuke 2bdee20beb Add packages read permission 2024-05-14 22:19:07 +02:00
DarkFighterLuke a085a5a4bf Add Jellyfin GitHub Nuget registry to sources 2024-05-14 22:06:27 +02:00
DarkFighterLuke 3f0267ced0 Use net8.0 for the builds 2024-05-14 21:57:01 +02:00
DarkFighterLuke 70123f597a Merge branch 'master' of github.com:tubearchivist/tubearchivist-jf-plugin 2024-05-14 21:54:55 +02:00
DarkFighterLuke b4d6ea2646 Use net8.0 for the builds 2024-05-14 21:54:13 +02:00
DarkFighterLuke e0ef8b1e86 Update Jellyfin depndencies version 2024-05-14 21:53:49 +02:00
DarkFighterLuke 362582dddf Update version 2024-05-14 20:29:44 +02:00
DarkFighterLuke 1c49427761 Merge branch 'jellyfin-10.9' of github.com:tubearchivist/tubearchivist-jf-plugin 2024-05-14 20:17:26 +02:00
DarkFighterLuke 49effb3d3f Update README.md 2024-05-14 20:08:01 +02:00
DarkFighterLuke 66e6a49cc7 Change jprm action commit 2024-05-14 19:51:13 +02:00
DarkFighterLuke 3dca19c3e5 Update version 2024-05-14 19:50:24 +02:00
DarkFighterLuke 55ab16a01a Fix plugin URL in manifest.json 2024-05-14 19:50:14 +02:00
DarkFighterLuke 08c8df0292 Update manifest.json
Signed-off-by: DarkFighterLuke <DarkFighterLuke@users.noreply.github.com>
2024-05-14 17:37:20 +00:00
DarkFighterLuke 1a8f3b1aa7 Update build.yaml 2024-05-14 19:32:41 +02:00
DarkFighterLuke 59bfaa077e Use master branch as ref in checkout 2024-05-14 19:23:05 +02:00
DarkFighterLuke 9635a49c06 Fix pull parameter 2024-05-14 19:18:01 +02:00
DarkFighterLuke 00eeff552c Fix pull parameter 2024-05-14 19:14:48 +02:00
DarkFighterLuke 4294e7d138 Add pull parameter 2024-05-14 19:13:04 +02:00
DarkFighterLuke b2c7ba6509 Add fetch paramter 2024-05-14 19:09:22 +02:00
DarkFighterLuke 81895dadab Fix parameter for push 2024-05-14 19:04:06 +02:00
DarkFighterLuke 59710b2aba Fix parameter for push 2024-05-14 19:01:00 +02:00
DarkFighterLuke f34db507b0 Add parameter for push 2024-05-14 18:59:39 +02:00
DarkFighterLuke a2432beaa2 Replace action to commit manifest 2024-05-14 18:56:57 +02:00
DarkFighterLuke c908ea5b9c Update action commit 2024-05-14 18:46:15 +02:00
DarkFighterLuke e61beea66b Update action commit 2024-05-14 18:41:28 +02:00
DarkFighterLuke 61b3849406 Update action commit 2024-05-14 17:25:58 +02:00
DarkFighterLuke cb9f79b3fa Update action commit 2024-05-14 17:23:08 +02:00
DarkFighterLuke cf7cdb1ab3 Set as string 2024-05-14 17:16:13 +02:00
DarkFighterLuke f202240fe6 Remove comment 2024-05-14 17:13:16 +02:00
DarkFighterLuke b9d0aeeb05 Update action commit 2024-05-14 17:11:43 +02:00
DarkFighterLuke 46ac3cfdfa Merge branch 'master' of github.com:DarkFighterLuke/TubeArchivistMetadata
build.yaml
2024-05-14 17:05:48 +02:00
DarkFighterLuke a00060ca9c Use DarkFighterLuke jprm fork 2024-05-14 17:01:31 +02:00
DarkFighterLuke c3f5248c80 Merge branch 'master' of github.com:tubearchivist/tubearchivist-jf-plugin 2024-05-09 23:56:08 +02:00
DarkFighterLuke 9921dd2308 Update manifest.json 2024-05-09 23:52:37 +02:00
DarkFighterLuke 1fcbbba49f Update manifest.json 2024-05-09 23:37:43 +02:00
DarkFighterLuke 4557ab6efd Update manifest.json 2024-05-09 23:33:53 +02:00
DarkFighterLuke 9febfef12a Ping TubeArchivist API when saving configuration and at boot 2024-05-09 22:53:56 +02:00
DarkFighterLuke 8842a5fdf9 Add a second line for testing 2024-05-09 10:17:57 +02:00
DarkFighterLuke 40d5c90c4c Change required .NET version in README.md 2024-05-01 22:19:39 +02:00
DarkFighterLuke 634b3f7dc7 Merge branch 'master' of github.com:tubearchivist/tubearchivist-jf-plugin into jellyfin-10.9 2024-05-01 22:17:50 +02:00
DarkFighterLuke 195acd2f1b Reference Jellyfin 10.9 DLLs 2024-04-26 12:35:53 +02:00
DarkFighterLuke 14032d3ed3 Adapt to support Jellyfin 10.9 API 2024-04-26 11:57:42 +02:00
12 changed files with 177 additions and 33 deletions
+21 -11
View File
@@ -11,12 +11,13 @@ jobs:
name: Build & Release
permissions:
contents: write
packages: read
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
ref: master
fetch-depth: 0
- name: Get release version
@@ -26,7 +27,15 @@ jobs:
- name: Setup .Net
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- name: Add Jellyfin GitHub Nuget registry to sources
run: |
dotnet nuget add source \
--username DarkFighterLuke \
--password ${{ secrets.GITHUB_TOKEN }} \
--store-password-in-clear-text \
--name github https://nuget.pkg.github.com/jellyfin/index.json
- name: Get version number only
run: |
@@ -51,11 +60,12 @@ jobs:
- name: Build Jellyfin Plugin
uses: oddstr13/jellyfin-plugin-repository-manager@843260fcdfda7cba229c5abd77bdd9c6fc4e850b # v1.1.0
uses: DarkFighterLuke/jellyfin-plugin-repository-manager@7a96768accc155ac7b597351b5033532f3c48173
id: jprm
with:
dotnet-target: net6.0
dotnet-target: net8.0
version: ${VERSION}
update-manifest: "true"
- name: Create release
uses: ncipollo/release-action@v1
@@ -67,10 +77,10 @@ jobs:
tag: ${{ steps.newtag.outputs.tag }}
allowUpdates: true
- name: Update manifest.json
uses: stefanzweifel/git-auto-commit-action@v4
- name: Commit manifest.json
uses: EndBug/add-and-commit@v9
with:
branch: master
commit_message: "Update manifest.json"
file_pattern: manifest.json
skip_fetch: true
add: manifest.json
commit: --signoff
message: "Update manifest.json"
pull: "--no-rebase -X ours origin master"
+3 -3
View File
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<Version>1.2.3.0</Version>
<AssemblyVersion>1.2.3.0</AssemblyVersion>
<FileVersion>1.2.3.0</FileVersion>
<Version>1.3.0.0</Version>
<AssemblyVersion>1.3.0.0</AssemblyVersion>
<FileVersion>1.3.0.0</FileVersion>
</PropertyGroup>
</Project>
@@ -13,6 +13,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Configuration
{
private ILogger _logger;
private string _tubeArchivistUrl;
private string _tubeArchivistApiKey;
/// <summary>
/// Initializes a new instance of the <see cref="PluginConfiguration"/> class.
@@ -30,7 +31,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Configuration
CollectionTitle = string.Empty;
_tubeArchivistUrl = string.Empty;
TubeArchivistApiKey = string.Empty;
_tubeArchivistApiKey = string.Empty;
MaxDescriptionLength = 500;
}
@@ -60,13 +61,27 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Configuration
_logger.LogInformation("{Message}", "Given TubeArchivist URL contains no schema. Adding http://...");
_tubeArchivistUrl = Utils.SanitizeUrl("http://" + value);
}
Plugin.Instance?.LogTAApiConnectionStatus();
}
}
/// <summary>
/// Gets or sets TubeArchivist API key.
/// </summary>
public string TubeArchivistApiKey { get; set; }
public string TubeArchivistApiKey
{
get
{
return _tubeArchivistApiKey;
}
set
{
_tubeArchivistApiKey = value;
Plugin.Instance?.LogTAApiConnectionStatus();
}
}
/// <summary>
/// Gets or sets maximum series and episodes overviews length.
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Jellyfin.Plugin.TubeArchivistMetadata</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
@@ -11,8 +11,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Jellyfin.Controller" Version="10.8.13" />
<PackageReference Include="Jellyfin.Model" Version="10.8.13" />
<PackageReference Include="Jellyfin.Controller" Version="10.9.0-20240509061132" />
<PackageReference Include="Jellyfin.Model" Version="10.9.0-20240509061132" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
@@ -2,7 +2,9 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.Net.Http;
using System.Threading.Tasks;
using Jellyfin.Plugin.TubeArchivistMetadata.Configuration;
using Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Model.Plugins;
@@ -34,6 +36,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
HttpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Token", Instance?.Configuration.TubeArchivistApiKey);
logger.LogInformation("{Message}", "Collection display name: " + Instance?.Configuration.CollectionTitle);
logger.LogInformation("{Message}", "TubeArchivist API URL: " + Instance?.Configuration.TubeArchivistUrl);
logger.LogInformation("{Message}", "Pinging TubeArchivist API...");
}
/// <inheritdoc />
@@ -66,5 +69,28 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Configuration.configPage.html", GetType().Namespace)
}
};
/// <summary>
/// Logs the TubeArchivist API connection status.
/// </summary>
public void LogTAApiConnectionStatus()
{
Logger.LogInformation("{Message}", "Ping...");
var api = TubeArchivistApi.GetInstance();
Task.Run(() => api.Ping()).ContinueWith(
task =>
{
if (task.Result != null)
{
Logger.LogInformation("{Message}", "TubeArchivist API said: " + task.Result.Response + "!");
}
else
{
Logger.LogCritical("{Message}", "TubeArchivist API was unreachable!");
}
},
TaskScheduler.Default);
}
}
}
@@ -63,7 +63,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
{
Name = video.Channel.Name,
ImageUrl = video.Channel.ThumbUrl,
Type = PersonType.Actor,
Type = Data.Enums.PersonKind.Actor,
});
result.HasMetadata = true;
result.Item = video.ToEpisode();
@@ -62,7 +62,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
{
Name = channel.Name,
ImageUrl = channel.ThumbUrl,
Type = PersonType.Actor,
Type = Data.Enums.PersonKind.Actor,
});
result.HasMetadata = true;
result.Item = channel.ToSeries();
@@ -0,0 +1,44 @@
using Newtonsoft.Json;
namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
{
/// <summary>
/// A class representing TubeArchivist API ping response data.
/// </summary>
public class PingResponse
{
/// <summary>
/// Initializes a new instance of the <see cref="PingResponse"/> class.
/// </summary>
/// <param name="response">Response from the API ("pong").</param>
/// <param name="user">TubeArchivist user id.</param>
/// <param name="version">TubeArchivist version.</param>
public PingResponse(
string response,
int user,
string version)
{
this.Response = response;
this.User = user;
this.Version = version;
}
/// <summary>
/// Gets response to the ping ("pong").
/// </summary>
[JsonProperty(PropertyName = "response")]
public string Response { get; }
/// <summary>
/// Gets user id.
/// </summary>
[JsonProperty(PropertyName = "user")]
public int User { get; }
/// <summary>
/// Gets TubeArchivist version.
/// </summary>
[JsonProperty(PropertyName = "version")]
public string Version { get; }
}
}
@@ -116,5 +116,35 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
return video?.Data;
}
/// <summary>
/// Validates connection and authentication to TubeArchivist.
/// </summary>
/// <returns>The ping response.</returns>
public async Task<PingResponse?> Ping()
{
PingResponse? pong = null;
var pingEndpoint = "/api/ping/";
var url = new Uri(Utils.SanitizeUrl(Plugin.Instance!.Configuration.TubeArchivistUrl + pingEndpoint));
var response = await client.GetAsync(url).ConfigureAwait(true);
while (response.StatusCode == HttpStatusCode.Moved)
{
url = response.Headers.Location;
_logger.LogInformation("{Message}", "Received redirect to: " + url);
response = await client.GetAsync(url).ConfigureAwait(true);
}
_logger.LogInformation("{Message}", url + ": " + response.StatusCode);
if (response.IsSuccessStatusCode)
{
string rawData = await response.Content.ReadAsStringAsync().ConfigureAwait(true);
pong = JsonConvert.DeserializeObject<PingResponse>(rawData);
}
return pong;
}
}
}
+4 -1
View File
@@ -5,6 +5,9 @@
<br/>
</p>
> [!IMPORTANT]
> Jellyfin 10.9.1 has been finally released, since the plugin is maintained only for the latest Jellyfin release, in order to continue using this plugin with all the latest features you will need to upgrade your Jellyfin installation.
## About
<p>This plugin adds the metadata provider for <a href="https://www.tubearchivist.com/">TubeArchivist</a>, offering improved flexibility and native integration with Jellyfin compared to previous solutions.</p>
@@ -64,7 +67,7 @@ _NOTE: If you are using Docker containers, it is important to mount the TubeArch
## Build
1. To build this plugin you will need [.Net 6.x](https://dotnet.microsoft.com/download/dotnet/6.0).
1. To build this plugin you will need [.Net 8.x](https://dotnet.microsoft.com/download/dotnet/8.0).
2. Build plugin with following command
```
+4 -4
View File
@@ -2,9 +2,9 @@
name: "TubeArchivistMetadata"
guid: "dc97d0c6-28b0-4242-afb4-5833ae1b3715"
imageUrl: https://raw.githubusercontent.com/tubearchivist/tubearchivist-jf-plugin/master/images/logo.png
version: "1.2.4.0"
targetAbi: "10.8.0.0"
framework: "net6.0"
version: "1.3.0.0"
targetAbi: "10.9.1.0"
framework: "net8.0"
overview: "Metadata for your TubeArchivist library on Jellyfin"
description: >
TubeArchivistMetadata is a plugin that automatically manages
@@ -14,4 +14,4 @@ owner: "DarkFighterLuke"
artifacts:
- "Jellyfin.Plugin.TubeArchivistMetadata.dll"
changelog: >
Fix issues with directory separators
Add support for Jellyfin 10.9.1
+23 -7
View File
@@ -8,11 +8,27 @@
"overview": "Metadata for your TubeArchivist library on Jellyfin",
"imageUrl": "https://raw.githubusercontent.com/tubearchivist/tubearchivist-jf-plugin/master/images/logo.png",
"versions": [
{
"version": "1.2.5.0",
"changelog": "Ping the TA API to validate connection\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.5/tubearchivistmetadata_1.2.5.0.zip",
"checksum": "e4a0d076ffd84c976ad66dde91dfb840",
"timestamp": "2024-05-14T17:37:17Z"
},
{
"version": "1.2.4.0",
"changelog": "Fix issues with directory separators\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.4/tubearchivistmetadata_1.2.4.0.zip",
"checksum": "b418a46d458fe28354580d70748b1ced",
"timestamp": "2024-05-09 15:41:00"
},
{
"version": "1.2.3.0",
"changelog": "Add fix for unclosed HTML breaks\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.3/TubeArchivistMetadata-1.2.3.zip",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.3/tubearchivistmetadata_1.2.3.0.zip",
"checksum": "f5328a662444739eaa7c59855bfcb203",
"timestamp": "2024-04-18 21:45:00"
},
@@ -20,7 +36,7 @@
"version": "1.2.2.0",
"changelog": "Fix bug on description length substringing\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.2/TubeArchivistMetadata-1.2.2.zip",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.2/tubearchivistmetadata_1.2.2.0.zip",
"checksum": "82d04546916e1ba76d56de28e648447a",
"timestamp": "2024-03-15 10:12:00"
},
@@ -28,7 +44,7 @@
"version": "1.2.1.0",
"changelog": "Make maximum description length configurable\nTruncate descriptions to 500 characters\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.1/TubeArchivistMetadata-1.2.1.zip",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.1/tubearchivistmetadata_1.2.1.0.zip",
"checksum": "cf68d169956f166a6ee68a06192651c2",
"timestamp": "2024-03-14 21:50:00"
},
@@ -36,7 +52,7 @@
"version": "1.2.0.0",
"changelog": "Add episodes and series overview\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.0/TubeArchivistMetadata-1.2.0.zip",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.2.0/tubearchivistmetadata_1.2.0.0.zip",
"checksum": "75812a4464bf68c43fb9dcdb74d924e3",
"timestamp": "2024-03-14 20:00:00"
},
@@ -44,7 +60,7 @@
"version": "1.1.1.0",
"changelog": "Handle empty tags for videos and channels\nFix URL by removing trailing slash for images\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.1.1/TubeArchivistMetadata-1.1.1.zip",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.1.1/tubearchivistmetadata_1.1.1.0.zip",
"checksum": "84ce752ce662e834690512c88ba48664",
"timestamp": "2024-03-14 16:35:00"
},
@@ -52,7 +68,7 @@
"version": "1.1.0.0",
"changelog": "Fix field name and add placeholders\nFix URL in logs after redirection\nAdd schema to TubeArchivist URL if not present in settings\nFix a particular case\nLog configuration settings at initialization\nSanitize URLs\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.1.0/TubeArchivistMetadata-1.1.0.zip",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.1.0/tubearchivistmetadata_1.1.0.0.zip",
"checksum": "de4b6562973b7f75b6afe3a441bb0e19",
"timestamp": "2024-03-13 15:02:00"
},
@@ -60,7 +76,7 @@
"version": "1.0.0.0",
"changelog": "First release\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.0.0/TubeArchivistMetadata-1.0.0.zip",
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.0.0/tubearchivistmetadata_1.0.0.0.zip",
"checksum": "444f8980671de494b1875ee7d1657bcf",
"timestamp": "2024-03-11 16:02:00"
}