Cleaned up deps and removed legacy code
This commit is contained in:
@@ -1,20 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http.Json;
|
||||
using System.Net.Mime;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Json;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Jellyfin.Plugin.AnilistSync.API.Exceptions;
|
||||
|
||||
namespace Jellyfin.Plugin.AnilistSync.API
|
||||
{
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Jellyfin.Plugin.AnilistSync.API
|
||||
{
|
||||
public enum MediaListStatus
|
||||
{
|
||||
CURRENT,
|
||||
PLANNING,
|
||||
COMPLETED,
|
||||
DROPPED,
|
||||
PAUSED,
|
||||
REPEATING
|
||||
}
|
||||
|
||||
public class RootObject
|
||||
{
|
||||
[JsonPropertyName("data")]
|
||||
@@ -43,22 +51,7 @@ namespace Jellyfin.Plugin.AnilistSync.API
|
||||
public int? Line { get; set; }
|
||||
|
||||
[JsonPropertyName("column")]
|
||||
public int? column { get; set; }
|
||||
}
|
||||
|
||||
public class Media
|
||||
{
|
||||
[JsonPropertyName("episodes")]
|
||||
public int? Episodes { get; set; }
|
||||
}
|
||||
|
||||
public class User
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int? Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
public int? Column { get; set; }
|
||||
}
|
||||
|
||||
public class ListEntry
|
||||
@@ -76,6 +69,21 @@ namespace Jellyfin.Plugin.AnilistSync.API
|
||||
public MediaListStatus? Status { get; set; }
|
||||
}
|
||||
|
||||
public class Media
|
||||
{
|
||||
[JsonPropertyName("episodes")]
|
||||
public int? Episodes { get; set; }
|
||||
}
|
||||
|
||||
public class User
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int? Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
|
||||
public class GraphQLBody
|
||||
{
|
||||
[JsonPropertyName("query")]
|
||||
@@ -103,16 +111,6 @@ namespace Jellyfin.Plugin.AnilistSync.API
|
||||
public string? Code { get; set; }
|
||||
}
|
||||
|
||||
public enum MediaListStatus
|
||||
{
|
||||
CURRENT,
|
||||
PLANNING,
|
||||
COMPLETED,
|
||||
DROPPED,
|
||||
PAUSED,
|
||||
REPEATING
|
||||
}
|
||||
|
||||
public class CodeResponse
|
||||
{
|
||||
[JsonPropertyName("token_type")]
|
||||
@@ -127,35 +125,4 @@ namespace Jellyfin.Plugin.AnilistSync.API
|
||||
[JsonPropertyName("refresh_token")]
|
||||
public string? RefreshToken { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class AnilistAPIException : Exception
|
||||
{
|
||||
public int? statusCode;
|
||||
public Location[]? locations;
|
||||
|
||||
public AnilistAPIException()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public AnilistAPIException(string message)
|
||||
: base(message)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public AnilistAPIException(string message, Exception inner)
|
||||
: base(message, inner)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public AnilistAPIException(string? message, int? statusCode, Location[]? locations)
|
||||
: base(message)
|
||||
{
|
||||
this.statusCode = statusCode;
|
||||
this.locations = locations;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,24 +4,6 @@ using MediaBrowser.Model.Plugins;
|
||||
|
||||
namespace Jellyfin.Plugin.AnilistSync.Configuration
|
||||
{
|
||||
public enum TitlePreferenceType
|
||||
{
|
||||
/// <summary>
|
||||
/// Use titles in the local metadata language.
|
||||
/// </summary>
|
||||
Localized,
|
||||
|
||||
/// <summary>
|
||||
/// Use titles in Japanese.
|
||||
/// </summary>
|
||||
Japanese,
|
||||
|
||||
/// <summary>
|
||||
/// Use titles in Japanese romaji.
|
||||
/// </summary>
|
||||
JapaneseRomaji
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class needed to create a Plugin and configure it.
|
||||
/// </summary>
|
||||
|
||||
@@ -17,24 +17,16 @@ namespace Jellyfin.Plugin.AnilistSync
|
||||
public override string Name => "AnilistSync";
|
||||
public override Guid Id => Guid.Parse("18c2a8ea-afa0-4a0b-aa94-072b492ab80b");
|
||||
public override string Description => "Jellyfin plugin to scrobble to Anilist";
|
||||
IHttpClientFactory _httpClientFactory;
|
||||
public Version version = new Version("2.2.0.0");
|
||||
|
||||
public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer, IHttpClientFactory htppClientFactory)
|
||||
public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer)
|
||||
: base(applicationPaths, xmlSerializer)
|
||||
{
|
||||
Instance = this;
|
||||
_httpClientFactory = htppClientFactory;
|
||||
}
|
||||
|
||||
public static Plugin? Instance { get; private set; }
|
||||
|
||||
public HttpClient GetHttpClient() {
|
||||
var httpClient = _httpClientFactory.CreateClient(NamedClient.Default);
|
||||
httpClient.DefaultRequestHeaders.UserAgent.Add(
|
||||
new ProductInfoHeaderValue(Name, Version.ToString()));
|
||||
|
||||
return httpClient;
|
||||
}
|
||||
|
||||
public IEnumerable<PluginPageInfo> GetPages()
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Plugin.AnilistSync.API;
|
||||
using Jellyfin.Plugin.AnilistSync.API.Exceptions;
|
||||
using Jellyfin.Plugin.AnilistSync.Configuration;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
@@ -10,7 +11,6 @@ using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Plugin.AnilistSync.Services
|
||||
|
||||
Reference in New Issue
Block a user