Compare commits

...

10 Commits

Author SHA1 Message Date
DarkFighterLuke df36579616 Add new version 2024-03-14 20:01:06 +01:00
DarkFighterLuke 46088c2373 Add episodes and series overview 2024-03-14 19:56:23 +01:00
DarkFighterLuke f9a82e2109 Update manifest 2024-03-14 16:40:43 +01:00
DarkFighterLuke 7436c8643c Fix URL by removing trailing slash for images 2024-03-14 16:34:12 +01:00
DarkFighterLuke c1969a949c Handle empty tags for videos and channels 2024-03-14 15:38:50 +01:00
DarkFighterLuke a2429c89ff Update version 2024-03-13 21:52:54 +01:00
DarkFighterLuke 06860f43fc Update checksum 2024-03-13 21:35:12 +01:00
DarkFighterLuke d03ee06947 Merge branch 'master' of github.com:DarkFighterLuke/TubeArchivistMetadata
manifest.json
2024-03-13 15:27:34 +01:00
DarkFighterLuke a3cf4564b4 Fix image URL 2024-03-13 15:26:05 +01:00
DarkFighterLuke 57263ee789 Fix image URL 2024-03-13 15:22:55 +01:00
11 changed files with 101 additions and 8 deletions
+7
View File
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<Version>1.2.0.0</Version>
<AssemblyVersion>1.2.0.0</AssemblyVersion>
<FileVersion>1.2.0.0</FileVersion>
</PropertyGroup>
</Project>
@@ -86,7 +86,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
}
else
{
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url)), cancellationToken).ConfigureAwait(false);
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url).TrimEnd('/')), cancellationToken).ConfigureAwait(false);
}
}
}
@@ -98,7 +98,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
}
else
{
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url)), cancellationToken).ConfigureAwait(false);
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url).TrimEnd('/')), cancellationToken).ConfigureAwait(false);
}
}
}
@@ -99,7 +99,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
}
else
{
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url)), cancellationToken).ConfigureAwait(false);
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url).TrimEnd('/')), cancellationToken).ConfigureAwait(false);
}
}
}
@@ -98,7 +98,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
}
else
{
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url)), cancellationToken).ConfigureAwait(false);
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Utils.SanitizeUrl(Plugin.Instance.Configuration.TubeArchivistUrl + url).TrimEnd('/')), cancellationToken).ConfigureAwait(false);
}
}
}
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Jellyfin.Plugin.TubeArchivistMetadata.Utilities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Model.Entities;
@@ -70,6 +71,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
/// Gets channel tags.
/// </summary>
[JsonProperty(PropertyName = "channel_tags")]
[JsonConverter(typeof(TagsJsonConverter))]
public Collection<string> Tags { get; }
/// <summary>
@@ -108,6 +110,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
return new Series
{
Name = Name,
Overview = Utils.FormatDescription(Description),
Studios = new[] { Name },
ProviderIds = new Dictionary<string, string>()
{
@@ -0,0 +1,54 @@
using System;
using System.Collections.ObjectModel;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
{
/// <summary>
/// Custom JsonConverter to handle tags list that could be null.
/// </summary>
public class TagsJsonConverter : JsonConverter
{
/// <inheritdoc/>
public override bool CanConvert(Type objectType)
{
return objectType == typeof(Collection<string>);
}
/// <inheritdoc/>
public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
{
JToken token = JToken.Load(reader);
var tags = new Collection<string>();
if (token.Type == JTokenType.Array)
{
var stringArray = token.ToObject<string[]>();
if (stringArray != null)
{
foreach (var tag in stringArray)
{
tags.Add(tag);
}
}
}
return tags;
}
/// <inheritdoc/>
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
{
var tags = (Collection<string>)(value ?? Array.Empty<string>());
writer.WriteStartArray();
foreach (var tag in tags)
{
writer.WriteValue(tag);
}
writer.WriteEndArray();
}
}
}
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
using Jellyfin.Plugin.TubeArchivistMetadata.Utilities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Model.Entities;
@@ -54,6 +55,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
/// Gets video tags.
/// </summary>
[JsonProperty(PropertyName = "tags")]
[JsonConverter(typeof(TagsJsonConverter))]
public Collection<string> Tags { get; }
/// <summary>
@@ -112,6 +114,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
return new Episode
{
Name = Title,
Overview = Utils.FormatDescription(Description),
SeasonName = Published.Year.ToString(CultureInfo.CurrentCulture),
ParentIndexNumber = Published.Year,
SeriesName = Channel.Name,
@@ -31,5 +31,15 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Utilities
return cleanedUrl;
}
/// <summary>
/// Format episodes and series descriptions replacing newlines with br tags.
/// </summary>
/// <param name="description">String to format.</param>
/// <returns>A string with \n replaced by br tags.</returns>
public static string FormatDescription(string description)
{
return description.Replace("\n", "<br>", System.StringComparison.CurrentCulture);
}
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
---
name: "TubeArchivistMetadata"
guid: "dc97d0c6-28b0-4242-afb4-5833ae1b3715"
version: "1.0.0.0"
version: "1.2.0.0"
targetAbi: "10.8.0.0"
framework: "net6.0"
overview: "Metadata for your TubeArchivist library on Jellyfin"
@@ -13,4 +13,4 @@ owner: "DarkFighterLuke"
artifacts:
- "Jellyfin.Plugin.TubeArchivistMetadata.dll"
changelog: >
First release
Add episodes and series overview
+18 -2
View File
@@ -6,14 +6,30 @@
"description": "A new and fully integrated way to manage metadata and organize your TubeArchivist library videos on Jellyfin.",
"owner": "DarkFighterLuke",
"overview": "Metadata for your TubeArchivist library on Jellyfin",
"imageUrl": "logo.png",
"imageUrl": "https://raw.githubusercontent.com/DarkFighterLuke/TubeArchivistMetadata/master/images/logo.png",
"versions": [
{
"version": "1.2.0.0",
"changelog": "Add episodes and series overview\n",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/DarkFighterLuke/TubeArchivistMetadata/releases/download/v1.2.0/TubeArchivistMetadata-1.2.0.zip",
"checksum": "75812a4464bf68c43fb9dcdb74d924e3",
"timestamp": "2024-03-14 20:00:00"
},
{
"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/DarkFighterLuke/TubeArchivistMetadata/releases/download/v1.1.1/TubeArchivistMetadata-1.1.1.zip",
"checksum": "84ce752ce662e834690512c88ba48664",
"timestamp": "2024-03-14 16:35:00"
},
{
"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/DarkFighterLuke/TubeArchivistMetadata/releases/download/v1.1.0/TubeArchivistMetadata-1.1.0.zip",
"checksum": "167f1aa170e0426fd918c37a647aa882",
"checksum": "de4b6562973b7f75b6afe3a441bb0e19",
"timestamp": "2024-03-13 15:02:00"
},
{