Replace debug messages with information logs
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
@@ -11,6 +12,8 @@ using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
{
|
||||
@@ -19,6 +22,23 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
/// </summary>
|
||||
public class EpisodeImageProvider : IRemoteImageProvider
|
||||
{
|
||||
private ILogger _logger;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EpisodeImageProvider"/> class.
|
||||
/// </summary>
|
||||
public EpisodeImageProvider()
|
||||
{
|
||||
if (Plugin.Instance == null)
|
||||
{
|
||||
throw new DataException("Uninitialized plugin!");
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger = Plugin.Instance.Logger;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the provider name.
|
||||
/// </summary>
|
||||
@@ -40,6 +60,8 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
var taApi = TubeArchivistApi.GetInstance();
|
||||
var videoTAId = item.Path.Split("/").Last().Split(".").First();
|
||||
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);
|
||||
|
||||
if (video != null)
|
||||
{
|
||||
@@ -49,7 +71,6 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
Type = ImageType.Primary,
|
||||
Url = video.VidThumbUrl
|
||||
});
|
||||
Console.WriteLine("ThumbURL: " + video.VidThumbUrl);
|
||||
}
|
||||
|
||||
return list;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
@@ -11,6 +12,7 @@ using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
@@ -20,6 +22,23 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
/// </summary>
|
||||
public class EpisodeMetadataProvider : IRemoteMetadataProvider<Episode, EpisodeInfo>
|
||||
{
|
||||
private ILogger _logger;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EpisodeMetadataProvider"/> class.
|
||||
/// </summary>
|
||||
public EpisodeMetadataProvider()
|
||||
{
|
||||
if (Plugin.Instance == null)
|
||||
{
|
||||
throw new DataException("Uninitialized plugin!");
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger = Plugin.Instance.Logger;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the provider name.
|
||||
/// </summary>
|
||||
@@ -32,9 +51,8 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
var taApi = TubeArchivistApi.GetInstance();
|
||||
var videoTAId = info.Path.Split("/").Last().Split(".").First();
|
||||
var video = await taApi.GetVideo(videoTAId).ConfigureAwait(true);
|
||||
Console.WriteLine("Metadata video received: ");
|
||||
Console.WriteLine(JsonConvert.SerializeObject(video));
|
||||
Console.WriteLine("Media YT id: " + videoTAId);
|
||||
_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));
|
||||
|
||||
if (video != null)
|
||||
{
|
||||
@@ -51,7 +69,6 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
result.People = peopleInfo;
|
||||
}
|
||||
|
||||
Console.WriteLine(result.Item.ProductionYear);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
@@ -11,6 +12,7 @@ using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
{
|
||||
@@ -19,6 +21,23 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
/// </summary>
|
||||
public class SeriesImageProvider : IRemoteImageProvider
|
||||
{
|
||||
private ILogger _logger;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SeriesImageProvider"/> class.
|
||||
/// </summary>
|
||||
public SeriesImageProvider()
|
||||
{
|
||||
if (Plugin.Instance == null)
|
||||
{
|
||||
throw new DataException("Uninitialized plugin!");
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger = Plugin.Instance.Logger;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the provider name.
|
||||
/// </summary>
|
||||
@@ -40,6 +59,10 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
var taApi = TubeArchivistApi.GetInstance();
|
||||
var channelTAId = item.Path.Split("/").Last();
|
||||
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);
|
||||
|
||||
if (channel != null)
|
||||
{
|
||||
@@ -75,7 +98,6 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Channel images: " + Plugin.Instance.Configuration.TubeArchivistUrl + url);
|
||||
return await Plugin.Instance.HttpClient.GetAsync(new Uri(Plugin.Instance.Configuration.TubeArchivistUrl + url), cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
@@ -11,6 +12,7 @@ using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
@@ -20,6 +22,23 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
/// </summary>
|
||||
public class SeriesMetadataProvider : IRemoteMetadataProvider<Series, SeriesInfo>
|
||||
{
|
||||
private ILogger _logger;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SeriesMetadataProvider"/> class.
|
||||
/// </summary>
|
||||
public SeriesMetadataProvider()
|
||||
{
|
||||
if (Plugin.Instance == null)
|
||||
{
|
||||
throw new DataException("Uninitialized plugin!");
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger = Plugin.Instance.Logger;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the provider name.
|
||||
/// </summary>
|
||||
@@ -32,6 +51,8 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Providers
|
||||
var taApi = TubeArchivistApi.GetInstance();
|
||||
var channelTAId = info.Path.Split("/").Last();
|
||||
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));
|
||||
|
||||
if (channel != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user