Merge branch 'master' into master
This commit is contained in:
@@ -119,7 +119,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Configuration
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
_logger.LogDebug("JFUsernamesTo configured: {Message}", string.Join(", ", _jfUsernamesTo));
|
_logger.LogInformation("JFUsernamesTo configured: {Message}", string.Join(", ", _jfUsernamesTo));
|
||||||
return string.Join(", ", _jfUsernamesTo);
|
return string.Join(", ", _jfUsernamesTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Configuration
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogDebug("Set JFUsernamesTo to: {Message}", string.Join(", ", _jfUsernamesTo));
|
_logger.LogInformation("Set JFUsernamesTo to: {Message}", string.Join(", ", _jfUsernamesTo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -173,6 +173,12 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
|
|||||||
|
|
||||||
private async void OnPlaybackProgress(object? sender, PlaybackProgressEventArgs eventArgs)
|
private async void OnPlaybackProgress(object? sender, PlaybackProgressEventArgs eventArgs)
|
||||||
{
|
{
|
||||||
|
if (eventArgs == null || eventArgs.ItemId == Guid.Empty)
|
||||||
|
{
|
||||||
|
Logger.LogDebug("Skipping progress synchronization: PlaybackProgress event triggered with null or empty Guid.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var topParent = eventArgs.Item.GetTopParent();
|
var topParent = eventArgs.Item.GetTopParent();
|
||||||
if (
|
if (
|
||||||
Instance!.Configuration.JFTASync &&
|
Instance!.Configuration.JFTASync &&
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
|||||||
var taApi = TubeArchivistApi.GetInstance();
|
var taApi = TubeArchivistApi.GetInstance();
|
||||||
var videoTAId = Utils.GetVideoNameFromPath(item.Path);
|
var videoTAId = Utils.GetVideoNameFromPath(item.Path);
|
||||||
var video = await taApi.GetVideo(videoTAId).ConfigureAwait(true);
|
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.LogDebug("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting images for video: {0} ({1})", video?.Title, videoTAId));
|
||||||
_logger.LogInformation("{Message}", "Thumb URI: " + video?.VidThumbUrl);
|
_logger.LogDebug("{Message}", "Thumb URI: " + video?.VidThumbUrl);
|
||||||
|
|
||||||
if (video != null)
|
if (video != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
|||||||
var taApi = TubeArchivistApi.GetInstance();
|
var taApi = TubeArchivistApi.GetInstance();
|
||||||
var videoTAId = Utils.GetVideoNameFromPath(info.Path);
|
var videoTAId = Utils.GetVideoNameFromPath(info.Path);
|
||||||
var video = await taApi.GetVideo(videoTAId).ConfigureAwait(true);
|
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.LogDebug("{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}", "Received metadata: \n" + JsonConvert.SerializeObject(video));
|
||||||
|
|
||||||
if (video != null)
|
if (video != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -60,10 +60,10 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
|||||||
var taApi = TubeArchivistApi.GetInstance();
|
var taApi = TubeArchivistApi.GetInstance();
|
||||||
var channelTAId = Utils.GetChannelNameFromPath(item.Path);
|
var channelTAId = Utils.GetChannelNameFromPath(item.Path);
|
||||||
var channel = await taApi.GetChannel(channelTAId).ConfigureAwait(true);
|
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.LogDebug("{Message}", string.Format(CultureInfo.CurrentCulture, "Getting images for channel: {0} ({1})", channel?.Name, channelTAId));
|
||||||
_logger.LogInformation("{Message}", "Thumb URI: " + channel?.ThumbUrl);
|
_logger.LogDebug("{Message}", "Thumb URI: " + channel?.ThumbUrl);
|
||||||
_logger.LogInformation("{Message}", "TVArt URI: " + channel?.TvartUrl);
|
_logger.LogDebug("{Message}", "TVArt URI: " + channel?.TvartUrl);
|
||||||
_logger.LogInformation("{Message}", "Banner URI: " + channel?.BannerUrl);
|
_logger.LogDebug("{Message}", "Banner URI: " + channel?.BannerUrl);
|
||||||
|
|
||||||
if (channel != null)
|
if (channel != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
|||||||
var taApi = TubeArchivistApi.GetInstance();
|
var taApi = TubeArchivistApi.GetInstance();
|
||||||
var channelTAId = Utils.GetChannelNameFromPath(info.Path);
|
var channelTAId = Utils.GetChannelNameFromPath(info.Path);
|
||||||
var channel = await taApi.GetChannel(channelTAId).ConfigureAwait(true);
|
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.LogDebug("{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}", "Received metadata: \n" + JsonConvert.SerializeObject(channel));
|
||||||
|
|
||||||
if (channel != null)
|
if (channel != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
|
|||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { BaseItemKind.Series }
|
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);
|
_logger.LogDebug("Found {Message} channels", channels.Count);
|
||||||
|
|
||||||
foreach (Series channel in channels)
|
foreach (Series channel in channels)
|
||||||
@@ -114,7 +114,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;
|
var processedVideosCount = 0;
|
||||||
if (collectionItem == null)
|
if (collectionItem == null)
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
|
|||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { BaseItemKind.Series }
|
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);
|
_logger.LogDebug("Found {Message} channels", channels.Count);
|
||||||
|
|
||||||
foreach (Series channel in channels)
|
foreach (Series channel in channels)
|
||||||
@@ -115,7 +115,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;
|
var processedVideosCount = 0;
|
||||||
foreach (var jfUsername in Plugin.Instance!.Configuration.GetJFUsernamesToArray())
|
foreach (var jfUsername in Plugin.Instance!.Configuration.GetJFUsernamesToArray())
|
||||||
@@ -123,7 +123,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
|
|||||||
var user = _userManager.GetUserByName(jfUsername);
|
var user = _userManager.GetUserByName(jfUsername);
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("{Message}", $"Jellyfin user with username {jfUsername} not found");
|
_logger.LogDebug("{Message}", $"Jellyfin user with username {jfUsername} not found");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,8 +185,8 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Tasks
|
|||||||
}
|
}
|
||||||
|
|
||||||
_userDataManager.SaveUserData(user, video, userUpdateData, UserDataSaveReason.UpdateUserData);
|
_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.LogDebug("{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.LogDebug("{Message}", $"Watched status for video {video.Name} set to {userItemData.Played} seconds for user {jfUsername}.");
|
||||||
|
|
||||||
processedVideosCount++;
|
processedVideosCount++;
|
||||||
progress.Report(processedVideosCount * 100 / videosCount);
|
progress.Report(processedVideosCount * 100 / videosCount);
|
||||||
|
|||||||
@@ -73,11 +73,11 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
|
|||||||
while (response.StatusCode == HttpStatusCode.Moved)
|
while (response.StatusCode == HttpStatusCode.Moved)
|
||||||
{
|
{
|
||||||
url = response.Headers.Location;
|
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);
|
response = await client.GetAsync(url).ConfigureAwait(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation("{Message}", url + ": " + response.StatusCode);
|
_logger.LogDebug("{Message}", url + ": " + response.StatusCode);
|
||||||
|
|
||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
@@ -103,16 +103,16 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
|
|||||||
while (response.StatusCode == HttpStatusCode.Moved)
|
while (response.StatusCode == HttpStatusCode.Moved)
|
||||||
{
|
{
|
||||||
url = response.Headers.Location;
|
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);
|
response = await client.GetAsync(url).ConfigureAwait(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation("{Message}", url + ": " + response.StatusCode);
|
_logger.LogDebug("{Message}", url + ": " + response.StatusCode);
|
||||||
|
|
||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
string rawData = await response.Content.ReadAsStringAsync().ConfigureAwait(true);
|
string rawData = await response.Content.ReadAsStringAsync().ConfigureAwait(true);
|
||||||
_logger.LogInformation("{Message}", rawData);
|
_logger.LogDebug("{Message}", rawData);
|
||||||
video = JsonConvert.DeserializeObject<Video>(rawData);
|
video = JsonConvert.DeserializeObject<Video>(rawData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,11 +134,11 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
|
|||||||
while (response.StatusCode == HttpStatusCode.Moved)
|
while (response.StatusCode == HttpStatusCode.Moved)
|
||||||
{
|
{
|
||||||
url = response.Headers.Location;
|
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);
|
response = await client.GetAsync(url).ConfigureAwait(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation("{Message}", url + ": " + response.StatusCode);
|
_logger.LogDebug("{Message}", url + ": " + response.StatusCode);
|
||||||
|
|
||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
@@ -179,7 +179,7 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.TubeArchivist
|
|||||||
if (video != null)
|
if (video != null)
|
||||||
{
|
{
|
||||||
progress = new Progress((long)video.Player.Position);
|
progress = new Progress((long)video.Player.Position);
|
||||||
_logger.LogInformation("{Message}", $"Retrieved progress {video.Player.Position}");
|
_logger.LogDebug("{Message}", $"Retrieved progress {video.Player.Position}");
|
||||||
}
|
}
|
||||||
|
|
||||||
return progress;
|
return progress;
|
||||||
|
|||||||
Reference in New Issue
Block a user