Compare commits
61 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 40194f9f26 | |||
| 67c6fd0422 | |||
| 7e496643f8 | |||
| 6e7dbd859c | |||
| 13c4144aab | |||
| 98f73185d1 | |||
| f7cbff910d | |||
| 2d5327d31b | |||
| a2e29dee3b | |||
| bdd99441d1 | |||
| cfd94260f1 | |||
| a28b4ccd7c | |||
| 50c0e1cef2 | |||
| ca0a9215fe | |||
| 6926a44e7c | |||
| ab783238c3 | |||
| 4711a6a742 | |||
| a783b3c739 | |||
| 583e94b35a | |||
| 80a1b6050d | |||
| a4942e78b6 | |||
| 48070f311e | |||
| 96a72ab909 | |||
| 9c6aa56db0 | |||
| 413f45046d | |||
| 5ad6b2a381 | |||
| 795047a50e | |||
| 323a208de2 | |||
| 55d320c456 | |||
| d5f2f0ae8e | |||
| c3bdfc26ea | |||
| c6f7f79385 | |||
| 53ede13f54 | |||
| eeda7dd91e | |||
| 867fbbae5b | |||
| 76ac750de2 | |||
| ddbbb4ba25 | |||
| 3fca2d1e09 | |||
| 4f2f6c0429 | |||
| ebb2cdfcc6 | |||
| c058a35abe | |||
| 11eb456c56 | |||
| 4db1ce755a | |||
| a424721d93 | |||
| 16598bb86e | |||
| 98472b5aa6 | |||
| ab96b227a1 | |||
| 5ff96113c8 | |||
| 6697f2b4cc | |||
| a45ef87f84 | |||
| 157facdceb | |||
| be8481c795 | |||
| bd0a8371a5 | |||
| a75c474647 | |||
| 1dd7019676 | |||
| 355576c283 | |||
| 9091cdbe5b | |||
| a162ebb25d | |||
| 36eec27d9f | |||
| 2fee654efe | |||
| ce8aea629b |
@@ -15,8 +15,12 @@ body:
|
||||
options:
|
||||
- label: I'm running the latest version of tubearchivist-jf-plugin.
|
||||
required: true
|
||||
- label: I'm running the latest version of TubeArchivist.
|
||||
required: true
|
||||
- label: I have read the [how to open an issue](https://github.com/tubearchivist/tubearchivist/blob/master/CONTRIBUTING.md#how-to-open-an-issue) guide, particularly the [bug report](https://github.com/tubearchivist/tubearchivist/blob/master/CONTRIBUTING.md#bug-report) section.
|
||||
required: true
|
||||
- label: I have searched for both closed and open already existing issues about the problem I am reporting.
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: os
|
||||
|
||||
@@ -27,7 +27,7 @@ jobs:
|
||||
- name: Setup .Net
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 9.0.x
|
||||
|
||||
- name: Add Jellyfin GitHub Nuget registry to sources
|
||||
run: |
|
||||
@@ -63,7 +63,7 @@ jobs:
|
||||
uses: DarkFighterLuke/jellyfin-plugin-repository-manager@7a96768accc155ac7b597351b5033532f3c48173
|
||||
id: jprm
|
||||
with:
|
||||
dotnet-target: net8.0
|
||||
dotnet-target: net9.0
|
||||
version: ${VERSION}
|
||||
update-manifest: "true"
|
||||
|
||||
|
||||
@@ -3,3 +3,4 @@ obj/
|
||||
.vs/
|
||||
.idea/
|
||||
artifacts
|
||||
nuget.config
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>1.3.0.0</Version>
|
||||
<AssemblyVersion>1.3.0.0</AssemblyVersion>
|
||||
<FileVersion>1.3.0.0</FileVersion>
|
||||
<Version>1.4.0.0</Version>
|
||||
<AssemblyVersion>1.4.0.0</AssemblyVersion>
|
||||
<FileVersion>1.4.0.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -88,6 +88,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Configuration
|
||||
{
|
||||
_tubeArchivistApiKey = value;
|
||||
Plugin.Instance?.LogTAApiConnectionStatus();
|
||||
Plugin.Instance?.UpdateAuthorizationHeader(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,14 +119,26 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Configuration
|
||||
{
|
||||
get
|
||||
{
|
||||
_logger.LogDebug("JFUsernamesTo configured: {Message}", string.Join(", ", _jfUsernamesTo));
|
||||
_logger.LogInformation("JFUsernamesTo configured: {Message}", string.Join(", ", _jfUsernamesTo));
|
||||
return string.Join(", ", _jfUsernamesTo);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
value.Replace(" ", string.Empty, StringComparison.CurrentCulture).Split(',').ToList().ForEach(u => _jfUsernamesTo.Add(u));
|
||||
_logger.LogDebug("Set JFUsernamesTo to: {Message}", value);
|
||||
// Clear existing usernames
|
||||
_jfUsernamesTo.Clear();
|
||||
|
||||
// Split by comma, then trim each part to remove leading/trailing spaces
|
||||
foreach (var username in value.Split(','))
|
||||
{
|
||||
var trimmedUsername = username.Trim();
|
||||
if (!string.IsNullOrEmpty(trimmedUsername))
|
||||
{
|
||||
_jfUsernamesTo.Add(trimmedUsername);
|
||||
}
|
||||
}
|
||||
|
||||
_logger.LogInformation("Set JFUsernamesTo to: {Message}", string.Join(", ", _jfUsernamesTo));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net9.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.9.0-20240509061132" />
|
||||
<PackageReference Include="Jellyfin.Model" Version="10.9.0-20240509061132" />
|
||||
<PackageReference Include="Jellyfin.Controller" Version="10.11.0" />
|
||||
<PackageReference Include="Jellyfin.Model" Version="10.11.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
|
||||
public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
|
||||
{
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IUserDataManager _userDataManager;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Plugin"/> class.
|
||||
@@ -37,7 +38,6 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
|
||||
/// <param name="logger">Instance of the <see cref="ILogger"/> interface.</param>
|
||||
/// <param name="sessionManager">Instance of the <see cref="ISessionManager"/> interface.</param>
|
||||
/// <param name="libraryManager">Instance of the <see cref="ILibraryManager"/> interface.</param>
|
||||
/// <param name="taskManager">Instance of the <see cref="ITaskManager"/> interface.</param>
|
||||
/// <param name="userManager">Instance of the <see cref="IUserManager"/> interface.</param>
|
||||
/// <param name="userDataManager">Instance of the <see cref="IUserDataManager"/> interface.</param>
|
||||
public Plugin(
|
||||
@@ -46,7 +46,6 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
|
||||
ILogger<Plugin> logger,
|
||||
ISessionManager sessionManager,
|
||||
ILibraryManager libraryManager,
|
||||
ITaskManager taskManager,
|
||||
IUserManager userManager,
|
||||
IUserDataManager userDataManager)
|
||||
: base(applicationPaths, xmlSerializer)
|
||||
@@ -57,31 +56,15 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
|
||||
handler.AllowAutoRedirect = false;
|
||||
handler.CheckCertificateRevocationList = true;
|
||||
HttpClient = new HttpClient(handler);
|
||||
HttpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Token", Instance?.Configuration.TubeArchivistApiKey);
|
||||
UpdateAuthorizationHeader(Configuration.TubeArchivistApiKey);
|
||||
|
||||
SessionManager = sessionManager;
|
||||
sessionManager.PlaybackProgress += OnPlaybackProgress;
|
||||
LibraryManager = libraryManager;
|
||||
_userManager = userManager;
|
||||
_userDataManager = userDataManager;
|
||||
userDataManager.UserDataSaved += OnWatchedStatusChange;
|
||||
|
||||
var taToJellyfinProgressSyncTask = new TAToJellyfinProgressSyncTask(logger, libraryManager, userManager, userDataManager);
|
||||
var jfToTubearchivistProgressSyncTask = new JFToTubearchivistProgressSyncTask(logger, libraryManager, userManager, userDataManager);
|
||||
var isTAJFTaskPresent = taskManager.ScheduledTasks.Any(t => t.Name.Equals(taToJellyfinProgressSyncTask.Name, StringComparison.Ordinal));
|
||||
if (Instance!.Configuration.TAJFSync && !isTAJFTaskPresent)
|
||||
{
|
||||
logger.LogInformation("Queueing task {TaskName}.", taToJellyfinProgressSyncTask.Name);
|
||||
taskManager.AddTasks([taToJellyfinProgressSyncTask]);
|
||||
taskManager.Execute<TAToJellyfinProgressSyncTask>();
|
||||
}
|
||||
|
||||
var isJFTATaskPresent = taskManager.ScheduledTasks.Any(t => t.Name.Equals(jfToTubearchivistProgressSyncTask.Name, StringComparison.Ordinal));
|
||||
if (Instance!.Configuration.JFTASync && !isJFTATaskPresent)
|
||||
{
|
||||
logger.LogInformation("Queueing task {TaskName}.", jfToTubearchivistProgressSyncTask.Name);
|
||||
taskManager.AddTasks([jfToTubearchivistProgressSyncTask]);
|
||||
taskManager.Execute<JFToTubearchivistProgressSyncTask>();
|
||||
}
|
||||
|
||||
logger.LogInformation("{Message}", "Collection display name: " + Instance?.Configuration.CollectionTitle);
|
||||
logger.LogInformation("{Message}", "TubeArchivist API URL: " + Instance?.Configuration.TubeArchivistUrl);
|
||||
logger.LogInformation("{Message}", "Pinging TubeArchivist API...");
|
||||
@@ -128,6 +111,23 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Updates the HTTP client's Authorization header with the current API key.
|
||||
/// </summary>
|
||||
/// <param name="apiKey">TubeArchivist API key.</param>
|
||||
public void UpdateAuthorizationHeader(string apiKey)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(apiKey))
|
||||
{
|
||||
HttpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Token", apiKey);
|
||||
Logger.LogInformation("{Message}", "Updated Authorization header with API key");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.LogWarning("{Message}", "No TubeArchivist API key configured");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs the TubeArchivist API connection status.
|
||||
/// </summary>
|
||||
@@ -153,9 +153,16 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
|
||||
|
||||
private async void OnPlaybackProgress(object? sender, PlaybackProgressEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs == null || eventArgs.Item.Id == Guid.Empty)
|
||||
{
|
||||
Logger.LogDebug("Skipping progress synchronization: PlaybackProgress event triggered with null or empty Guid.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Instance!.Configuration.JFTASync && eventArgs.Users.Any(u => Instance!.Configuration.JFUsernameFrom.Equals(u.Username, StringComparison.Ordinal)))
|
||||
{
|
||||
BaseItem? channel = LibraryManager.GetItemById(eventArgs.Item.ParentId);
|
||||
BaseItem? season = LibraryManager.GetItemById(eventArgs.Item.ParentId);
|
||||
BaseItem? channel = LibraryManager.GetItemById(season!.ParentId);
|
||||
BaseItem? collection = LibraryManager.GetItemById(channel!.ParentId);
|
||||
if (collection?.Name.ToLower(CultureInfo.CurrentCulture) == Instance?.Configuration.CollectionTitle.ToLower(CultureInfo.CurrentCulture) && eventArgs.PlaybackPositionTicks != null)
|
||||
{
|
||||
@@ -172,29 +179,71 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
|
||||
|
||||
private async void OnWatchedStatusChange(object? sender, UserDataSaveEventArgs eventArgs)
|
||||
{
|
||||
var user = _userManager.GetUserById(eventArgs.UserId);
|
||||
if (user != null && Configuration.GetJFUsernamesToArray().Contains(user!.Username))
|
||||
if (eventArgs == null || eventArgs.Item.Id == Guid.Empty)
|
||||
{
|
||||
var isPlayed = eventArgs.Item.IsPlayed(user);
|
||||
Logger.LogDebug("Skipping watched status synchronization: WatchedStatusChange event triggered with null or empty Guid.");
|
||||
return;
|
||||
}
|
||||
|
||||
var user = _userManager.GetUserById(eventArgs.UserId);
|
||||
if (user == null)
|
||||
{
|
||||
Logger.LogError("OnWatchedStatusChange callback called without user id for item {ItemName}", eventArgs.Item.Name);
|
||||
return;
|
||||
}
|
||||
|
||||
var userItemData = _userDataManager.GetUserData(user, eventArgs.Item);
|
||||
if (Configuration.JFTASync && user != null && Configuration.GetJFUsernamesToArray().Contains(user!.Username))
|
||||
{
|
||||
var isPlayed = eventArgs.Item.IsPlayed(user, userItemData);
|
||||
Logger.LogDebug("User {UserId} changed watched status to {Status} for the item {ItemName}", eventArgs.UserId, isPlayed, eventArgs.Item.Name);
|
||||
string itemYTId;
|
||||
if (eventArgs.Item is Series)
|
||||
try
|
||||
{
|
||||
itemYTId = Utils.GetChannelNameFromPath(eventArgs.Item.Path);
|
||||
if (eventArgs.Item is Series)
|
||||
{
|
||||
itemYTId = Utils.GetChannelNameFromPath(eventArgs.Item.Path);
|
||||
}
|
||||
else if (eventArgs.Item is Episode)
|
||||
{
|
||||
itemYTId = Utils.GetVideoNameFromPath(eventArgs.Item.Path);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (eventArgs.Item is Episode)
|
||||
{
|
||||
itemYTId = Utils.GetVideoNameFromPath(eventArgs.Item.Path);
|
||||
}
|
||||
else
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex, "Error while processing item path: {ItemPath}", eventArgs.Item.Path ?? "null");
|
||||
return;
|
||||
}
|
||||
|
||||
var statusCode = await TubeArchivistApi.GetInstance().SetWatchedStatus(itemYTId, isPlayed).ConfigureAwait(true);
|
||||
if (statusCode != System.Net.HttpStatusCode.OK)
|
||||
try
|
||||
{
|
||||
Logger.LogCritical("POST /watched returned {StatusCode} for item {ItemName} ({VideoYTId}) with watched status {IsPlayed}", statusCode, eventArgs.Item.Name, itemYTId, isPlayed);
|
||||
var statusCode = await TubeArchivistApi.GetInstance().SetWatchedStatus(itemYTId, isPlayed).ConfigureAwait(true);
|
||||
if (statusCode != System.Net.HttpStatusCode.OK)
|
||||
{
|
||||
Logger.LogCritical("POST /watched returned {StatusCode} for item {ItemName} ({VideoYTId}) with watched status {IsPlayed}", statusCode, eventArgs.Item.Name, itemYTId, isPlayed);
|
||||
}
|
||||
|
||||
if (eventArgs.Item is Episode)
|
||||
{
|
||||
var progress = _userDataManager.GetUserData(user, eventArgs.Item)?.PlaybackPositionTicks / TimeSpan.TicksPerSecond;
|
||||
if (progress != null)
|
||||
{
|
||||
var videoId = Utils.GetVideoNameFromPath(eventArgs.Item.Path);
|
||||
statusCode = await TubeArchivistApi.GetInstance().SetProgress(videoId, progress.Value).ConfigureAwait(true);
|
||||
if (statusCode != System.Net.HttpStatusCode.OK)
|
||||
{
|
||||
Logger.LogCritical("{Message}", $"POST /video/{videoId}/progress returned {statusCode} for video {eventArgs.Item.Name} with progress {progress} seconds");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogCritical("An exception occurred while calling POST /watched for item {ItemName} ({VideoYTId}) with watched status {IsPlayed}: {ExceptionMessage}", eventArgs.Item.Name, itemYTId, isPlayed, ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
var taApi = TubeArchivistApi.GetInstance();
|
||||
var videoTAId = Utils.GetVideoNameFromPath(item.Path);
|
||||
var video = await taApi.GetVideo(videoTAId).ConfigureAwait(true);
|
||||
_logger.LogInformation("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting images for video: {0} ({1})", video?.Title, videoTAId));
|
||||
_logger.LogInformation("{Message}", "Thumb URI: " + video?.VidThumbUrl);
|
||||
_logger.LogDebug("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting images for video: {0} ({1})", video?.Title, videoTAId));
|
||||
_logger.LogDebug("{Message}", "Thumb URI: " + video?.VidThumbUrl);
|
||||
|
||||
if (video != null)
|
||||
{
|
||||
|
||||
@@ -53,8 +53,8 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
var taApi = TubeArchivistApi.GetInstance();
|
||||
var videoTAId = Utils.GetVideoNameFromPath(info.Path);
|
||||
var video = await taApi.GetVideo(videoTAId).ConfigureAwait(true);
|
||||
_logger.LogInformation("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting metadata for video: {0} ({1})", video?.Title, videoTAId));
|
||||
_logger.LogInformation("{Message}", "Received metadata: \n" + JsonConvert.SerializeObject(video));
|
||||
_logger.LogDebug("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting metadata for video: {0} ({1})", video?.Title, videoTAId));
|
||||
_logger.LogDebug("{Message}", "Received metadata: \n" + JsonConvert.SerializeObject(video));
|
||||
|
||||
if (video != null)
|
||||
{
|
||||
|
||||
@@ -60,10 +60,10 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
var taApi = TubeArchivistApi.GetInstance();
|
||||
var channelTAId = Utils.GetChannelNameFromPath(item.Path);
|
||||
var channel = await taApi.GetChannel(channelTAId).ConfigureAwait(true);
|
||||
_logger.LogInformation("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting images for channel: {0} ({1})", channel?.Name, channelTAId));
|
||||
_logger.LogInformation("{Message}", "Thumb URI: " + channel?.ThumbUrl);
|
||||
_logger.LogInformation("{Message}", "TVArt URI: " + channel?.TvartUrl);
|
||||
_logger.LogInformation("{Message}", "Banner URI: " + channel?.BannerUrl);
|
||||
_logger.LogDebug("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting images for channel: {0} ({1})", channel?.Name, channelTAId));
|
||||
_logger.LogDebug("{Message}", "Thumb URI: " + channel?.ThumbUrl);
|
||||
_logger.LogDebug("{Message}", "TVArt URI: " + channel?.TvartUrl);
|
||||
_logger.LogDebug("{Message}", "Banner URI: " + channel?.BannerUrl);
|
||||
|
||||
if (channel != null)
|
||||
{
|
||||
|
||||
@@ -52,8 +52,8 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
var taApi = TubeArchivistApi.GetInstance();
|
||||
var channelTAId = Utils.GetChannelNameFromPath(info.Path);
|
||||
var channel = await taApi.GetChannel(channelTAId).ConfigureAwait(true);
|
||||
_logger.LogInformation("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting metadata for channel: {0} ({1})", channel?.Name, channelTAId));
|
||||
_logger.LogInformation("{Message}", "Received metadata: \n" + JsonConvert.SerializeObject(channel));
|
||||
_logger.LogDebug("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting metadata for channel: {0} ({1})", channel?.Name, channelTAId));
|
||||
_logger.LogDebug("{Message}", "Received metadata: \n" + JsonConvert.SerializeObject(channel));
|
||||
|
||||
if (channel != null)
|
||||
{
|
||||
|
||||
+100
-104
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Enums;
|
||||
@@ -45,7 +46,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
|
||||
public string Name => "JFToTubeArchivistProgressSyncTask";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Description => "This tasks syncs TubeArchivist playback progresses to Jellyfin";
|
||||
public string Description => "This tasks syncs Jellyfin playback progresses to TubeArchivist";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Category => "TubeArchivistMetadata";
|
||||
@@ -63,146 +64,141 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
|
||||
_logger.LogInformation("Starting Jellyfin->TubeArchivist playback progresses synchronization.");
|
||||
var taApi = TubeArchivistApi.GetInstance();
|
||||
var videosCount = 0;
|
||||
foreach (var jfUsername in Plugin.Instance!.Configuration.GetJFUsernamesToArray())
|
||||
var jfUsername = Plugin.Instance!.Configuration.JFUsernameFrom;
|
||||
var user = _userManager.GetUserByName(jfUsername);
|
||||
if (user == null)
|
||||
{
|
||||
var user = _userManager.GetUserByName(jfUsername);
|
||||
if (user == null)
|
||||
{
|
||||
_logger.LogInformation("{Message}", $"Jellyfin user with username {jfUsername} not found");
|
||||
continue;
|
||||
}
|
||||
_logger.LogInformation("{Message}", $"Jellyfin user with username {jfUsername} not found");
|
||||
return;
|
||||
}
|
||||
|
||||
var collectionItem = _libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
Name = Plugin.Instance?.Configuration.CollectionTitle,
|
||||
IncludeItemTypes = new[] { BaseItemKind.CollectionFolder }
|
||||
}).FirstOrDefault();
|
||||
var items = _libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
Name = Plugin.Instance?.Configuration.CollectionTitle,
|
||||
IncludeItemTypes = new[] { BaseItemKind.CollectionFolder }
|
||||
});
|
||||
|
||||
if (collectionItem == null)
|
||||
var collectionItem = items.Count > 0 ? items[0] : null;
|
||||
|
||||
if (collectionItem == null)
|
||||
{
|
||||
var message = $"Collection '{Plugin.Instance?.Configuration.CollectionTitle}' not found.";
|
||||
_logger.LogCritical("{Message}", message);
|
||||
}
|
||||
else
|
||||
{
|
||||
var collection = (CollectionFolder)collectionItem;
|
||||
var channels = collection.GetChildren(user, false, new InternalItemsQuery
|
||||
{
|
||||
var message = $"Collection '{Plugin.Instance?.Configuration.CollectionTitle}' not found.";
|
||||
_logger.LogCritical("{Message}", message);
|
||||
}
|
||||
else
|
||||
IncludeItemTypes = new[] { BaseItemKind.Series }
|
||||
});
|
||||
_logger.LogDebug("Analyzing collection {Id} with name {Name}", collectionItem.Id, collectionItem.Name);
|
||||
_logger.LogDebug("Found {Message} channels", channels.Count);
|
||||
|
||||
foreach (Series channel in channels)
|
||||
{
|
||||
var collection = (CollectionFolder)collectionItem;
|
||||
var channels = collection.GetChildren(user, false, new InternalItemsQuery
|
||||
var channelYTId = Utils.GetChannelNameFromPath(channel.Path);
|
||||
var years = channel.GetChildren(user, false, new InternalItemsQuery
|
||||
{
|
||||
IncludeItemTypes = new[] { BaseItemKind.Series }
|
||||
IncludeItemTypes = new[] { BaseItemKind.Season }
|
||||
});
|
||||
_logger.LogInformation("Analyzing collection {Id} with name {Name}", collectionItem.Id, collectionItem.Name);
|
||||
_logger.LogDebug("Found {Message} channels", channels.Count);
|
||||
_logger.LogDebug("Found {Years} years in channel {ChannelName}", years.Count, channel.Name);
|
||||
|
||||
foreach (Series channel in channels)
|
||||
foreach (Season year in years)
|
||||
{
|
||||
var channelYTId = Utils.GetChannelNameFromPath(channel.Path);
|
||||
var years = channel.GetChildren(user, false, new InternalItemsQuery
|
||||
var videos = year.GetChildren(user, false, new InternalItemsQuery
|
||||
{
|
||||
IncludeItemTypes = new[] { BaseItemKind.Season }
|
||||
IncludeItemTypes = new[] { BaseItemKind.Episode }
|
||||
});
|
||||
_logger.LogDebug("Found {Years} years in channel {ChannelName}", years.Count, channel.Name);
|
||||
|
||||
foreach (Season year in years)
|
||||
{
|
||||
var videos = year.GetChildren(user, false, new InternalItemsQuery
|
||||
{
|
||||
IncludeItemTypes = new[] { BaseItemKind.Episode }
|
||||
});
|
||||
_logger.LogDebug("Found {Videos} videos in year {YearName} of the channel {ChannelName}", videos.Count, year.Name, channel.Name);
|
||||
videosCount += videos.Count;
|
||||
}
|
||||
_logger.LogDebug("Found {Videos} videos in year {YearName} of the channel {ChannelName}", videos.Count, year.Name, channel.Name);
|
||||
videosCount += videos.Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_logger.LogInformation("Found a total of {VideosCount} videos", videosCount);
|
||||
_logger.LogDebug("Found a total of {VideosCount} videos", videosCount);
|
||||
|
||||
var processedVideosCount = 0;
|
||||
foreach (var jfUsername in Plugin.Instance!.Configuration.GetJFUsernamesToArray())
|
||||
if (collectionItem == null)
|
||||
{
|
||||
var user = _userManager.GetUserByName(jfUsername);
|
||||
if (user == null)
|
||||
var message = $"Collection '{Plugin.Instance?.Configuration.CollectionTitle}' not found.";
|
||||
_logger.LogCritical("{Message}", message);
|
||||
}
|
||||
else
|
||||
{
|
||||
var collection = (CollectionFolder)collectionItem;
|
||||
var channels = collection.GetChildren(user, false, new InternalItemsQuery
|
||||
{
|
||||
_logger.LogInformation("{Message}", $"Jellyfin user with username {jfUsername} not found");
|
||||
continue;
|
||||
}
|
||||
IncludeItemTypes = new[] { BaseItemKind.Series }
|
||||
});
|
||||
|
||||
var collectionItem = _libraryManager.GetItemList(new InternalItemsQuery
|
||||
foreach (Series channel in channels)
|
||||
{
|
||||
Name = Plugin.Instance?.Configuration.CollectionTitle,
|
||||
IncludeItemTypes = new[] { BaseItemKind.CollectionFolder }
|
||||
}).FirstOrDefault();
|
||||
|
||||
if (collectionItem == null)
|
||||
{
|
||||
var message = $"Collection '{Plugin.Instance?.Configuration.CollectionTitle}' not found.";
|
||||
_logger.LogCritical("{Message}", message);
|
||||
}
|
||||
else
|
||||
{
|
||||
var collection = (CollectionFolder)collectionItem;
|
||||
var channels = collection.GetChildren(user, false, new InternalItemsQuery
|
||||
var channelYTId = Utils.GetChannelNameFromPath(channel.Path);
|
||||
var isChannelWatched = false;
|
||||
var isChannelCheckedForWatched = false;
|
||||
var years = channel.GetChildren(user, false, new InternalItemsQuery
|
||||
{
|
||||
IncludeItemTypes = new[] { BaseItemKind.Series }
|
||||
IncludeItemTypes = new[] { BaseItemKind.Season }
|
||||
});
|
||||
|
||||
foreach (Series channel in channels)
|
||||
foreach (Season year in years)
|
||||
{
|
||||
var channelYTId = Utils.GetChannelNameFromPath(channel.Path);
|
||||
var isChannelWatched = false;
|
||||
var isChannelCheckedForWatched = false;
|
||||
var years = channel.GetChildren(user, false, new InternalItemsQuery
|
||||
var videos = year.GetChildren(user, false, new InternalItemsQuery
|
||||
{
|
||||
IncludeItemTypes = new[] { BaseItemKind.Season }
|
||||
IncludeItemTypes = new[] { BaseItemKind.Episode }
|
||||
});
|
||||
videosCount += videos.Count;
|
||||
|
||||
foreach (Season year in years)
|
||||
foreach (Episode video in videos)
|
||||
{
|
||||
var videos = year.GetChildren(user, false, new InternalItemsQuery
|
||||
{
|
||||
IncludeItemTypes = new[] { BaseItemKind.Episode }
|
||||
});
|
||||
videosCount += videos.Count;
|
||||
var videoYTId = Utils.GetVideoNameFromPath(video.Path);
|
||||
_logger.LogDebug("{VideoYtId}", videoYTId);
|
||||
HttpStatusCode statusCode;
|
||||
var userItemData = _userDataManager.GetUserData(user, channel);
|
||||
|
||||
foreach (Episode video in videos)
|
||||
if (!isChannelCheckedForWatched && channel.IsPlayed(user, userItemData))
|
||||
{
|
||||
var videoYTId = Utils.GetVideoNameFromPath(video.Path);
|
||||
var playbackProgress = _userDataManager.GetUserData(user.Id, video).PlaybackPositionTicks / TimeSpan.TicksPerSecond;
|
||||
var statusCode = await taApi.SetProgress(videoYTId, playbackProgress).ConfigureAwait(true);
|
||||
var isChannelPlayed = channel.IsPlayed(user, userItemData);
|
||||
statusCode = await taApi.SetWatchedStatus(channelYTId, isChannelPlayed).ConfigureAwait(true);
|
||||
if (statusCode != System.Net.HttpStatusCode.OK)
|
||||
{
|
||||
_logger.LogCritical("{Message}", $"POST /video/{videoYTId}/progress returned {statusCode} for video {video.Name} with progress {progress} seconds");
|
||||
_logger.LogCritical("{Message}", $"POST /watched returned {statusCode} for channel {channel.Name} ({channelYTId}) with wacthed status {isChannelPlayed}");
|
||||
}
|
||||
|
||||
if (!isChannelCheckedForWatched && channel.IsPlayed(user))
|
||||
else
|
||||
{
|
||||
var isChannelPlayed = channel.IsPlayed(user);
|
||||
statusCode = await taApi.SetWatchedStatus(channelYTId, isChannelPlayed).ConfigureAwait(true);
|
||||
if (statusCode != System.Net.HttpStatusCode.OK)
|
||||
{
|
||||
_logger.LogCritical("{Message}", $"POST /watched returned {statusCode} for channel {channel.Name} ({channelYTId}) with wacthed status {isChannelPlayed}");
|
||||
}
|
||||
else
|
||||
{
|
||||
isChannelWatched = true;
|
||||
}
|
||||
|
||||
isChannelCheckedForWatched = true;
|
||||
isChannelWatched = true;
|
||||
}
|
||||
|
||||
if (!isChannelWatched)
|
||||
{
|
||||
var isVideoPlayed = video.IsPlayed(user);
|
||||
statusCode = await taApi.SetWatchedStatus(videoYTId, isVideoPlayed).ConfigureAwait(true);
|
||||
if (statusCode != System.Net.HttpStatusCode.OK)
|
||||
{
|
||||
_logger.LogCritical("{Message}", $"POST /watched returned {statusCode} for video {video.Name} ({videoYTId}) with wacthed status {isVideoPlayed}");
|
||||
}
|
||||
}
|
||||
|
||||
processedVideosCount++;
|
||||
progress.Report(processedVideosCount * 100 / videosCount);
|
||||
isChannelCheckedForWatched = true;
|
||||
}
|
||||
|
||||
if (!isChannelWatched)
|
||||
{
|
||||
var isVideoPlayed = video.IsPlayed(user, userItemData);
|
||||
statusCode = await taApi.SetWatchedStatus(videoYTId, isVideoPlayed).ConfigureAwait(true);
|
||||
if (statusCode != System.Net.HttpStatusCode.OK)
|
||||
{
|
||||
_logger.LogCritical("{Message}", $"POST /watched returned {statusCode} for video {video.Name} ({videoYTId}) with wacthed status {isVideoPlayed}");
|
||||
}
|
||||
|
||||
_logger.LogDebug("{Message}", isVideoPlayed);
|
||||
if (!isVideoPlayed)
|
||||
{
|
||||
var playbackProgress = _userDataManager.GetUserData(user, video)?.PlaybackPositionTicks / TimeSpan.TicksPerSecond;
|
||||
if (playbackProgress != null)
|
||||
{
|
||||
statusCode = await taApi.SetProgress(videoYTId, playbackProgress.Value).ConfigureAwait(true);
|
||||
if (statusCode != System.Net.HttpStatusCode.OK)
|
||||
{
|
||||
_logger.LogCritical("{Message}", $"POST /video/{videoYTId}/progress returned {statusCode} for video {video.Name} with progress {progress} seconds");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
processedVideosCount++;
|
||||
progress.Report(processedVideosCount * 100 / videosCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -225,7 +221,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
|
||||
[
|
||||
new TaskTriggerInfo
|
||||
{
|
||||
Type = TaskTriggerInfo.TriggerStartup,
|
||||
Type = TaskTriggerInfoType.StartupTrigger,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -72,11 +72,13 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
|
||||
continue;
|
||||
}
|
||||
|
||||
var collectionItem = _libraryManager.GetItemList(new InternalItemsQuery
|
||||
var items = _libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
Name = Plugin.Instance?.Configuration.CollectionTitle,
|
||||
IncludeItemTypes = new[] { BaseItemKind.CollectionFolder }
|
||||
}).FirstOrDefault();
|
||||
});
|
||||
|
||||
var collectionItem = items.Count > 0 ? items[0] : null;
|
||||
|
||||
if (collectionItem == null)
|
||||
{
|
||||
@@ -90,7 +92,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
|
||||
{
|
||||
IncludeItemTypes = new[] { BaseItemKind.Series }
|
||||
});
|
||||
_logger.LogInformation("Analyzing collection {Id} with name {Name}", collectionItem.Id, collectionItem.Name);
|
||||
_logger.LogDebug("Analyzing collection {Id} with name {Name}", collectionItem.Id, collectionItem.Name);
|
||||
_logger.LogDebug("Found {Message} channels", channels.Count);
|
||||
|
||||
foreach (Series channel in channels)
|
||||
@@ -115,7 +117,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
|
||||
}
|
||||
}
|
||||
|
||||
_logger.LogInformation("Found a total of {VideosCount} videos", videosCount);
|
||||
_logger.LogDebug("Found a total of {VideosCount} videos", videosCount);
|
||||
|
||||
var processedVideosCount = 0;
|
||||
foreach (var jfUsername in Plugin.Instance!.Configuration.GetJFUsernamesToArray())
|
||||
@@ -123,15 +125,17 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
|
||||
var user = _userManager.GetUserByName(jfUsername);
|
||||
if (user == null)
|
||||
{
|
||||
_logger.LogInformation("{Message}", $"Jellyfin user with username {jfUsername} not found");
|
||||
_logger.LogDebug("{Message}", $"Jellyfin user with username {jfUsername} not found");
|
||||
continue;
|
||||
}
|
||||
|
||||
var collectionItem = _libraryManager.GetItemList(new InternalItemsQuery
|
||||
var items = _libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
Name = Plugin.Instance?.Configuration.CollectionTitle,
|
||||
IncludeItemTypes = new[] { BaseItemKind.CollectionFolder }
|
||||
}).FirstOrDefault();
|
||||
});
|
||||
|
||||
var collectionItem = items.Count > 0 ? items[0] : null;
|
||||
|
||||
if (collectionItem == null)
|
||||
{
|
||||
@@ -185,8 +189,8 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
|
||||
}
|
||||
|
||||
_userDataManager.SaveUserData(user, video, userUpdateData, UserDataSaveReason.UpdateUserData);
|
||||
_logger.LogInformation("{Message}", $"Playback progress for video {video.Name} set to {userItemData.PlaybackPositionTicks / TimeSpan.TicksPerSecond} seconds for user {jfUsername}.");
|
||||
_logger.LogInformation("{Message}", $"Watched status for video {video.Name} set to {userItemData.Played} seconds for user {jfUsername}.");
|
||||
_logger.LogInformation("{Message}", $"Playback progress for video {video.Name} set to {userItemData?.PlaybackPositionTicks / TimeSpan.TicksPerSecond} seconds for user {jfUsername}.");
|
||||
_logger.LogInformation("{Message}", $"Watched status for video {video.Name} set to {userItemData?.Played} seconds for user {jfUsername}.");
|
||||
|
||||
processedVideosCount++;
|
||||
progress.Report(processedVideosCount * 100 / videosCount);
|
||||
@@ -214,7 +218,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
|
||||
[
|
||||
new TaskTriggerInfo
|
||||
{
|
||||
Type = TaskTriggerInfo.TriggerInterval,
|
||||
Type = TaskTriggerInfoType.IntervalTrigger,
|
||||
IntervalTicks = TimeSpan.FromSeconds(Plugin.Instance!.Configuration.TAJFTaskInterval).Ticks
|
||||
},
|
||||
];
|
||||
|
||||
@@ -126,7 +126,9 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
|
||||
Type = ImageType.Primary
|
||||
}
|
||||
},
|
||||
Tags = this.Tags.ToArray<string>()
|
||||
Tags = this.Tags != null ?
|
||||
this.Tags.ToArray<string>() :
|
||||
[]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
|
||||
/// <returns>A task.</returns>
|
||||
public async Task<Channel?> GetChannel(string channelId)
|
||||
{
|
||||
ResponseContainer<Channel>? channel = null;
|
||||
Channel? channel = null;
|
||||
|
||||
var channelsEndpoint = "/api/channel/";
|
||||
var url = new Uri(Utils.SanitizeUrl(Plugin.Instance?.Configuration.TubeArchivistUrl + channelsEndpoint + channelId));
|
||||
@@ -73,19 +73,19 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
|
||||
while (response.StatusCode == HttpStatusCode.Moved)
|
||||
{
|
||||
url = response.Headers.Location;
|
||||
_logger.LogInformation("{Message}", "Received redirect to: " + url);
|
||||
_logger.LogDebug("{Message}", "Received redirect to: " + url);
|
||||
response = await client.GetAsync(url).ConfigureAwait(true);
|
||||
}
|
||||
|
||||
_logger.LogInformation("{Message}", url + ": " + response.StatusCode);
|
||||
_logger.LogDebug("{Message}", url + ": " + response.StatusCode);
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string rawData = await response.Content.ReadAsStringAsync().ConfigureAwait(true);
|
||||
channel = JsonConvert.DeserializeObject<ResponseContainer<Channel>>(rawData);
|
||||
channel = JsonConvert.DeserializeObject<Channel>(rawData);
|
||||
}
|
||||
|
||||
return channel?.Data;
|
||||
return channel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -95,7 +95,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
|
||||
/// <returns>A task.</returns>
|
||||
public async Task<Video?> GetVideo(string videoId)
|
||||
{
|
||||
ResponseContainer<Video>? video = null;
|
||||
Video? video = null;
|
||||
|
||||
var videosEndpoint = "/api/video/";
|
||||
var url = new Uri(Utils.SanitizeUrl(Plugin.Instance?.Configuration.TubeArchivistUrl + videosEndpoint + videoId));
|
||||
@@ -103,19 +103,20 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
|
||||
while (response.StatusCode == HttpStatusCode.Moved)
|
||||
{
|
||||
url = response.Headers.Location;
|
||||
_logger.LogInformation("{Message}", "Received redirect to: " + url);
|
||||
_logger.LogDebug("{Message}", "Received redirect to: " + url);
|
||||
response = await client.GetAsync(url).ConfigureAwait(true);
|
||||
}
|
||||
|
||||
_logger.LogInformation("{Message}", url + ": " + response.StatusCode);
|
||||
_logger.LogDebug("{Message}", url + ": " + response.StatusCode);
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string rawData = await response.Content.ReadAsStringAsync().ConfigureAwait(true);
|
||||
video = JsonConvert.DeserializeObject<ResponseContainer<Video>>(rawData);
|
||||
_logger.LogDebug("{Message}", rawData);
|
||||
video = JsonConvert.DeserializeObject<Video>(rawData);
|
||||
}
|
||||
|
||||
return video?.Data;
|
||||
return video;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -133,11 +134,11 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
|
||||
while (response.StatusCode == HttpStatusCode.Moved)
|
||||
{
|
||||
url = response.Headers.Location;
|
||||
_logger.LogInformation("{Message}", "Received redirect to: " + url);
|
||||
_logger.LogDebug("{Message}", "Received redirect to: " + url);
|
||||
response = await client.GetAsync(url).ConfigureAwait(true);
|
||||
}
|
||||
|
||||
_logger.LogInformation("{Message}", url + ": " + response.StatusCode);
|
||||
_logger.LogDebug("{Message}", url + ": " + response.StatusCode);
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
@@ -174,15 +175,11 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
|
||||
{
|
||||
Progress? progress = null;
|
||||
|
||||
var progressEndpoint = $"/api/video/{videoId}/progress/";
|
||||
var url = new Uri(Utils.SanitizeUrl(Plugin.Instance!.Configuration.TubeArchivistUrl + progressEndpoint));
|
||||
|
||||
var response = await client.GetAsync(url).ConfigureAwait(true);
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
var video = await GetVideo(videoId).ConfigureAwait(true);
|
||||
if (video != null)
|
||||
{
|
||||
string rawData = await response.Content.ReadAsStringAsync().ConfigureAwait(true);
|
||||
progress = JsonConvert.DeserializeObject<Progress>(rawData);
|
||||
progress = new Progress((long)video.Player.Position);
|
||||
_logger.LogDebug("{Message}", $"Retrieved progress {video.Player.Position}");
|
||||
}
|
||||
|
||||
return progress;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
|
||||
@@ -13,12 +12,12 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
|
||||
/// </summary>
|
||||
/// <param name="duration">Duration of the video.</param>
|
||||
/// <param name="isWatched">Whether the video is marked as watched.</param>
|
||||
/// <param name="watchedUnixTime">Unix time of when the video has been marked watched.</param>
|
||||
public Player(long duration, bool isWatched, long watchedUnixTime)
|
||||
/// <param name="position">Video watched seconds.</param>
|
||||
public Player(long duration, bool isWatched, double position)
|
||||
{
|
||||
Duration = duration;
|
||||
IsWatched = isWatched;
|
||||
WatchedUnixTime = watchedUnixTime;
|
||||
Position = position;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -34,18 +33,9 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
|
||||
public bool IsWatched { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Unix date and time when the video has been marked as watched.
|
||||
/// Gets the video watched seconds.
|
||||
/// </summary>
|
||||
[JsonProperty(PropertyName = "watched_date")]
|
||||
public long WatchedUnixTime { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the date and time when the video has been marked as watched.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public DateTime WatchedTime
|
||||
{
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(WatchedUnixTime).DateTime;
|
||||
}
|
||||
[JsonProperty(PropertyName = "position")]
|
||||
public double Position { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,12 @@
|
||||
</p>
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Jellyfin 10.9.1 has been finally released and since starting with the version 1.3.0 the plugin supports only the latest Jellyfin release, in order to continue using this plugin with all the latest features you will need to upgrade your Jellyfin installation.
|
||||
> Jellyfin release cycle has changed in the past few months and now it is shorter than before. The plugin supports only the latest Jellyfin release, in order to continue using this plugin with all the latest features you will need to upgrade your Jellyfin installation.
|
||||
> The same rule applies to TubeArchivist: the plugin is only guaranteed to work with the latest TubeArchivist version.
|
||||
|
||||
> [!WARNING]
|
||||
> Jellyfin 10.10 introduced a bug that prevents the plugin to correctly create Season folders by year. The bug has been finally solved on the Jellyfin codebase, but, until the next minor release, a manual build of the Jellyfin branch `release-10.10.z` is required in order to get the fix running.<br>
|
||||
> This is not a plugin bug, any issue opened about this bug will be immediately closed!
|
||||
|
||||
## About
|
||||
|
||||
@@ -25,15 +30,15 @@ The plugin interacts with TubeArchivist APIs to fetch videos and channels metada
|
||||
|
||||
## Installation
|
||||
### From official repository (recommended)
|
||||
1. Go to `Dashboard -> Plugins` and select the `Repositories` tab
|
||||
1. Go to `Dashboard -> Plugins` and click on the `Manage Repositories` button
|
||||
2. Add a new repository with the following details:
|
||||
- Repository name: `TubeArchivistMetadata`
|
||||
- Repository URL: `https://github.com/tubearchivist/tubearchivist-jf-plugin/raw/master/manifest.json`
|
||||

|
||||

|
||||
|
||||
3. Go to the `Catalog` tab
|
||||
4. Find `TubeArchivistMetadata` in the `Metadata` section and install it
|
||||

|
||||
3. Go back to the catalog
|
||||
4. Find `TubeArchivistMetadata` and install it
|
||||

|
||||
5. Restart Jellyfin to apply the changes
|
||||
|
||||
### From ZIP in GitHub releases
|
||||
@@ -88,7 +93,7 @@ In the second field you can specify the interval in seconds the task should run
|
||||
|
||||
## Build
|
||||
|
||||
1. To build this plugin you will need [.Net 8.x](https://dotnet.microsoft.com/download/dotnet/8.0).
|
||||
1. To build this plugin you will need [.Net 9.x](https://dotnet.microsoft.com/download/dotnet/9.0).
|
||||
|
||||
2. Build plugin with following command
|
||||
```
|
||||
|
||||
+4
-5
@@ -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.3.2.0"
|
||||
targetAbi: "10.9.1.0"
|
||||
framework: "net8.0"
|
||||
version: "1.4.0.0"
|
||||
targetAbi: "10.11.0.0"
|
||||
framework: "net9.0"
|
||||
overview: "Metadata for your TubeArchivist library on Jellyfin"
|
||||
description: >
|
||||
TubeArchivistMetadata is a plugin that automatically manages
|
||||
@@ -14,5 +14,4 @@ owner: "DarkFighterLuke"
|
||||
artifacts:
|
||||
- "Jellyfin.Plugin.TubeArchivistMetadata.dll"
|
||||
changelog: >
|
||||
Add tasks progress status
|
||||
Adjust logs levels
|
||||
Align compatibility with Jellyfin 10.11.x
|
||||
|
||||
+52
-12
@@ -8,13 +8,53 @@
|
||||
"overview": "Metadata for your TubeArchivist library on Jellyfin",
|
||||
"imageUrl": "https://raw.githubusercontent.com/tubearchivist/tubearchivist-jf-plugin/master/images/logo.png",
|
||||
"versions": [
|
||||
{
|
||||
"version": "1.3.7.0",
|
||||
"changelog": "Fix JF->TA Sync\n",
|
||||
"targetAbi": "10.10.0.0",
|
||||
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.3.7/tubearchivistmetadata_1.3.7.0.zip",
|
||||
"checksum": "60d8e9f134912f907dccd30b531da4f6",
|
||||
"timestamp": "2025-05-27T18:36:55Z"
|
||||
},
|
||||
{
|
||||
"version": "1.3.6.0",
|
||||
"changelog": "Fix TA auth header\n",
|
||||
"targetAbi": "10.10.0.0",
|
||||
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.3.6/tubearchivistmetadata_1.3.6.0.zip",
|
||||
"checksum": "513cde64268867d0047009eb2d986054",
|
||||
"timestamp": "2025-03-10T22:01:13Z"
|
||||
},
|
||||
{
|
||||
"version": "1.3.5.0",
|
||||
"changelog": "Adapt to the new TA API changes Fix JF crash when setting watched status with TA offline\n",
|
||||
"targetAbi": "10.10.0.0",
|
||||
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.3.5/tubearchivistmetadata_1.3.5.0.zip",
|
||||
"checksum": "2536622c0ec73e6401860929f24849f7",
|
||||
"timestamp": "2025-03-10T17:47:43Z"
|
||||
},
|
||||
{
|
||||
"version": "1.3.4.0",
|
||||
"changelog": "Merge workaround for JF crashing when scanning Series pull request by wolffshots\n",
|
||||
"targetAbi": "10.10.0.0",
|
||||
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.3.4/tubearchivistmetadata_1.3.4.0.zip",
|
||||
"checksum": "1ee6041139a6fdc3cecc8b2a427c60a8",
|
||||
"timestamp": "2024-11-04T21:30:24Z"
|
||||
},
|
||||
{
|
||||
"version": "1.3.3.0",
|
||||
"changelog": "Add compatibility with Jellyfin 10.10\n",
|
||||
"targetAbi": "10.10.0.0",
|
||||
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.3.3/tubearchivistmetadata_1.3.3.0.zip",
|
||||
"checksum": "ee6431d8bdaf844672d167b6f3ee0a73",
|
||||
"timestamp": "2024-11-04T20:41:46Z"
|
||||
},
|
||||
{
|
||||
"version": "1.3.2.0",
|
||||
"changelog": "Add support for Jellyfin 10.9.1\n",
|
||||
"changelog": "Add tasks progress status Adjust logs levels\n",
|
||||
"targetAbi": "10.9.1.0",
|
||||
"sourceUrl": "https://github.com/tubearchivist/tubearchivist-jf-plugin/releases/download/v1.3.2/tubearchivistmetadata_1.3.2.0.zip",
|
||||
"checksum": "90e3bc35cdadf8688813252e6d5c390a",
|
||||
"timestamp": "2024-09-14T13:33:07Z"
|
||||
"checksum": "6162235807535a5c2a7570276798e69e",
|
||||
"timestamp": "2024-09-14T13:41:58Z"
|
||||
},
|
||||
{
|
||||
"version": "1.3.1.0",
|
||||
@@ -46,7 +86,7 @@
|
||||
"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"
|
||||
"timestamp": "2024-05-09T15:41:00Z"
|
||||
},
|
||||
{
|
||||
"version": "1.2.3.0",
|
||||
@@ -54,7 +94,7 @@
|
||||
"targetAbi": "10.8.0.0",
|
||||
"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"
|
||||
"timestamp": "2024-04-18T21:45:00Z"
|
||||
},
|
||||
{
|
||||
"version": "1.2.2.0",
|
||||
@@ -62,7 +102,7 @@
|
||||
"targetAbi": "10.8.0.0",
|
||||
"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"
|
||||
"timestamp": "2024-03-15T10:12:00Z"
|
||||
},
|
||||
{
|
||||
"version": "1.2.1.0",
|
||||
@@ -70,7 +110,7 @@
|
||||
"targetAbi": "10.8.0.0",
|
||||
"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"
|
||||
"timestamp": "2024-03-14T21:50:00Z"
|
||||
},
|
||||
{
|
||||
"version": "1.2.0.0",
|
||||
@@ -78,7 +118,7 @@
|
||||
"targetAbi": "10.8.0.0",
|
||||
"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"
|
||||
"timestamp": "2024-03-14T20:00:00Z"
|
||||
},
|
||||
{
|
||||
"version": "1.1.1.0",
|
||||
@@ -86,7 +126,7 @@
|
||||
"targetAbi": "10.8.0.0",
|
||||
"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"
|
||||
"timestamp": "2024-03-14T16:35:00Z"
|
||||
},
|
||||
{
|
||||
"version": "1.1.0.0",
|
||||
@@ -94,7 +134,7 @@
|
||||
"targetAbi": "10.8.0.0",
|
||||
"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"
|
||||
"timestamp": "2024-03-13T15:02:00Z"
|
||||
},
|
||||
{
|
||||
"version": "1.0.0.0",
|
||||
@@ -102,8 +142,8 @@
|
||||
"targetAbi": "10.8.0.0",
|
||||
"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"
|
||||
"timestamp": "2024-03-11T16:02:00Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user