mirror of
https://github.com/jellyfin/jellyfin-plugin-anilist.git
synced 2025-02-17 03:48:20 +00:00
Remove MediaBrowser.Model.Logging since jellyfin removed it
This commit is contained in:
parent
6c217a2243
commit
2bd7d83f98
@ -1,10 +1,10 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Plugins;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using MediaBrowser.Plugins.Anime.Configuration;
|
||||
using MediaBrowser.Plugins.Anime.Providers.AniDB.Identity;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Plugins.Anime.Providers.AniDB.Metadata;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
@ -77,7 +77,7 @@ namespace MediaBrowser.Plugins.Anime.Providers.AniDB.Identity
|
||||
/// <param name="titlesFile">The destination file name.</param>
|
||||
private async Task DownloadTitles(string titlesFile)
|
||||
{
|
||||
_logger.Debug("Downloading new AniDB titles file.");
|
||||
_logger.LogDebug("Downloading new AniDB titles file.");
|
||||
|
||||
var client = new WebClient();
|
||||
|
||||
@ -134,4 +134,4 @@ namespace MediaBrowser.Plugins.Anime.Providers.AniDB.Identity
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@ -164,7 +164,7 @@ namespace MediaBrowser.Plugins.Anime.Providers.AniDB.Identity
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.ErrorException("Failed to load AniDB titles", e);
|
||||
_logger.LogError(e, "Failed to load AniDB titles");
|
||||
}
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ namespace MediaBrowser.Plugins.Anime.Providers.AniDB.Identity
|
||||
{
|
||||
return Task.Run(() =>
|
||||
{
|
||||
_logger.Debug("Loading AniDB titles");
|
||||
_logger.LogDebug("Loading AniDB titles");
|
||||
|
||||
var titlesFile = _downloader.TitlesFilePath;
|
||||
|
||||
@ -250,4 +250,4 @@ namespace MediaBrowser.Plugins.Anime.Providers.AniDB.Identity
|
||||
return TitleType.Synonym;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,15 +4,16 @@ using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using MediaBrowser.Plugins.Anime.Providers.AniList.MediaBrowser.Plugins.Anime.Providers.AniList;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Plugins.Anime.Providers.AniList.MediaBrowser.Plugins.Anime.Providers.AniList;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
|
||||
//API v2
|
||||
namespace MediaBrowser.Plugins.Anime.Providers.AniList
|
||||
{
|
||||
@ -26,9 +27,9 @@ namespace MediaBrowser.Plugins.Anime.Providers.AniList
|
||||
public string Name => "AniList";
|
||||
public static readonly SemaphoreSlim ResourcePool = new SemaphoreSlim(1, 1);
|
||||
|
||||
public AniListSeriesProvider(IApplicationPaths appPaths, IHttpClient httpClient, ILogManager logManager, IJsonSerializer jsonSerializer)
|
||||
public AniListSeriesProvider(IApplicationPaths appPaths, IHttpClient httpClient, ILoggerFactory loggerFactory, IJsonSerializer jsonSerializer)
|
||||
{
|
||||
_log = logManager.GetLogger("AniList");
|
||||
_log = loggerFactory.CreateLogger("AniList");
|
||||
_httpClient = httpClient;
|
||||
_api = new Api(jsonSerializer);
|
||||
_paths = appPaths;
|
||||
@ -41,13 +42,13 @@ namespace MediaBrowser.Plugins.Anime.Providers.AniList
|
||||
var aid = info.ProviderIds.GetOrDefault(ProviderNames.AniList);
|
||||
if (string.IsNullOrEmpty(aid))
|
||||
{
|
||||
_log.Info("Start AniList... Searching(" + info.Name + ")");
|
||||
_log.LogInformation("Start AniList... Searching({Name})", info.Name);
|
||||
aid = await _api.FindSeries(info.Name, cancellationToken);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(aid))
|
||||
{
|
||||
RootObject WebContent = await _api.WebRequestAPI(_api.AniList_anime_link.Replace("{0}",aid));
|
||||
RootObject WebContent = await _api.WebRequestAPI(_api.AniList_anime_link.Replace("{0}", aid));
|
||||
result.Item = new Series();
|
||||
result.HasMetadata = true;
|
||||
|
||||
@ -165,4 +166,4 @@ namespace MediaBrowser.Plugins.Anime.Providers.AniList
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@ -23,9 +23,9 @@ namespace MediaBrowser.Plugins.Anime.Providers.AniSearch
|
||||
public string Name => "AniSearch";
|
||||
public static readonly SemaphoreSlim ResourcePool = new SemaphoreSlim(1, 1);
|
||||
|
||||
public AniSearchSeriesProvider(IApplicationPaths appPaths, IHttpClient httpClient, ILogManager logManager)
|
||||
public AniSearchSeriesProvider(IApplicationPaths appPaths, IHttpClient httpClient, ILoggerFactory loggerFactory)
|
||||
{
|
||||
_log = logManager.GetLogger("AniSearch");
|
||||
_log = loggerFactory.CreateLogger("AniSearch");
|
||||
_httpClient = httpClient;
|
||||
_paths = appPaths;
|
||||
}
|
||||
@ -37,7 +37,7 @@ namespace MediaBrowser.Plugins.Anime.Providers.AniSearch
|
||||
var aid = info.ProviderIds.GetOrDefault(ProviderNames.AniSearch);
|
||||
if (string.IsNullOrEmpty(aid))
|
||||
{
|
||||
_log.Info("Start AniSearch... Searching(" + info.Name + ")");
|
||||
_log.LogInformation("Start AniSearch... Searching({Name})", info.Name);
|
||||
aid = await Api.FindSeries(info.Name, cancellationToken);
|
||||
}
|
||||
|
||||
@ -159,4 +159,4 @@ namespace MediaBrowser.Plugins.Anime.Providers.AniSearch
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@ -25,10 +25,10 @@ namespace MediaBrowser.Plugins.Anime.Providers.MyAnimeList
|
||||
public int Order => -5;
|
||||
public string Name => "MyAnimeList";
|
||||
|
||||
public MyAnimeListSeriesProvider(IApplicationPaths appPaths, IHttpClient httpClient, ILogManager logManager)
|
||||
public MyAnimeListSeriesProvider(IApplicationPaths appPaths, IHttpClient httpClient, ILoggerFactory loggerFactory)
|
||||
{
|
||||
_api = new Api(logManager);
|
||||
_log = logManager.GetLogger("MyAnimeList");
|
||||
_api = new Api();
|
||||
_log = loggerFactory.CreateLogger("MyAnimeList");
|
||||
_httpClient = httpClient;
|
||||
_paths = appPaths;
|
||||
}
|
||||
@ -40,7 +40,7 @@ namespace MediaBrowser.Plugins.Anime.Providers.MyAnimeList
|
||||
var aid = info.ProviderIds.GetOrDefault(provider_name);
|
||||
if (string.IsNullOrEmpty(aid))
|
||||
{
|
||||
_log.Info("Start MyAnimeList... Searching(" + info.Name + ")");
|
||||
_log.LogInformation("Start MyAnimeList... Searching({Name})", info.Name);
|
||||
aid = await _api.FindSeries(info.Name, cancellationToken);
|
||||
}
|
||||
|
||||
@ -120,9 +120,9 @@ namespace MediaBrowser.Plugins.Anime.Providers.MyAnimeList
|
||||
private readonly Api _api;
|
||||
public static readonly SemaphoreSlim ResourcePool = new SemaphoreSlim(1, 1);
|
||||
|
||||
public MyAnimeListSeriesImageProvider(IHttpClient httpClient, IApplicationPaths appPaths, ILogManager logManager)
|
||||
public MyAnimeListSeriesImageProvider(IHttpClient httpClient, IApplicationPaths appPaths)
|
||||
{
|
||||
_api = new Api(logManager);
|
||||
_api = new Api();
|
||||
_httpClient = httpClient;
|
||||
_appPaths = appPaths;
|
||||
}
|
||||
@ -169,4 +169,4 @@ namespace MediaBrowser.Plugins.Anime.Providers.MyAnimeList
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using MediaBrowser.Plugins.Anime.Configuration;
|
||||
using System;
|
||||
@ -19,7 +18,6 @@ namespace MediaBrowser.Plugins.Anime.Providers.MyAnimeList
|
||||
{
|
||||
public List<string> anime_search_names = new List<string>();
|
||||
public List<string> anime_search_ids = new List<string>();
|
||||
private static ILogManager _log;
|
||||
//Use API too search
|
||||
public string SearchLink = "https://myanimelist.net/api/anime/search.xml?q={0}";
|
||||
//Web Fallback search
|
||||
@ -27,17 +25,12 @@ namespace MediaBrowser.Plugins.Anime.Providers.MyAnimeList
|
||||
//No API funktion exist too get anime
|
||||
public string anime_link = "https://myanimelist.net/anime/";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// WebContent API call to get a anime with id
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public Api(ILogManager logManager)
|
||||
{
|
||||
_log = logManager;
|
||||
}
|
||||
public async Task<RemoteSearchResult> GetAnime(string id, CancellationToken cancellationToken)
|
||||
{
|
||||
string WebContent = await WebRequestAPI(anime_link + id, cancellationToken);
|
||||
@ -419,4 +412,4 @@ namespace MediaBrowser.Plugins.Anime.Providers.MyAnimeList
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@ -24,9 +24,9 @@ namespace MediaBrowser.Plugins.Anime.Providers.Proxer
|
||||
public int Order => -4;
|
||||
public string Name => "Proxer";
|
||||
|
||||
public ProxerSeriesProvider(IApplicationPaths appPaths, IHttpClient httpClient, ILogManager logManager)
|
||||
public ProxerSeriesProvider(IApplicationPaths appPaths, IHttpClient httpClient, ILoggerFactory loggerFactory)
|
||||
{
|
||||
_log = logManager.GetLogger("Proxer");
|
||||
_log = loggerFactory.CreateLogger("Proxer");
|
||||
_httpClient = httpClient;
|
||||
_paths = appPaths;
|
||||
}
|
||||
@ -38,7 +38,7 @@ namespace MediaBrowser.Plugins.Anime.Providers.Proxer
|
||||
var aid = info.ProviderIds.GetOrDefault(provider_name);
|
||||
if (string.IsNullOrEmpty(aid))
|
||||
{
|
||||
_log.Info("Start Proxer... Searching(" + info.Name + ")");
|
||||
_log.LogInformation("Start Proxer... Searching({Name})", info.Name);
|
||||
aid = await Api.FindSeries(info.Name, cancellationToken);
|
||||
}
|
||||
|
||||
@ -160,4 +160,4 @@ namespace MediaBrowser.Plugins.Anime.Providers.Proxer
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Plugins.Anime.Providers.AniDB.Identity;
|
||||
using MediaBrowser.Plugins.Anime.Providers.AniDB.Identity;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@ -544,4 +544,4 @@ namespace MediaBrowser.Plugins.Anime.Providers
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user