diff --git a/Jellyfin.Plugin.MetaShark.Test/DoubanApiTest.cs b/Jellyfin.Plugin.MetaShark.Test/DoubanApiTest.cs
index c7bdd0f..1db6c1f 100644
--- a/Jellyfin.Plugin.MetaShark.Test/DoubanApiTest.cs
+++ b/Jellyfin.Plugin.MetaShark.Test/DoubanApiTest.cs
@@ -1,15 +1,6 @@
-using System.Reflection;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Jellyfin.Plugin.MetaShark.Api;
using Jellyfin.Plugin.MetaShark.Core;
-using Jellyfin.Plugin.MetaShark.Model;
-using Jellyfin.Plugin.MetaShark.Providers;
using Microsoft.Extensions.Logging;
-using Newtonsoft.Json;
namespace Jellyfin.Plugin.MetaShark.Test
{
diff --git a/Jellyfin.Plugin.MetaShark.Test/ImdbApiTest.cs b/Jellyfin.Plugin.MetaShark.Test/ImdbApiTest.cs
index e1ca810..dc57587 100644
--- a/Jellyfin.Plugin.MetaShark.Test/ImdbApiTest.cs
+++ b/Jellyfin.Plugin.MetaShark.Test/ImdbApiTest.cs
@@ -1,15 +1,5 @@
-using System.Reflection;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Jellyfin.Plugin.MetaShark.Api;
-using Jellyfin.Plugin.MetaShark.Core;
-using Jellyfin.Plugin.MetaShark.Model;
-using Jellyfin.Plugin.MetaShark.Providers;
using Microsoft.Extensions.Logging;
-using Newtonsoft.Json;
namespace Jellyfin.Plugin.MetaShark.Test
{
diff --git a/Jellyfin.Plugin.MetaShark.Test/ParseNameTest.cs b/Jellyfin.Plugin.MetaShark.Test/ParseNameTest.cs
index edc2104..b8ce6d7 100644
--- a/Jellyfin.Plugin.MetaShark.Test/ParseNameTest.cs
+++ b/Jellyfin.Plugin.MetaShark.Test/ParseNameTest.cs
@@ -8,7 +8,7 @@ using Jellyfin.Plugin.MetaShark.Core;
using Jellyfin.Plugin.MetaShark.Model;
using Jellyfin.Plugin.MetaShark.Providers;
using Microsoft.Extensions.Logging;
-using Newtonsoft.Json;
+
namespace Jellyfin.Plugin.MetaShark.Test
{
diff --git a/Jellyfin.Plugin.MetaShark/Api/TmdbApi.cs b/Jellyfin.Plugin.MetaShark/Api/TmdbApi.cs
index ce9e3ec..23ee214 100644
--- a/Jellyfin.Plugin.MetaShark/Api/TmdbApi.cs
+++ b/Jellyfin.Plugin.MetaShark/Api/TmdbApi.cs
@@ -40,7 +40,7 @@ namespace Jellyfin.Plugin.MetaShark.Api
var apiKey = string.IsNullOrEmpty(config?.TmdbApiKey) ? DEFAULT_API_KEY : config.TmdbApiKey;
var host = string.IsNullOrEmpty(config?.TmdbHost) ? DEFAULT_API_HOST : config.TmdbHost;
_tmDbClient = new TMDbClient(apiKey, true, host);
- _tmDbClient.RequestTimeout = TimeSpan.FromSeconds(10);
+ _tmDbClient.Timeout = TimeSpan.FromSeconds(10);
// Not really interested in NotFoundException
_tmDbClient.ThrowApiExceptions = false;
}
diff --git a/Jellyfin.Plugin.MetaShark/ILRepack.targets b/Jellyfin.Plugin.MetaShark/ILRepack.targets
new file mode 100644
index 0000000..c75f037
--- /dev/null
+++ b/Jellyfin.Plugin.MetaShark/ILRepack.targets
@@ -0,0 +1,27 @@
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Jellyfin.Plugin.MetaShark/Jellyfin.Plugin.MetaShark.csproj b/Jellyfin.Plugin.MetaShark/Jellyfin.Plugin.MetaShark.csproj
index 2226069..bd01029 100644
--- a/Jellyfin.Plugin.MetaShark/Jellyfin.Plugin.MetaShark.csproj
+++ b/Jellyfin.Plugin.MetaShark/Jellyfin.Plugin.MetaShark.csproj
@@ -15,9 +15,12 @@
+
+
+
diff --git a/Jellyfin.Plugin.MetaShark/Model/DoubanSubject.cs b/Jellyfin.Plugin.MetaShark/Model/DoubanSubject.cs
index 4dcd997..3fa2318 100644
--- a/Jellyfin.Plugin.MetaShark/Model/DoubanSubject.cs
+++ b/Jellyfin.Plugin.MetaShark/Model/DoubanSubject.cs
@@ -1,11 +1,8 @@
-using MediaBrowser.Model.Entities;
-using Newtonsoft.Json;
-using System;
+using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Text.Json.Serialization;
namespace Jellyfin.Plugin.MetaShark.Model
{
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/AssemblyInfo.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/AssemblyInfo.cs
deleted file mode 100644
index 1563afa..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/AssemblyInfo.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-using System.Runtime.CompilerServices;
-
-[assembly: InternalsVisibleTo("ComposableAsync.Core.Test")]
-
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Awaitable/DispatcherAwaiter.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Awaitable/DispatcherAwaiter.cs
deleted file mode 100644
index 061840a..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Awaitable/DispatcherAwaiter.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-using System.Runtime.CompilerServices;
-using System.Security;
-
-namespace ComposableAsync
-{
- ///
- /// Dispatcher awaiter, making a dispatcher awaitable
- ///
- public struct DispatcherAwaiter : INotifyCompletion
- {
- ///
- /// Dispatcher never is synchronous
- ///
- public bool IsCompleted => false;
-
- private readonly IDispatcher _Dispatcher;
-
- ///
- /// Construct a NotifyCompletion fom a dispatcher
- ///
- ///
- public DispatcherAwaiter(IDispatcher dispatcher)
- {
- _Dispatcher = dispatcher;
- }
-
- ///
- /// Dispatch on complete
- ///
- ///
- [SecuritySafeCritical]
- public void OnCompleted(Action continuation)
- {
- _Dispatcher.Dispatch(continuation);
- }
-
- ///
- /// No Result
- ///
- public void GetResult() { }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DelegatingHandler/DispatcherDelegatingHandler.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DelegatingHandler/DispatcherDelegatingHandler.cs
deleted file mode 100644
index dbd8b49..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DelegatingHandler/DispatcherDelegatingHandler.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.Net.Http;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace ComposableAsync
-{
- ///
- /// A implementation based on
- ///
- internal class DispatcherDelegatingHandler : DelegatingHandler
- {
- private readonly IDispatcher _Dispatcher;
-
- ///
- /// Build an from a
- ///
- ///
- public DispatcherDelegatingHandler(IDispatcher dispatcher)
- {
- _Dispatcher = dispatcher;
- InnerHandler = new HttpClientHandler();
- }
-
- protected override Task SendAsync(HttpRequestMessage request,
- CancellationToken cancellationToken)
- {
- return _Dispatcher.Enqueue(() => base.SendAsync(request, cancellationToken), cancellationToken);
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Dispatcher/ComposedDispatcher.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Dispatcher/ComposedDispatcher.cs
deleted file mode 100644
index aed2434..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Dispatcher/ComposedDispatcher.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace ComposableAsync
-{
- internal class ComposedDispatcher : IDispatcher, IAsyncDisposable
- {
- private readonly IDispatcher _First;
- private readonly IDispatcher _Second;
-
- public ComposedDispatcher(IDispatcher first, IDispatcher second)
- {
- _First = first;
- _Second = second;
- }
-
- public void Dispatch(Action action)
- {
- _First.Dispatch(() => _Second.Dispatch(action));
- }
-
- public async Task Enqueue(Action action)
- {
- await _First.Enqueue(() => _Second.Enqueue(action));
- }
-
- public async Task Enqueue(Func action)
- {
- return await _First.Enqueue(() => _Second.Enqueue(action));
- }
-
- public async Task Enqueue(Func action)
- {
- await _First.Enqueue(() => _Second.Enqueue(action));
- }
-
- public async Task Enqueue(Func> action)
- {
- return await _First.Enqueue(() => _Second.Enqueue(action));
- }
-
- public async Task Enqueue(Func action, CancellationToken cancellationToken)
- {
- await _First.Enqueue(() => _Second.Enqueue(action, cancellationToken), cancellationToken);
- }
-
- public async Task Enqueue(Func> action, CancellationToken cancellationToken)
- {
- return await _First.Enqueue(() => _Second.Enqueue(action, cancellationToken), cancellationToken);
- }
-
- public async Task Enqueue(Func action, CancellationToken cancellationToken)
- {
- return await _First.Enqueue(() => _Second.Enqueue(action, cancellationToken), cancellationToken);
- }
-
- public async Task Enqueue(Action action, CancellationToken cancellationToken)
- {
- await _First.Enqueue(() => _Second.Enqueue(action, cancellationToken), cancellationToken);
- }
-
- public IDispatcher Clone() => new ComposedDispatcher(_First, _Second);
-
- public Task DisposeAsync()
- {
- return Task.WhenAll(DisposeAsync(_First), DisposeAsync(_Second));
- }
-
- private static Task DisposeAsync(IDispatcher disposable) => (disposable as IAsyncDisposable)?.DisposeAsync() ?? Task.CompletedTask;
-
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Dispatcher/DispatcherAdapter.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Dispatcher/DispatcherAdapter.cs
deleted file mode 100644
index d6532ad..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Dispatcher/DispatcherAdapter.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace ComposableAsync
-{
- internal class DispatcherAdapter : IDispatcher
- {
- private readonly IBasicDispatcher _BasicDispatcher;
-
- public DispatcherAdapter(IBasicDispatcher basicDispatcher)
- {
- _BasicDispatcher = basicDispatcher;
- }
-
- public IDispatcher Clone() => new DispatcherAdapter(_BasicDispatcher.Clone());
-
- public void Dispatch(Action action)
- {
- _BasicDispatcher.Enqueue(action, CancellationToken.None);
- }
-
- public Task Enqueue(Action action)
- {
- return _BasicDispatcher.Enqueue(action, CancellationToken.None);
- }
-
- public Task Enqueue(Func action)
- {
- return _BasicDispatcher.Enqueue(action, CancellationToken.None);
- }
-
- public Task Enqueue(Func action)
- {
- return _BasicDispatcher.Enqueue(action, CancellationToken.None);
- }
-
- public Task Enqueue(Func> action)
- {
- return _BasicDispatcher.Enqueue(action, CancellationToken.None);
- }
-
- public Task Enqueue(Func action, CancellationToken cancellationToken)
- {
- return _BasicDispatcher.Enqueue(action, cancellationToken);
- }
-
- public Task Enqueue(Action action, CancellationToken cancellationToken)
- {
- return _BasicDispatcher.Enqueue(action, cancellationToken);
- }
-
- public Task Enqueue(Func action, CancellationToken cancellationToken)
- {
- return _BasicDispatcher.Enqueue(action, cancellationToken);
- }
-
- public Task Enqueue(Func> action, CancellationToken cancellationToken)
- {
- return _BasicDispatcher.Enqueue(action, cancellationToken);
- }
- }
-}
\ No newline at end of file
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Dispatcher/NullDispatcher.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Dispatcher/NullDispatcher.cs
deleted file mode 100644
index 4882f9e..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Dispatcher/NullDispatcher.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace ComposableAsync
-{
- ///
- /// that run actions synchronously
- ///
- public sealed class NullDispatcher: IDispatcher
- {
- private NullDispatcher() { }
-
- ///
- /// Returns a static null dispatcher
- ///
- public static IDispatcher Instance { get; } = new NullDispatcher();
-
- ///
- public void Dispatch(Action action)
- {
- action();
- }
-
- ///
- public Task Enqueue(Action action)
- {
- action();
- return Task.CompletedTask;
- }
-
- ///
- public Task Enqueue(Func action)
- {
- return Task.FromResult(action());
- }
-
- ///
- public async Task Enqueue(Func action)
- {
- await action();
- }
-
- ///
- public async Task Enqueue(Func> action)
- {
- return await action();
- }
-
- public Task Enqueue(Func action, CancellationToken cancellationToken)
- {
- return Task.FromResult(action());
- }
-
- public Task Enqueue(Action action, CancellationToken cancellationToken)
- {
- action();
- return Task.CompletedTask;
- }
-
- public async Task Enqueue(Func action, CancellationToken cancellationToken)
- {
- await action();
- }
-
- public async Task Enqueue(Func> action, CancellationToken cancellationToken)
- {
- return await action();
- }
-
- ///
- public IDispatcher Clone() => Instance;
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DispatcherExtension.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DispatcherExtension.cs
deleted file mode 100644
index ef29912..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DispatcherExtension.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net.Http;
-
-namespace ComposableAsync
-{
- ///
- /// extension methods provider
- ///
- public static class DispatcherExtension
- {
- ///
- /// Returns awaitable to enter in the dispatcher context
- /// This extension method make a dispatcher awaitable
- ///
- ///
- ///
- public static DispatcherAwaiter GetAwaiter(this IDispatcher dispatcher)
- {
- return new DispatcherAwaiter(dispatcher);
- }
-
- ///
- /// Returns a composed dispatcher applying the given dispatcher
- /// after the first one
- ///
- ///
- ///
- ///
- public static IDispatcher Then(this IDispatcher dispatcher, IDispatcher other)
- {
- if (dispatcher == null)
- throw new ArgumentNullException(nameof(dispatcher));
-
- if (other == null)
- throw new ArgumentNullException(nameof(other));
-
- return new ComposedDispatcher(dispatcher, other);
- }
-
- ///
- /// Returns a composed dispatcher applying the given dispatchers sequentially
- ///
- ///
- ///
- ///
- public static IDispatcher Then(this IDispatcher dispatcher, params IDispatcher[] others)
- {
- return dispatcher.Then((IEnumerable)others);
- }
-
- ///
- /// Returns a composed dispatcher applying the given dispatchers sequentially
- ///
- ///
- ///
- ///
- public static IDispatcher Then(this IDispatcher dispatcher, IEnumerable others)
- {
- if (dispatcher == null)
- throw new ArgumentNullException(nameof(dispatcher));
-
- if (others == null)
- throw new ArgumentNullException(nameof(others));
-
- return others.Aggregate(dispatcher, (cum, val) => cum.Then(val));
- }
-
- ///
- /// Create a from an
- ///
- ///
- ///
- public static DelegatingHandler AsDelegatingHandler(this IDispatcher dispatcher)
- {
- return new DispatcherDelegatingHandler(dispatcher);
- }
-
- ///
- /// Create a from an
- ///
- ///
- ///
- public static IDispatcher ToFullDispatcher(this IBasicDispatcher @basicDispatcher)
- {
- return new DispatcherAdapter(@basicDispatcher);
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DispatcherManager/IDispatcherManager.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DispatcherManager/IDispatcherManager.cs
deleted file mode 100644
index 66c52d5..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DispatcherManager/IDispatcherManager.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-namespace ComposableAsync
-{
- ///
- /// Dispatcher manager
- ///
- public interface IDispatcherManager : IAsyncDisposable
- {
- ///
- /// true if the Dispatcher should be released
- ///
- bool DisposeDispatcher { get; }
-
- ///
- /// Returns a consumable Dispatcher
- ///
- ///
- IDispatcher GetDispatcher();
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DispatcherManager/MonoDispatcherManager.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DispatcherManager/MonoDispatcherManager.cs
deleted file mode 100644
index f26ef5c..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DispatcherManager/MonoDispatcherManager.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Threading.Tasks;
-
-namespace ComposableAsync
-{
- ///
- /// implementation based on single
- ///
- public sealed class MonoDispatcherManager : IDispatcherManager
- {
- ///
- public bool DisposeDispatcher { get; }
-
- ///
- public IDispatcher GetDispatcher() => _Dispatcher;
-
- private readonly IDispatcher _Dispatcher;
-
- ///
- /// Create
- ///
- ///
- ///
- public MonoDispatcherManager(IDispatcher dispatcher, bool shouldDispose = false)
- {
- _Dispatcher = dispatcher;
- DisposeDispatcher = shouldDispose;
- }
-
- ///
- public Task DisposeAsync()
- {
- return DisposeDispatcher && (_Dispatcher is IAsyncDisposable disposable) ?
- disposable.DisposeAsync() : Task.CompletedTask;
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DispatcherProviderExtension.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DispatcherProviderExtension.cs
deleted file mode 100644
index f7046a1..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/DispatcherProviderExtension.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace ComposableAsync
-{
- ///
- /// extension
- ///
- public static class DispatcherProviderExtension
- {
- ///
- /// Returns the underlying
- ///
- ///
- ///
- public static IDispatcher GetAssociatedDispatcher(this IDispatcherProvider dispatcherProvider)
- {
- return dispatcherProvider?.Dispatcher ?? NullDispatcher.Instance;
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Disposable/ComposableAsyncDisposable.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Disposable/ComposableAsyncDisposable.cs
deleted file mode 100644
index 541d906..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Disposable/ComposableAsyncDisposable.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using System.Collections.Concurrent;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace ComposableAsync
-{
- ///
- /// implementation aggregating other
- ///
- public sealed class ComposableAsyncDisposable : IAsyncDisposable
- {
- private readonly ConcurrentQueue _Disposables;
-
- ///
- /// Build an empty ComposableAsyncDisposable
- ///
- public ComposableAsyncDisposable()
- {
- _Disposables = new ConcurrentQueue();
- }
-
- ///
- /// Add an to the ComposableAsyncDisposable
- /// and returns it
- ///
- ///
- ///
- ///
- public T Add(T disposable) where T: IAsyncDisposable
- {
- if (disposable == null)
- return default(T);
-
- _Disposables.Enqueue(disposable);
- return disposable;
- }
-
- ///
- /// Dispose all the resources asynchronously
- ///
- ///
- public Task DisposeAsync()
- {
- var tasks = _Disposables.ToArray().Select(disposable => disposable.DisposeAsync()).ToArray();
- return Task.WhenAll(tasks);
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Disposable/IAsyncDisposable.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Disposable/IAsyncDisposable.cs
deleted file mode 100644
index 3517491..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/Disposable/IAsyncDisposable.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System.Threading.Tasks;
-
-namespace ComposableAsync
-{
- ///
- /// Asynchronous version of IDisposable
- /// For reference see discussion: https://github.com/dotnet/roslyn/issues/114
- ///
- public interface IAsyncDisposable
- {
- ///
- /// Performs asynchronously application-defined tasks associated with freeing,
- /// releasing, or resetting unmanaged resources.
- ///
- Task DisposeAsync();
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/IBasicDispatcher.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/IBasicDispatcher.cs
deleted file mode 100644
index 6e054dd..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/IBasicDispatcher.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace ComposableAsync
-{
- ///
- /// Simplified version of that can be converted
- /// to a using the ToFullDispatcher extension method
- ///
- public interface IBasicDispatcher
- {
- ///
- /// Clone dispatcher
- ///
- ///
- IBasicDispatcher Clone();
-
- ///
- /// Enqueue the function and return a task corresponding
- /// to the execution of the task
- /// ///
- ///
- ///
- ///
- ///
- Task Enqueue(Func action, CancellationToken cancellationToken);
-
- ///
- /// Enqueue the action and return a task corresponding
- /// to the execution of the task
- ///
- ///
- ///
- ///
- Task Enqueue(Action action, CancellationToken cancellationToken);
-
- ///
- /// Enqueue the task and return a task corresponding
- /// to the execution of the task
- ///
- ///
- ///
- ///
- Task Enqueue(Func action, CancellationToken cancellationToken);
-
- ///
- /// Enqueue the task and return a task corresponding
- /// to the execution of the original task
- ///
- ///
- ///
- ///
- ///
- Task Enqueue(Func> action, CancellationToken cancellationToken);
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/IDispatcher.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/IDispatcher.cs
deleted file mode 100644
index d7eb14f..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/IDispatcher.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace ComposableAsync
-{
- ///
- /// Dispatcher executes an action or a function
- /// on its own context
- ///
- public interface IDispatcher
- {
- ///
- /// Execute action on dispatcher context in a
- /// none-blocking way
- ///
- ///
- void Dispatch(Action action);
-
- ///
- /// Enqueue the action and return a task corresponding to
- /// the completion of the action
- ///
- ///
- ///
- Task Enqueue(Action action);
-
- ///
- /// Enqueue the function and return a task corresponding to
- /// the result of the function
- ///
- ///
- ///
- ///
- Task Enqueue(Func action);
-
- ///
- /// Enqueue the task and return a task corresponding to
- /// the completion of the task
- ///
- ///
- ///
- Task Enqueue(Func action);
-
- ///
- /// Enqueue the task and return a task corresponding
- /// to the execution of the original task
- ///
- ///
- ///
- ///
- Task Enqueue(Func> action);
-
- ///
- /// Enqueue the function and return a task corresponding
- /// to the execution of the task
- /// ///
- ///
- ///
- ///
- ///
- Task Enqueue(Func action, CancellationToken cancellationToken);
-
- ///
- /// Enqueue the action and return a task corresponding
- /// to the execution of the task
- ///
- ///
- ///
- ///
- Task Enqueue(Action action, CancellationToken cancellationToken);
-
- ///
- /// Enqueue the task and return a task corresponding
- /// to the execution of the task
- ///
- ///
- ///
- ///
- Task Enqueue(Func action, CancellationToken cancellationToken);
-
- ///
- /// Enqueue the task and return a task corresponding
- /// to the execution of the original task
- ///
- ///
- ///
- ///
- ///
- Task Enqueue(Func> action, CancellationToken cancellationToken);
-
- ///
- /// Clone dispatcher
- ///
- ///
- IDispatcher Clone();
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/IDispatcherProvider.cs b/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/IDispatcherProvider.cs
deleted file mode 100644
index fb4c760..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/ComposableAsync.Core/IDispatcherProvider.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace ComposableAsync
-{
- ///
- /// Returns the fiber associated with an actor
- ///
- public interface IDispatcherProvider
- {
- ///
- /// Returns the corresponding
- ///
- IDispatcher Dispatcher { get; }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/AwaitableConstraintExtension.cs b/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/AwaitableConstraintExtension.cs
deleted file mode 100644
index 0a2dd65..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/AwaitableConstraintExtension.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-namespace RateLimiter
-{
- ///
- /// Provides extension to interface
- ///
- public static class AwaitableConstraintExtension
- {
- ///
- /// Compose two awaitable constraint in a new one
- ///
- ///
- ///
- ///
- public static IAwaitableConstraint Compose(this IAwaitableConstraint awaitableConstraint1, IAwaitableConstraint awaitableConstraint2)
- {
- if (awaitableConstraint1 == awaitableConstraint2)
- return awaitableConstraint1;
-
- return new ComposedAwaitableConstraint(awaitableConstraint1, awaitableConstraint2);
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/ComposedAwaitableConstraint.cs b/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/ComposedAwaitableConstraint.cs
deleted file mode 100644
index 278de53..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/ComposedAwaitableConstraint.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace RateLimiter
-{
- internal class ComposedAwaitableConstraint : IAwaitableConstraint
- {
- private readonly IAwaitableConstraint _AwaitableConstraint1;
- private readonly IAwaitableConstraint _AwaitableConstraint2;
- private readonly SemaphoreSlim _Semaphore = new SemaphoreSlim(1, 1);
-
- internal ComposedAwaitableConstraint(IAwaitableConstraint awaitableConstraint1, IAwaitableConstraint awaitableConstraint2)
- {
- _AwaitableConstraint1 = awaitableConstraint1;
- _AwaitableConstraint2 = awaitableConstraint2;
- }
-
- public IAwaitableConstraint Clone()
- {
- return new ComposedAwaitableConstraint(_AwaitableConstraint1.Clone(), _AwaitableConstraint2.Clone());
- }
-
- public async Task WaitForReadiness(CancellationToken cancellationToken)
- {
- await _Semaphore.WaitAsync(cancellationToken);
- IDisposable[] disposables;
- try
- {
- disposables = await Task.WhenAll(_AwaitableConstraint1.WaitForReadiness(cancellationToken), _AwaitableConstraint2.WaitForReadiness(cancellationToken));
- }
- catch (Exception)
- {
- _Semaphore.Release();
- throw;
- }
- return new DisposeAction(() =>
- {
- foreach (var disposable in disposables)
- {
- disposable.Dispose();
- }
- _Semaphore.Release();
- });
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/CountByIntervalAwaitableConstraint.cs b/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/CountByIntervalAwaitableConstraint.cs
deleted file mode 100644
index 460be4f..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/CountByIntervalAwaitableConstraint.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace RateLimiter
-{
- ///
- /// Provide an awaitable constraint based on number of times per duration
- ///
- public class CountByIntervalAwaitableConstraint : IAwaitableConstraint
- {
- ///
- /// List of the last time stamps
- ///
- public IReadOnlyList TimeStamps => _TimeStamps.ToList();
-
- ///
- /// Stack of the last time stamps
- ///
- protected LimitedSizeStack _TimeStamps { get; }
-
- private int _Count { get; }
- private TimeSpan _TimeSpan { get; }
- private SemaphoreSlim _Semaphore { get; } = new SemaphoreSlim(1, 1);
- private ITime _Time { get; }
-
- ///
- /// Constructs a new AwaitableConstraint based on number of times per duration
- ///
- ///
- ///
- public CountByIntervalAwaitableConstraint(int count, TimeSpan timeSpan) : this(count, timeSpan, TimeSystem.StandardTime)
- {
- }
-
- internal CountByIntervalAwaitableConstraint(int count, TimeSpan timeSpan, ITime time)
- {
- if (count <= 0)
- throw new ArgumentException("count should be strictly positive", nameof(count));
-
- if (timeSpan.TotalMilliseconds <= 0)
- throw new ArgumentException("timeSpan should be strictly positive", nameof(timeSpan));
-
- _Count = count;
- _TimeSpan = timeSpan;
- _TimeStamps = new LimitedSizeStack(_Count);
- _Time = time;
- }
-
- ///
- /// returns a task that will complete once the constraint is fulfilled
- ///
- ///
- /// Cancel the wait
- ///
- ///
- /// A disposable that should be disposed upon task completion
- ///
- public async Task WaitForReadiness(CancellationToken cancellationToken)
- {
- await _Semaphore.WaitAsync(cancellationToken);
- var count = 0;
- var now = _Time.GetNow();
- var target = now - _TimeSpan;
- LinkedListNode element = _TimeStamps.First, last = null;
- while ((element != null) && (element.Value > target))
- {
- last = element;
- element = element.Next;
- count++;
- }
-
- if (count < _Count)
- return new DisposeAction(OnEnded);
-
- Debug.Assert(element == null);
- Debug.Assert(last != null);
- var timeToWait = last.Value.Add(_TimeSpan) - now;
- try
- {
- await _Time.GetDelay(timeToWait, cancellationToken);
- }
- catch (Exception)
- {
- _Semaphore.Release();
- throw;
- }
-
- return new DisposeAction(OnEnded);
- }
-
- ///
- /// Clone CountByIntervalAwaitableConstraint
- ///
- ///
- public IAwaitableConstraint Clone()
- {
- return new CountByIntervalAwaitableConstraint(_Count, _TimeSpan, _Time);
- }
-
- private void OnEnded()
- {
- var now = _Time.GetNow();
- _TimeStamps.Push(now);
- OnEnded(now);
- _Semaphore.Release();
- }
-
- ///
- /// Called when action has been executed
- ///
- ///
- protected virtual void OnEnded(DateTime now)
- {
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/DisposeAction.cs b/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/DisposeAction.cs
deleted file mode 100644
index 8fd44c0..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/DisposeAction.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-namespace RateLimiter
-{
- internal class DisposeAction : IDisposable
- {
- private Action _Act;
-
- public DisposeAction(Action act)
- {
- _Act = act;
- }
-
- public void Dispose()
- {
- _Act?.Invoke();
- _Act = null;
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/IAwaitableConstraint.cs b/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/IAwaitableConstraint.cs
deleted file mode 100644
index a9d13d3..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/IAwaitableConstraint.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace RateLimiter
-{
- ///
- /// Represents a time constraints that can be awaited
- ///
- public interface IAwaitableConstraint
- {
- ///
- /// returns a task that will complete once the constraint is fulfilled
- ///
- ///
- /// Cancel the wait
- ///
- ///
- /// A disposable that should be disposed upon task completion
- ///
- Task WaitForReadiness(CancellationToken cancellationToken);
-
- ///
- /// Returns a new IAwaitableConstraint with same constraints but unused
- ///
- ///
- IAwaitableConstraint Clone();
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/ITime.cs b/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/ITime.cs
deleted file mode 100644
index 0faa0cd..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/ITime.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace RateLimiter
-{
- ///
- /// Time abstraction
- ///
- internal interface ITime
- {
- ///
- /// Return Now DateTime
- ///
- ///
- DateTime GetNow();
-
- ///
- /// Returns a task delay
- ///
- ///
- ///
- ///
- Task GetDelay(TimeSpan timespan, CancellationToken cancellationToken);
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/LimitedSizeStack.cs b/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/LimitedSizeStack.cs
deleted file mode 100644
index bf1fe86..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/LimitedSizeStack.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Collections.Generic;
-
-namespace RateLimiter
-{
- ///
- /// LinkedList with a limited size
- /// If the size exceeds the limit older entry are removed
- ///
- ///
- public class LimitedSizeStack: LinkedList
- {
- private readonly int _MaxSize;
-
- ///
- /// Construct the LimitedSizeStack with the given limit
- ///
- ///
- public LimitedSizeStack(int maxSize)
- {
- _MaxSize = maxSize;
- }
-
- ///
- /// Push new entry. If he size exceeds the limit, the oldest entry is removed
- ///
- ///
- public void Push(T item)
- {
- AddFirst(item);
-
- if (Count > _MaxSize)
- RemoveLast();
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/PersistentCountByIntervalAwaitableConstraint.cs b/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/PersistentCountByIntervalAwaitableConstraint.cs
deleted file mode 100644
index cda1e92..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/PersistentCountByIntervalAwaitableConstraint.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace RateLimiter
-{
- ///
- /// that is able to save own state.
- ///
- public sealed class PersistentCountByIntervalAwaitableConstraint : CountByIntervalAwaitableConstraint
- {
- private readonly Action _SaveStateAction;
-
- ///
- /// Create an instance of .
- ///
- /// Maximum actions allowed per time interval.
- /// Time interval limits are applied for.
- /// Action is used to save state.
- /// Initial timestamps.
- public PersistentCountByIntervalAwaitableConstraint(int count, TimeSpan timeSpan,
- Action saveStateAction, IEnumerable initialTimeStamps) : base(count, timeSpan)
- {
- _SaveStateAction = saveStateAction;
-
- if (initialTimeStamps == null)
- return;
-
- foreach (var timeStamp in initialTimeStamps)
- {
- _TimeStamps.Push(timeStamp);
- }
- }
-
- ///
- /// Save state
- ///
- protected override void OnEnded(DateTime now)
- {
- _SaveStateAction(now);
- }
- }
-}
\ No newline at end of file
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/TimeLimiter.cs b/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/TimeLimiter.cs
deleted file mode 100644
index e36b8e9..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/TimeLimiter.cs
+++ /dev/null
@@ -1,206 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using ComposableAsync;
-
-namespace RateLimiter
-{
- ///
- /// TimeLimiter implementation
- ///
- public class TimeLimiter : IDispatcher
- {
- private readonly IAwaitableConstraint _AwaitableConstraint;
-
- internal TimeLimiter(IAwaitableConstraint awaitableConstraint)
- {
- _AwaitableConstraint = awaitableConstraint;
- }
-
- ///
- /// Perform the given task respecting the time constraint
- /// returning the result of given function
- ///
- ///
- ///
- public Task Enqueue(Func perform)
- {
- return Enqueue(perform, CancellationToken.None);
- }
-
- ///
- /// Perform the given task respecting the time constraint
- /// returning the result of given function
- ///
- ///
- ///
- ///
- public Task Enqueue(Func> perform)
- {
- return Enqueue(perform, CancellationToken.None);
- }
-
- ///
- /// Perform the given task respecting the time constraint
- ///
- ///
- ///
- ///
- public async Task Enqueue(Func perform, CancellationToken cancellationToken)
- {
- cancellationToken.ThrowIfCancellationRequested();
- using (await _AwaitableConstraint.WaitForReadiness(cancellationToken))
- {
- await perform();
- }
- }
-
- ///
- /// Perform the given task respecting the time constraint
- /// returning the result of given function
- ///
- ///
- ///
- ///
- ///
- public async Task Enqueue(Func> perform, CancellationToken cancellationToken)
- {
- cancellationToken.ThrowIfCancellationRequested();
- using (await _AwaitableConstraint.WaitForReadiness(cancellationToken))
- {
- return await perform();
- }
- }
-
- public IDispatcher Clone() => new TimeLimiter(_AwaitableConstraint.Clone());
-
- private static Func Transform(Action act)
- {
- return () => { act(); return Task.FromResult(0); };
- }
-
- ///
- /// Perform the given task respecting the time constraint
- /// returning the result of given function
- ///
- ///
- ///
- ///
- private static Func> Transform(Func compute)
- {
- return () => Task.FromResult(compute());
- }
-
- ///
- /// Perform the given task respecting the time constraint
- ///
- ///
- ///
- public Task Enqueue(Action perform)
- {
- var transformed = Transform(perform);
- return Enqueue(transformed);
- }
-
- ///
- /// Perform the given task respecting the time constraint
- ///
- ///
- public void Dispatch(Action action)
- {
- Enqueue(action);
- }
-
- ///
- /// Perform the given task respecting the time constraint
- /// returning the result of given function
- ///
- ///
- ///
- ///
- public Task Enqueue(Func perform)
- {
- var transformed = Transform(perform);
- return Enqueue(transformed);
- }
-
- ///
- /// Perform the given task respecting the time constraint
- /// returning the result of given function
- ///
- ///
- ///
- ///
- ///
- public Task Enqueue(Func perform, CancellationToken cancellationToken)
- {
- var transformed = Transform(perform);
- return Enqueue(transformed, cancellationToken);
- }
-
- ///
- /// Perform the given task respecting the time constraint
- ///
- ///
- ///
- ///
- public Task Enqueue(Action perform, CancellationToken cancellationToken)
- {
- var transformed = Transform(perform);
- return Enqueue(transformed, cancellationToken);
- }
-
- ///
- /// Returns a TimeLimiter based on a maximum number of times
- /// during a given period
- ///
- ///
- ///
- ///
- public static TimeLimiter GetFromMaxCountByInterval(int maxCount, TimeSpan timeSpan)
- {
- return new TimeLimiter(new CountByIntervalAwaitableConstraint(maxCount, timeSpan));
- }
-
- ///
- /// Create that will save state using action passed through parameter.
- ///
- /// Maximum actions allowed per time interval.
- /// Time interval limits are applied for.
- /// Action is used to save state.
- /// instance with .
- public static TimeLimiter GetPersistentTimeLimiter(int maxCount, TimeSpan timeSpan,
- Action saveStateAction)
- {
- return GetPersistentTimeLimiter(maxCount, timeSpan, saveStateAction, null);
- }
-
- ///
- /// Create with initial timestamps that will save state using action passed through parameter.
- ///
- /// Maximum actions allowed per time interval.
- /// Time interval limits are applied for.
- /// Action is used to save state.
- /// Initial timestamps.
- /// instance with .
- public static TimeLimiter GetPersistentTimeLimiter(int maxCount, TimeSpan timeSpan,
- Action saveStateAction, IEnumerable initialTimeStamps)
- {
- return new TimeLimiter(new PersistentCountByIntervalAwaitableConstraint(maxCount, timeSpan, saveStateAction, initialTimeStamps));
- }
-
- ///
- /// Compose various IAwaitableConstraint in a TimeLimiter
- ///
- ///
- ///
- public static TimeLimiter Compose(params IAwaitableConstraint[] constraints)
- {
- var composed = constraints.Aggregate(default(IAwaitableConstraint),
- (accumulated, current) => (accumulated == null) ? current : accumulated.Compose(current));
- return new TimeLimiter(composed);
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/TimeSystem.cs b/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/TimeSystem.cs
deleted file mode 100644
index 81b46e1..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/RateLimiter/TimeSystem.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace RateLimiter
-{
- internal class TimeSystem : ITime
- {
- public static ITime StandardTime { get; }
-
- static TimeSystem()
- {
- StandardTime = new TimeSystem();
- }
-
- private TimeSystem()
- {
- }
-
- DateTime ITime.GetNow()
- {
- return DateTime.Now;
- }
-
- Task ITime.GetDelay(TimeSpan timespan, CancellationToken cancellationToken)
- {
- return Task.Delay(timespan, cancellationToken);
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/.editorconfig b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/.editorconfig
deleted file mode 100644
index 4540e5d..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/.editorconfig
+++ /dev/null
@@ -1,4 +0,0 @@
-[*.cs]
-
-# CAC001: ConfigureAwaitChecker
-dotnet_diagnostic.CAC001.severity = error
\ No newline at end of file
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClient.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClient.cs
deleted file mode 100644
index 10e7e6c..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClient.cs
+++ /dev/null
@@ -1,291 +0,0 @@
-using System;
-using TMDbLib.Objects.Account;
-using TMDbLib.Objects.Authentication;
-using TMDbLib.Objects.General;
-using ParameterType = TMDbLib.Rest.ParameterType;
-using RestClient = TMDbLib.Rest.RestClient;
-using RestRequest = TMDbLib.Rest.RestRequest;
-using System.Net;
-using System.Net.Http;
-using System.Threading;
-using System.Threading.Tasks;
-using TMDbLib.Rest;
-using TMDbLib.Utilities.Serializer;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient : IDisposable
- {
- private const string ApiVersion = "3";
- private const string ProductionUrl = "api.themoviedb.org";
-
- private readonly ITMDbSerializer _serializer;
- private RestClient _client;
- private TMDbConfig _config;
-
- public TMDbClient(string apiKey, bool useSsl = true, string baseUrl = ProductionUrl, ITMDbSerializer serializer = null, IWebProxy proxy = null)
- {
- DefaultLanguage = null;
- DefaultImageLanguage = null;
- DefaultCountry = null;
-
- _serializer = serializer ?? TMDbJsonSerializer.Instance;
-
- //Setup proxy to use during requests
- //Proxy is optional. If passed, will be used in every request.
- WebProxy = proxy;
-
- Initialize(baseUrl, useSsl, apiKey);
- }
-
- ///
- /// The account details of the user account associated with the current user session
- ///
- /// This value is automaticly populated when setting a user session
- public AccountDetails ActiveAccount { get; private set; }
-
- public string ApiKey { get; private set; }
-
- public TMDbConfig Config
- {
- get
- {
- if (!HasConfig)
- throw new InvalidOperationException("Call GetConfig() or SetConfig() first");
- return _config;
- }
- private set { _config = value; }
- }
-
- ///
- /// ISO 3166-1 code. Ex. US
- ///
- public string DefaultCountry { get; set; }
-
- ///
- /// ISO 639-1 code. Ex en
- ///
- public string DefaultLanguage { get; set; }
-
- ///
- /// ISO 639-1 code. Ex en
- ///
- public string DefaultImageLanguage { get; set; }
-
- public bool HasConfig { get; private set; }
-
- ///
- /// Throw exceptions when TMDbs API returns certain errors, such as Not Found.
- ///
- public bool ThrowApiExceptions
- {
- get => _client.ThrowApiExceptions;
- set => _client.ThrowApiExceptions = value;
- }
-
- ///
- /// The maximum number of times a call to TMDb will be retried
- ///
- /// Default is 0
- public int MaxRetryCount
- {
- get => _client.MaxRetryCount;
- set => _client.MaxRetryCount = value;
- }
-
- ///
- /// The request timeout call to TMDb
- ///
- public TimeSpan RequestTimeout
- {
- get => _client.HttpClient.Timeout;
- set => _client.HttpClient.Timeout = value;
- }
-
- ///
- /// The session id that will be used when TMDb requires authentication
- ///
- /// Use 'SetSessionInformation' to assign this value
- public string SessionId { get; private set; }
-
- ///
- /// The type of the session id, this will determine the level of access that is granted on the API
- ///
- /// Use 'SetSessionInformation' to assign this value
- public SessionType SessionType { get; private set; }
-
- ///
- /// Gets or sets the Web Proxy to use during requests to TMDb API.
- ///
- ///
- /// The Web Proxy is optional. If set, every request will be sent through it.
- /// Use the constructor for setting it.
- ///
- /// For convenience, this library also offers a implementation.
- /// Check for more information.
- ///
- public IWebProxy WebProxy { get; private set; }
-
- ///
- /// Used internally to assign a session id to a request. If no valid session is found, an exception is thrown.
- ///
- /// Request
- /// The target session type to set. If set to Unassigned, the method will take the currently set session.
- /// The location of the paramter in the resulting query
- private void AddSessionId(RestRequest req, SessionType targetType = SessionType.Unassigned, ParameterType parameterType = ParameterType.QueryString)
- {
- if ((targetType == SessionType.Unassigned && SessionType == SessionType.GuestSession) ||
- (targetType == SessionType.GuestSession))
- {
- // Either
- // - We needed ANY session ID and had a Guest session id
- // - We needed a Guest session id and had it
- req.AddParameter("guest_session_id", SessionId, parameterType);
- return;
- }
-
- if ((targetType == SessionType.Unassigned && SessionType == SessionType.UserSession) ||
- (targetType == SessionType.UserSession))
- {
- // Either
- // - We needed ANY session ID and had a User session id
- // - We needed a User session id and had it
- req.AddParameter("session_id", SessionId, parameterType);
- return;
- }
-
- // We did not have the required session type ready
- throw new UserSessionRequiredException();
- }
-
- public async Task GetConfigAsync()
- {
- TMDbConfig config = await _client.Create("configuration").GetOfT(CancellationToken.None).ConfigureAwait(false);
-
- if (config == null)
- throw new Exception("Unable to retrieve configuration");
-
- // Store config
- Config = config;
- HasConfig = true;
-
- return config;
- }
-
- public Uri GetImageUrl(string size, string filePath, bool useSsl = false)
- {
- string baseUrl = useSsl ? Config.Images.SecureBaseUrl : Config.Images.BaseUrl;
- return new Uri(baseUrl + size + filePath);
- }
-
- [Obsolete("Use " + nameof(GetImageBytesAsync))]
- public Task GetImageBytes(string size, string filePath, bool useSsl = false, CancellationToken token = default)
- {
- return GetImageBytesAsync(size, filePath, useSsl, token);
- }
-
- public async Task GetImageBytesAsync(string size, string filePath, bool useSsl = false, CancellationToken token = default)
- {
- Uri url = GetImageUrl(size, filePath, useSsl);
-
- using HttpResponseMessage response = await _client.HttpClient.GetAsync(url, HttpCompletionOption.ResponseContentRead, token).ConfigureAwait(false);
- response.EnsureSuccessStatusCode();
-
- return await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false);
- }
-
- [System.Diagnostics.CodeAnalysis.SuppressMessage("IDisposableAnalyzers.Correctness", "IDISP003:Dispose previous before re-assigning.", Justification = "Only called from ctor")]
- private void Initialize(string baseUrl, bool useSsl, string apiKey)
- {
- if (string.IsNullOrWhiteSpace(baseUrl))
- throw new ArgumentException("baseUrl");
-
- if (string.IsNullOrWhiteSpace(apiKey))
- throw new ArgumentException("apiKey");
-
- ApiKey = apiKey;
-
- // Cleanup the provided url so that we don't get any issues when we are configuring the client
- if (baseUrl.StartsWith("http://", StringComparison.OrdinalIgnoreCase))
- baseUrl = baseUrl.Substring("http://".Length);
- else if (baseUrl.StartsWith("https://", StringComparison.OrdinalIgnoreCase))
- baseUrl = baseUrl.Substring("https://".Length);
-
- string httpScheme = useSsl ? "https" : "http";
-
- _client = new RestClient(new Uri(string.Format("{0}://{1}/{2}/", httpScheme, baseUrl, ApiVersion)), _serializer, WebProxy);
- _client.AddDefaultQueryString("api_key", apiKey);
- }
-
- ///
- /// Used internally to determine if the current client has the required session set, if not an appropriate exception will be thrown
- ///
- /// The type of session that is required by the calling method
- /// Thrown if the calling method requires a user session and one isn't set on the client object
- /// Thrown if the calling method requires a guest session and no session is set on the client object. (neither user or client type session)
- private void RequireSessionId(SessionType sessionType)
- {
- if (string.IsNullOrWhiteSpace(SessionId))
- {
- if (sessionType == SessionType.GuestSession)
- throw new UserSessionRequiredException();
- else
- throw new GuestSessionRequiredException();
- }
-
- if (sessionType == SessionType.UserSession && SessionType == SessionType.GuestSession)
- throw new UserSessionRequiredException();
- }
-
- public void SetConfig(TMDbConfig config)
- {
- // Store config
- Config = config;
- HasConfig = true;
- }
-
- ///
- /// Use this method to set the current client's authentication information.
- /// The session id assigned here will be used by the client when ever TMDb requires it.
- ///
- /// The session id to use when making calls that require authentication
- /// The type of session id
- ///
- /// - Use the 'AuthenticationGetUserSessionAsync' and 'AuthenticationCreateGuestSessionAsync' methods to optain the respective session ids.
- /// - User sessions have access to far for methods than guest sessions, these can currently only be used to rate media.
- ///
- public async Task SetSessionInformationAsync(string sessionId, SessionType sessionType)
- {
- ActiveAccount = null;
- SessionId = sessionId;
- if (!string.IsNullOrWhiteSpace(sessionId) && sessionType == SessionType.Unassigned)
- {
- throw new ArgumentException("When setting the session id it must always be either a guest or user session");
- }
-
- SessionType = string.IsNullOrWhiteSpace(sessionId) ? SessionType.Unassigned : sessionType;
-
- // Populate the related account information
- if (sessionType == SessionType.UserSession)
- {
- try
- {
- ActiveAccount = await AccountGetDetailsAsync().ConfigureAwait(false);
- }
- catch (Exception)
- {
- // Unable to complete the full process so reset all values and throw the exception
- ActiveAccount = null;
- SessionId = null;
- SessionType = SessionType.Unassigned;
- throw;
- }
- }
- }
-
- public virtual void Dispose()
- {
- _client?.Dispose();
- }
- }
-}
\ No newline at end of file
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientAccount.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientAccount.cs
deleted file mode 100644
index a4495ae..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientAccount.cs
+++ /dev/null
@@ -1,257 +0,0 @@
-using TMDbLib.Utilities;
-using System.Globalization;
-using System.Threading;
-using System.Threading.Tasks;
-using TMDbLib.Objects.Account;
-using TMDbLib.Objects.Authentication;
-using TMDbLib.Objects.General;
-using TMDbLib.Objects.Lists;
-using TMDbLib.Objects.Search;
-using TMDbLib.Rest;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient
- {
- private async Task> GetAccountListInternal(int page, AccountSortBy sortBy, SortOrder sortOrder, string language, AccountListsMethods method, CancellationToken cancellationToken = default)
- {
- RequireSessionId(SessionType.UserSession);
-
- RestRequest request = _client.Create("account/{accountId}/" + method.GetDescription());
- request.AddUrlSegment("accountId", ActiveAccount.Id.ToString(CultureInfo.InvariantCulture));
- AddSessionId(request, SessionType.UserSession);
-
- if (page > 1)
- request.AddParameter("page", page.ToString());
-
- if (sortBy != AccountSortBy.Undefined)
- request.AddParameter("sort_by", sortBy.GetDescription());
-
- if (sortOrder != SortOrder.Undefined)
- request.AddParameter("sort_order", sortOrder.GetDescription());
-
- language ??= DefaultLanguage;
- if (!string.IsNullOrWhiteSpace(language))
- request.AddParameter("language", language);
-
- SearchContainer response = await request.GetOfT>(cancellationToken).ConfigureAwait(false);
-
- return response;
- }
-
- ///
- /// Change the favorite status of a specific movie. Either make the movie a favorite or remove that status depending on the supplied boolean value.
- ///
- /// The type of media to influence
- /// The id of the movie/tv show to influence
- /// True if you want the specified movie to be marked as favorite, false if not
- /// Cancellation token
- /// True if the the movie's favorite status was successfully updated, false if not
- /// Requires a valid user session
- /// Thrown when the current client object doens't have a user session assigned.
- public async Task AccountChangeFavoriteStatusAsync(MediaType mediaType, int mediaId, bool isFavorite, CancellationToken cancellationToken = default)
- {
- RequireSessionId(SessionType.UserSession);
-
- RestRequest request = _client.Create("account/{accountId}/favorite");
- request.AddUrlSegment("accountId", ActiveAccount.Id.ToString(CultureInfo.InvariantCulture));
- request.SetBody(new { media_type = mediaType.GetDescription(), media_id = mediaId, favorite = isFavorite });
- AddSessionId(request, SessionType.UserSession);
-
- PostReply response = await request.PostOfT(cancellationToken).ConfigureAwait(false);
-
- // status code 1 = "Success" - Returned when adding a movie as favorite for the first time
- // status code 13 = "The item/record was deleted successfully" - When removing an item as favorite, no matter if it exists or not
- // status code 12 = "The item/record was updated successfully" - Used when an item is already marked as favorite and trying to do so doing again
- return response.StatusCode == 1 || response.StatusCode == 12 || response.StatusCode == 13;
- }
-
- ///
- /// Change the state of a specific movie on the users watchlist. Either add the movie to the list or remove it, depending on the specified boolean value.
- ///
- /// The type of media to influence
- /// The id of the movie/tv show to influence
- /// True if you want the specified movie to be part of the watchlist, false if not
- /// A cancellation token
- /// True if the the movie's status on the watchlist was successfully updated, false if not
- /// Requires a valid user session
- /// Thrown when the current client object doens't have a user session assigned.
- public async Task AccountChangeWatchlistStatusAsync(MediaType mediaType, int mediaId, bool isOnWatchlist, CancellationToken cancellationToken = default)
- {
- RequireSessionId(SessionType.UserSession);
-
- RestRequest request = _client.Create("account/{accountId}/watchlist");
- request.AddUrlSegment("accountId", ActiveAccount.Id.ToString(CultureInfo.InvariantCulture));
- request.SetBody(new { media_type = mediaType.GetDescription(), media_id = mediaId, watchlist = isOnWatchlist });
- AddSessionId(request, SessionType.UserSession);
-
- PostReply response = await request.PostOfT(cancellationToken).ConfigureAwait(false);
-
- // status code 1 = "Success"
- // status code 13 = "The item/record was deleted successfully" - When removing an item from the watchlist, no matter if it exists or not
- // status code 12 = "The item/record was updated successfully" - Used when an item is already on the watchlist and trying to add it again
- return response.StatusCode == 1 || response.StatusCode == 12 || response.StatusCode == 13;
- }
-
- ///
- /// Will retrieve the details of the account associated with the current session id
- ///
- /// Requires a valid user session
- /// Thrown when the current client object doens't have a user session assigned.
- public async Task AccountGetDetailsAsync(CancellationToken cancellationToken = default)
- {
- RequireSessionId(SessionType.UserSession);
-
- RestRequest request = _client.Create("account");
- AddSessionId(request, SessionType.UserSession);
-
- AccountDetails response = await request.GetOfT(cancellationToken).ConfigureAwait(false);
-
- return response;
- }
-
- ///
- /// Get a list of all the movies marked as favorite by the current user
- ///
- /// Requires a valid user session
- /// Thrown when the current client object doens't have a user session assigned.
- public async Task> AccountGetFavoriteMoviesAsync(
- int page = 1,
- AccountSortBy sortBy = AccountSortBy.Undefined,
- SortOrder sortOrder = SortOrder.Undefined,
- string language = null, CancellationToken cancellationToken = default)
- {
- return await GetAccountListInternal(page, sortBy, sortOrder, language, AccountListsMethods.FavoriteMovies, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Get a list of all the tv shows marked as favorite by the current user
- ///
- /// Requires a valid user session
- /// Thrown when the current client object doens't have a user session assigned.
- public async Task> AccountGetFavoriteTvAsync(
- int page = 1,
- AccountSortBy sortBy = AccountSortBy.Undefined,
- SortOrder sortOrder = SortOrder.Undefined,
- string language = null, CancellationToken cancellationToken = default)
- {
- return await GetAccountListInternal(page, sortBy, sortOrder, language, AccountListsMethods.FavoriteTv, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Retrieve all lists associated with the provided account id
- /// This can be lists that were created by the user or lists marked as favorite
- ///
- /// Requires a valid user session
- /// Thrown when the current client object doens't have a user session assigned.
- public async Task> AccountGetListsAsync(int page = 1, string language = null, CancellationToken cancellationToken = default)
- {
- RequireSessionId(SessionType.UserSession);
-
- RestRequest request = _client.Create("account/{accountId}/lists");
- request.AddUrlSegment("accountId", ActiveAccount.Id.ToString(CultureInfo.InvariantCulture));
- AddSessionId(request, SessionType.UserSession);
-
- if (page > 1)
- {
- request.AddQueryString("page", page.ToString());
- }
-
- language ??= DefaultLanguage;
- if (!string.IsNullOrWhiteSpace(language))
- request.AddQueryString("language", language);
-
- SearchContainer response = await request.GetOfT>(cancellationToken).ConfigureAwait(false);
-
- return response;
- }
-
- ///
- /// Get a list of all the movies on the current users match list
- ///
- /// Requires a valid user session
- /// Thrown when the current client object doens't have a user session assigned.
- public async Task> AccountGetMovieWatchlistAsync(
- int page = 1,
- AccountSortBy sortBy = AccountSortBy.Undefined,
- SortOrder sortOrder = SortOrder.Undefined,
- string language = null, CancellationToken cancellationToken = default)
- {
- return await GetAccountListInternal(page, sortBy, sortOrder, language, AccountListsMethods.MovieWatchlist, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Get a list of all the movies rated by the current user
- ///
- /// Requires a valid user session
- /// Thrown when the current client object doens't have a user session assigned.
- public async Task> AccountGetRatedMoviesAsync(
- int page = 1,
- AccountSortBy sortBy = AccountSortBy.Undefined,
- SortOrder sortOrder = SortOrder.Undefined,
- string language = null, CancellationToken cancellationToken = default)
- {
- return await GetAccountListInternal(page, sortBy, sortOrder, language, AccountListsMethods.RatedMovies, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Get a list of all the tv show episodes rated by the current user
- ///
- /// Requires a valid user session
- /// Thrown when the current client object doens't have a user session assigned.
- public async Task> AccountGetRatedTvShowEpisodesAsync(
- int page = 1,
- AccountSortBy sortBy = AccountSortBy.Undefined,
- SortOrder sortOrder = SortOrder.Undefined,
- string language = null, CancellationToken cancellationToken = default)
- {
- return await GetAccountListInternal(page, sortBy, sortOrder, language, AccountListsMethods.RatedTvEpisodes, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Get a list of all the tv shows rated by the current user
- ///
- /// Requires a valid user session
- /// Thrown when the current client object doens't have a user session assigned.
- public async Task> AccountGetRatedTvShowsAsync(
- int page = 1,
- AccountSortBy sortBy = AccountSortBy.Undefined,
- SortOrder sortOrder = SortOrder.Undefined,
- string language = null, CancellationToken cancellationToken = default)
- {
- return await GetAccountListInternal(page, sortBy, sortOrder, language, AccountListsMethods.RatedTv, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Get a list of all the tv shows on the current users match list
- ///
- /// Requires a valid user session
- /// Thrown when the current client object doens't have a user session assigned.
- public async Task> AccountGetTvWatchlistAsync(
- int page = 1,
- AccountSortBy sortBy = AccountSortBy.Undefined,
- SortOrder sortOrder = SortOrder.Undefined,
- string language = null, CancellationToken cancellationToken = default)
- {
- return await GetAccountListInternal(page, sortBy, sortOrder, language, AccountListsMethods.TvWatchlist, cancellationToken).ConfigureAwait(false);
- }
-
- private enum AccountListsMethods
- {
- [EnumValue("favorite/movies")]
- FavoriteMovies,
- [EnumValue("favorite/tv")]
- FavoriteTv,
- [EnumValue("rated/movies")]
- RatedMovies,
- [EnumValue("rated/tv")]
- RatedTv,
- [EnumValue("rated/tv/episodes")]
- RatedTvEpisodes,
- [EnumValue("watchlist/movies")]
- MovieWatchlist,
- [EnumValue("watchlist/tv")]
- TvWatchlist,
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientAuthentication.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientAuthentication.cs
deleted file mode 100644
index ba76409..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientAuthentication.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-using System;
-using System.Threading.Tasks;
-using System.Net;
-using System.Threading;
-using TMDbLib.Objects.Authentication;
-using TMDbLib.Rest;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient
- {
- public async Task AuthenticationCreateGuestSessionAsync(CancellationToken cancellationToken = default)
- {
- RestRequest request = _client.Create("authentication/guest_session/new");
- //{
- // DateFormat = "yyyy-MM-dd HH:mm:ss UTC"
- //};
-
- GuestSession response = await request.GetOfT(cancellationToken).ConfigureAwait(false);
-
- return response;
- }
-
- public async Task AuthenticationGetUserSessionAsync(string initialRequestToken, CancellationToken cancellationToken = default)
- {
- RestRequest request = _client.Create("authentication/session/new");
- request.AddParameter("request_token", initialRequestToken);
-
- using RestResponse response = await request.Get(cancellationToken).ConfigureAwait(false);
-
- if (response.StatusCode == HttpStatusCode.Unauthorized)
- throw new UnauthorizedAccessException();
-
- return await response.GetDataObject().ConfigureAwait(false);
- }
-
- ///
- /// Conveniance method combining 'AuthenticationRequestAutenticationTokenAsync', 'AuthenticationValidateUserTokenAsync' and 'AuthenticationGetUserSessionAsync'
- ///
- /// A valid TMDb username
- /// The passoword for the provided login
- /// A cancellation token
- public async Task AuthenticationGetUserSessionAsync(string username, string password, CancellationToken cancellationToken = default)
- {
- Token token = await AuthenticationRequestAutenticationTokenAsync(cancellationToken).ConfigureAwait(false);
- await AuthenticationValidateUserTokenAsync(token.RequestToken, username, password, cancellationToken).ConfigureAwait(false);
- return await AuthenticationGetUserSessionAsync(token.RequestToken, cancellationToken).ConfigureAwait(false);
- }
-
- public async Task AuthenticationRequestAutenticationTokenAsync(CancellationToken cancellationToken = default)
- {
- RestRequest request = _client.Create("authentication/token/new");
-
- using RestResponse response = await request.Get(cancellationToken).ConfigureAwait(false);
- Token token = await response.GetDataObject().ConfigureAwait(false);
-
- token.AuthenticationCallback = response.GetHeader("Authentication-Callback");
-
- return token;
- }
-
- public async Task AuthenticationValidateUserTokenAsync(string initialRequestToken, string username, string password, CancellationToken cancellationToken = default)
- {
- RestRequest request = _client.Create("authentication/token/validate_with_login");
- request.AddParameter("request_token", initialRequestToken);
- request.AddParameter("username", username);
- request.AddParameter("password", password);
-
- RestResponse response;
- try
- {
- response = await request.Get(cancellationToken).ConfigureAwait(false);
- }
- catch (AggregateException ex)
- {
- throw ex.InnerException;
- }
-
- using RestResponse _ = response;
-
- if (response.StatusCode == HttpStatusCode.Unauthorized)
- {
- throw new UnauthorizedAccessException("Call to TMDb returned unauthorized. Most likely the provided user credentials are invalid.");
- }
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientCertifications.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientCertifications.cs
deleted file mode 100644
index be6c5a4..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientCertifications.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System.Threading;
-using System.Threading.Tasks;
-using TMDbLib.Objects.Certifications;
-using TMDbLib.Rest;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient
- {
- public async Task GetMovieCertificationsAsync(CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("certification/movie/list");
-
- CertificationsContainer resp = await req.GetOfT(cancellationToken).ConfigureAwait(false);
-
- return resp;
- }
-
- public async Task GetTvCertificationsAsync(CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("certification/tv/list");
-
- CertificationsContainer resp = await req.GetOfT(cancellationToken).ConfigureAwait(false);
-
- return resp;
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientChanges.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientChanges.cs
deleted file mode 100644
index d638054..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientChanges.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-using TMDbLib.Objects.Changes;
-using TMDbLib.Objects.General;
-using TMDbLib.Rest;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient
- {
- private async Task GetChangesInternal(string type, int page = 0, int? id = null, DateTime? startDate = null, DateTime? endDate = null, CancellationToken cancellationToken = default)
- {
- string resource;
- if (id.HasValue)
- resource = "{type}/{id}/changes";
- else
- resource = "{type}/changes";
-
- RestRequest req = _client.Create(resource);
- req.AddUrlSegment("type", type);
-
- if (id.HasValue)
- req.AddUrlSegment("id", id.Value.ToString());
-
- if (page >= 1)
- req.AddParameter("page", page.ToString());
- if (startDate.HasValue)
- req.AddParameter("start_date", startDate.Value.ToString("yyyy-MM-dd"));
- if (endDate != null)
- req.AddParameter("end_date", endDate.Value.ToString("yyyy-MM-dd"));
-
- using RestResponse resp = await req.Get(cancellationToken).ConfigureAwait(false);
- T res = await resp.GetDataObject().ConfigureAwait(false);
-
- if (res is SearchContainer asSearch)
- {
- // https://github.com/LordMike/TMDbLib/issues/296
- asSearch.Results.RemoveAll(s => s.Id == 0);
- }
-
- return res;
- }
-
- ///
- /// Get a list of movie ids that have been edited.
- /// By default we show the last 24 hours and only 100 items per page.
- /// The maximum number of days that can be returned in a single request is 14.
- /// You can then use the movie changes API to get the actual data that has been changed. (.GetMovieChangesAsync)
- ///
- /// the change log system to support this was changed on October 5, 2012 and will only show movies that have been edited since.
- public async Task> GetMoviesChangesAsync(int page = 0, DateTime? startDate = null, DateTime? endDate = null, CancellationToken cancellationToken = default)
- {
- return await GetChangesInternal>("movie", page, startDate: startDate, endDate: endDate, cancellationToken: cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Get a list of people ids that have been edited.
- /// By default we show the last 24 hours and only 100 items per page.
- /// The maximum number of days that can be returned in a single request is 14.
- /// You can then use the person changes API to get the actual data that has been changed.(.GetPersonChangesAsync)
- ///
- /// the change log system to support this was changed on October 5, 2012 and will only show people that have been edited since.
- public async Task> GetPeopleChangesAsync(int page = 0, DateTime? startDate = null, DateTime? endDate = null, CancellationToken cancellationToken = default)
- {
- return await GetChangesInternal>("person", page, startDate: startDate, endDate: endDate, cancellationToken: cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Get a list of TV show ids that have been edited.
- /// By default we show the last 24 hours and only 100 items per page.
- /// The maximum number of days that can be returned in a single request is 14.
- /// You can then use the TV changes API to get the actual data that has been changed. (.GetTvShowChangesAsync)
- ///
- ///
- /// the change log system to properly support TV was updated on May 13, 2014.
- /// You'll likely only find the edits made since then to be useful in the change log system.
- ///
- public async Task> GetTvChangesAsync(int page = 0, DateTime? startDate = null, DateTime? endDate = null, CancellationToken cancellationToken = default)
- {
- return await GetChangesInternal>("tv", page, startDate: startDate, endDate: endDate, cancellationToken: cancellationToken).ConfigureAwait(false);
- }
-
- public async Task> GetMovieChangesAsync(int movieId, int page = 0, DateTime? startDate = null, DateTime? endDate = null, CancellationToken cancellationToken = default)
- {
- ChangesContainer changesContainer = await GetChangesInternal("movie", page, movieId, startDate, endDate, cancellationToken).ConfigureAwait(false);
- return changesContainer.Changes;
- }
-
- public async Task> GetPersonChangesAsync(int personId, int page = 0, DateTime? startDate = null, DateTime? endDate = null, CancellationToken cancellationToken = default)
- {
- ChangesContainer changesContainer = await GetChangesInternal("person", page, personId, startDate, endDate, cancellationToken).ConfigureAwait(false);
- return changesContainer.Changes;
- }
-
- public async Task> GetTvSeasonChangesAsync(int seasonId, int page = 0, DateTime? startDate = null, DateTime? endDate = null, CancellationToken cancellationToken = default)
- {
- ChangesContainer changesContainer = await GetChangesInternal("tv/season", page, seasonId, startDate, endDate, cancellationToken).ConfigureAwait(false);
- return changesContainer.Changes;
- }
-
- public async Task> GetTvEpisodeChangesAsync(int episodeId, int page = 0, DateTime? startDate = null, DateTime? endDate = null, CancellationToken cancellationToken = default)
- {
- ChangesContainer changesContainer = await GetChangesInternal("tv/episode", page, episodeId, startDate, endDate, cancellationToken).ConfigureAwait(false);
- return changesContainer.Changes;
- }
- }
-}
\ No newline at end of file
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientCollections.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientCollections.cs
deleted file mode 100644
index 8710452..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientCollections.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-using System;
-using System.Linq;
-using System.Net;
-using System.Threading;
-using System.Threading.Tasks;
-using TMDbLib.Objects.Collections;
-using TMDbLib.Objects.General;
-using TMDbLib.Rest;
-using TMDbLib.Utilities;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient
- {
- private async Task GetCollectionMethodInternal(int collectionId, CollectionMethods collectionMethod, string language = null, CancellationToken cancellationToken = default) where T : new()
- {
- RestRequest req = _client.Create("collection/{collectionId}/{method}");
- req.AddUrlSegment("collectionId", collectionId.ToString());
- req.AddUrlSegment("method", collectionMethod.GetDescription());
-
- if (language != null)
- req.AddParameter("language", language);
-
- T resp = await req.GetOfT(cancellationToken).ConfigureAwait(false);
-
- return resp;
- }
-
- public async Task GetCollectionAsync(int collectionId, CollectionMethods extraMethods = CollectionMethods.Undefined, CancellationToken cancellationToken = default)
- {
- return await GetCollectionAsync(collectionId, DefaultLanguage, null, extraMethods, cancellationToken).ConfigureAwait(false);
- }
-
- public async Task GetCollectionAsync(int collectionId, string language, string includeImageLanguages, CollectionMethods extraMethods = CollectionMethods.Undefined, CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("collection/{collectionId}");
- req.AddUrlSegment("collectionId", collectionId.ToString());
-
- language ??= DefaultLanguage;
- if (!string.IsNullOrWhiteSpace(language))
- req.AddParameter("language", language);
-
- includeImageLanguages ??= DefaultImageLanguage;
- if (!string.IsNullOrWhiteSpace(includeImageLanguages))
- req.AddParameter("include_image_language", includeImageLanguages);
-
- string appends = string.Join(",",
- Enum.GetValues(typeof(CollectionMethods))
- .OfType()
- .Except(new[] { CollectionMethods.Undefined })
- .Where(s => extraMethods.HasFlag(s))
- .Select(s => s.GetDescription()));
-
- if (appends != string.Empty)
- req.AddParameter("append_to_response", appends);
-
- //req.DateFormat = "yyyy-MM-dd";
-
- using RestResponse response = await req.Get(cancellationToken).ConfigureAwait(false);
-
- if (!response.IsValid)
- return null;
-
- Collection item = await response.GetDataObject().ConfigureAwait(false);
-
- if (item != null)
- item.Overview = WebUtility.HtmlDecode(item.Overview);
-
- return item;
- }
-
- public async Task GetCollectionImagesAsync(int collectionId, string language = null, CancellationToken cancellationToken = default)
- {
- return await GetCollectionMethodInternal(collectionId, CollectionMethods.Images, language, cancellationToken).ConfigureAwait(false);
- }
- }
-}
\ No newline at end of file
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientCompanies.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientCompanies.cs
deleted file mode 100644
index ef334c3..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientCompanies.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using System;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using TMDbLib.Objects.Companies;
-using TMDbLib.Objects.General;
-using TMDbLib.Objects.Search;
-using TMDbLib.Rest;
-using TMDbLib.Utilities;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient
- {
- private async Task GetCompanyMethodInternal(int companyId, CompanyMethods companyMethod, int page = 0, string language = null, CancellationToken cancellationToken = default) where T : new()
- {
- RestRequest req = _client.Create("company/{companyId}/{method}");
- req.AddUrlSegment("companyId", companyId.ToString());
- req.AddUrlSegment("method", companyMethod.GetDescription());
-
- if (page >= 1)
- req.AddParameter("page", page.ToString());
-
- language ??= DefaultLanguage;
- if (!string.IsNullOrWhiteSpace(language))
- req.AddParameter("language", language);
-
- T resp = await req.GetOfT(cancellationToken).ConfigureAwait(false);
-
- return resp;
- }
-
- public async Task GetCompanyAsync(int companyId, CompanyMethods extraMethods = CompanyMethods.Undefined, CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("company/{companyId}");
- req.AddUrlSegment("companyId", companyId.ToString());
-
- string appends = string.Join(",",
- Enum.GetValues(typeof(CompanyMethods))
- .OfType()
- .Except(new[] { CompanyMethods.Undefined })
- .Where(s => extraMethods.HasFlag(s))
- .Select(s => s.GetDescription()));
-
- if (appends != string.Empty)
- req.AddParameter("append_to_response", appends);
-
- //req.DateFormat = "yyyy-MM-dd";
-
- Company resp = await req.GetOfT(cancellationToken).ConfigureAwait(false);
-
- return resp;
- }
-
- public async Task> GetCompanyMoviesAsync(int companyId, int page = 0, CancellationToken cancellationToken = default)
- {
- return await GetCompanyMoviesAsync(companyId, DefaultLanguage, page, cancellationToken).ConfigureAwait(false);
- }
-
- public async Task> GetCompanyMoviesAsync(int companyId, string language, int page = 0, CancellationToken cancellationToken = default)
- {
- return await GetCompanyMethodInternal>(companyId, CompanyMethods.Movies, page, language, cancellationToken).ConfigureAwait(false);
- }
- }
-}
\ No newline at end of file
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientConfiguration.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientConfiguration.cs
deleted file mode 100644
index 3511138..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientConfiguration.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using TMDbLib.Objects.Configuration;
-using TMDbLib.Objects.Countries;
-using TMDbLib.Objects.General;
-using TMDbLib.Objects.Languages;
-using TMDbLib.Objects.Timezones;
-using TMDbLib.Rest;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient
- {
- public async Task GetAPIConfiguration(CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("configuration");
-
- using RestResponse response = await req.Get(cancellationToken).ConfigureAwait(false);
-
- return (await response.GetDataObject().ConfigureAwait(false));
- }
-
- public async Task> GetCountriesAsync(CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("configuration/countries");
-
- using RestResponse> response = await req.Get>(cancellationToken).ConfigureAwait(false);
-
- return await response.GetDataObject().ConfigureAwait(false);
- }
-
- public async Task> GetLanguagesAsync(CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("configuration/languages");
-
- using RestResponse> response = await req.Get>(cancellationToken).ConfigureAwait(false);
-
- return (await response.GetDataObject().ConfigureAwait(false));
- }
-
- public async Task> GetPrimaryTranslationsAsync(CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("configuration/primary_translations");
-
- using RestResponse> response = await req.Get>(cancellationToken).ConfigureAwait(false);
-
- return (await response.GetDataObject().ConfigureAwait(false));
- }
-
- public async Task GetTimezonesAsync(CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("timezones/list");
-
- using RestResponse>>> resp = await req.Get>>>(cancellationToken).ConfigureAwait(false);
-
- List>> item = await resp.GetDataObject().ConfigureAwait(false);
-
- if (item == null)
- return null;
-
- Timezones result = new Timezones();
- result.List = new Dictionary>();
-
- foreach (Dictionary> dictionary in item)
- {
- KeyValuePair> item1 = dictionary.First();
-
- result.List[item1.Key] = item1.Value;
- }
-
- return result;
- }
-
- ///
- /// Retrieves a list of departments and positions within
- ///
- /// Valid jobs and their departments
- public async Task> GetJobsAsync(CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("configuration/jobs");
-
- using RestResponse> response = await req.Get>(cancellationToken).ConfigureAwait(false);
-
- return (await response.GetDataObject().ConfigureAwait(false));
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientCredit.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientCredit.cs
deleted file mode 100644
index 15dfe82..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientCredit.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System.Threading;
-using System.Threading.Tasks;
-using TMDbLib.Objects.Credit;
-using TMDbLib.Rest;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient
- {
- public async Task GetCreditsAsync(string id, CancellationToken cancellationToken = default)
- {
- return await GetCreditsAsync(id, DefaultLanguage, cancellationToken).ConfigureAwait(false);
- }
-
- public async Task GetCreditsAsync(string id, string language, CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("credit/{id}");
-
- if (!string.IsNullOrEmpty(language))
- req.AddParameter("language", language);
-
- req.AddUrlSegment("id", id);
-
- Credit resp = await req.GetOfT(cancellationToken).ConfigureAwait(false);
-
- return resp;
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientDiscover.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientDiscover.cs
deleted file mode 100644
index 8d22b8f..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientDiscover.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-using TMDbLib.Objects.Discover;
-using TMDbLib.Objects.General;
-using TMDbLib.Rest;
-using TMDbLib.Utilities;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient
- {
- ///
- /// Can be used to discover movies matching certain criteria
- ///
- public DiscoverMovie DiscoverMoviesAsync()
- {
- return new DiscoverMovie(this);
- }
-
- internal async Task> DiscoverPerformAsync(string endpoint, string language, int page, SimpleNamedValueCollection parameters, CancellationToken cancellationToken = default)
- {
- RestRequest request = _client.Create(endpoint);
-
- if (page != 1 && page > 1)
- request.AddParameter("page", page.ToString());
-
- if (!string.IsNullOrWhiteSpace(language))
- request.AddParameter("language", language);
-
- foreach (KeyValuePair pair in parameters)
- request.AddParameter(pair.Key, pair.Value);
-
- SearchContainer response = await request.GetOfT>(cancellationToken).ConfigureAwait(false);
- return response;
- }
-
- ///
- /// Can be used to discover new tv shows matching certain criteria
- ///
- public DiscoverTv DiscoverTvShowsAsync()
- {
- return new DiscoverTv(this);
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientFind.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientFind.cs
deleted file mode 100644
index 468b60b..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientFind.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using System.Net;
-using System.Threading;
-using System.Threading.Tasks;
-using TMDbLib.Objects.Find;
-using TMDbLib.Rest;
-using TMDbLib.Utilities;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient
- {
- ///
- /// FindAsync movies, people and tv shows by an external id.
- /// The following types can be found based on the specified external id's
- /// - Movies: Imdb
- /// - People: Imdb, FreeBaseMid, FreeBaseId, TvRage
- /// - TV Series: Imdb, FreeBaseMid, FreeBaseId, TvRage, TvDb
- ///
- /// The source the specified id belongs to
- /// The id of the object you wish to located
- /// A list of all objects in TMDb that matched your id
- /// A cancellation token
- public Task FindAsync(FindExternalSource source, string id, CancellationToken cancellationToken = default)
- {
- return FindAsync(source, id, null, cancellationToken);
- }
-
- ///
- /// FindAsync movies, people and tv shows by an external id.
- /// The following types can be found based on the specified external id's
- /// - Movies: Imdb
- /// - People: Imdb, FreeBaseMid, FreeBaseId, TvRage
- /// - TV Series: Imdb, FreeBaseMid, FreeBaseId, TvRage, TvDb
- ///
- /// The source the specified id belongs to
- /// The id of the object you wish to located
- /// A list of all objects in TMDb that matched your id
- /// If specified the api will attempt to return a localized result. ex: en,it,es.
- /// A cancellation token
- public async Task FindAsync(FindExternalSource source, string id, string language, CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("find/{id}");
-
- req.AddUrlSegment("id", WebUtility.UrlEncode(id));
- req.AddParameter("external_source", source.GetDescription());
-
- language ??= DefaultLanguage;
- if (!string.IsNullOrEmpty(language))
- req.AddParameter("language", language);
-
- FindContainer resp = await req.GetOfT(cancellationToken).ConfigureAwait(false);
-
- return resp;
- }
- }
-}
\ No newline at end of file
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientGenres.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientGenres.cs
deleted file mode 100644
index 729df15..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientGenres.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-using TMDbLib.Objects.General;
-using TMDbLib.Objects.Genres;
-using TMDbLib.Objects.Search;
-using TMDbLib.Rest;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient
- {
- [Obsolete("GetGenreMovies is deprecated, use DiscoverMovies instead")]
- public async Task> GetGenreMoviesAsync(int genreId, int page = 0, bool? includeAllMovies = null, CancellationToken cancellationToken = default)
- {
- return await GetGenreMoviesAsync(genreId, DefaultLanguage, page, includeAllMovies, cancellationToken).ConfigureAwait(false);
- }
-
- [Obsolete("GetGenreMovies is deprecated, use DiscoverMovies instead")]
- public async Task> GetGenreMoviesAsync(int genreId, string language, int page = 0, bool? includeAllMovies = null, CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("genre/{genreId}/movies");
- req.AddUrlSegment("genreId", genreId.ToString());
-
- language ??= DefaultLanguage;
- if (!string.IsNullOrWhiteSpace(language))
- req.AddParameter("language", language);
-
- if (page >= 1)
- req.AddParameter("page", page.ToString());
- if (includeAllMovies.HasValue)
- req.AddParameter("include_all_movies", includeAllMovies.Value ? "true" : "false");
-
- SearchContainerWithId resp = await req.GetOfT>(cancellationToken).ConfigureAwait(false);
-
- return resp;
- }
-
- public async Task> GetMovieGenresAsync(CancellationToken cancellationToken = default)
- {
- return await GetMovieGenresAsync(DefaultLanguage, cancellationToken).ConfigureAwait(false);
- }
-
- public async Task> GetMovieGenresAsync(string language, CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("genre/movie/list");
-
- language ??= DefaultLanguage;
- if (!string.IsNullOrWhiteSpace(language))
- req.AddParameter("language", language);
-
- using RestResponse resp = await req.Get(cancellationToken).ConfigureAwait(false);
-
- return (await resp.GetDataObject().ConfigureAwait(false)).Genres;
- }
-
- public async Task> GetTvGenresAsync(CancellationToken cancellationToken = default)
- {
- return await GetTvGenresAsync(DefaultLanguage, cancellationToken).ConfigureAwait(false);
- }
-
- public async Task> GetTvGenresAsync(string language, CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("genre/tv/list");
-
- language ??= DefaultLanguage;
- if (!string.IsNullOrWhiteSpace(language))
- req.AddParameter("language", language);
-
- using RestResponse resp = await req.Get(cancellationToken).ConfigureAwait(false);
-
- return (await resp.GetDataObject().ConfigureAwait(false)).Genres;
- }
- }
-}
\ No newline at end of file
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientGuestSessions.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientGuestSessions.cs
deleted file mode 100644
index 420e264..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientGuestSessions.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-using System.Threading;
-using System.Threading.Tasks;
-using TMDbLib.Objects.Authentication;
-using TMDbLib.Objects.General;
-using TMDbLib.Objects.Search;
-using TMDbLib.Objects.TvShows;
-using TMDbLib.Rest;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient
- {
- public async Task> GetGuestSessionRatedMoviesAsync(int page = 0, CancellationToken cancellationToken = default)
- {
- return await GetGuestSessionRatedMoviesAsync(DefaultLanguage, page, cancellationToken).ConfigureAwait(false);
- }
-
- public async Task> GetGuestSessionRatedMoviesAsync(string language, int page = 0, CancellationToken cancellationToken = default)
- {
- RequireSessionId(SessionType.GuestSession);
-
- RestRequest request = _client.Create("guest_session/{guest_session_id}/rated/movies");
-
- if (page > 0)
- request.AddParameter("page", page.ToString());
-
- if (!string.IsNullOrEmpty(language))
- request.AddParameter("language", language);
-
- AddSessionId(request, SessionType.GuestSession, ParameterType.UrlSegment);
-
- SearchContainer resp = await request.GetOfT>(cancellationToken).ConfigureAwait(false);
-
- return resp;
- }
-
- public async Task> GetGuestSessionRatedTvAsync(int page = 0, CancellationToken cancellationToken = default)
- {
- return await GetGuestSessionRatedTvAsync(DefaultLanguage, page, cancellationToken).ConfigureAwait(false);
- }
-
- public async Task> GetGuestSessionRatedTvAsync(string language, int page = 0, CancellationToken cancellationToken = default)
- {
- RequireSessionId(SessionType.GuestSession);
-
- RestRequest request = _client.Create("guest_session/{guest_session_id}/rated/tv");
-
- if (page > 0)
- request.AddParameter("page", page.ToString());
-
- if (!string.IsNullOrEmpty(language))
- request.AddParameter("language", language);
-
- AddSessionId(request, SessionType.GuestSession, ParameterType.UrlSegment);
-
- SearchContainer resp = await request.GetOfT>(cancellationToken).ConfigureAwait(false);
-
- return resp;
- }
-
- public async Task> GetGuestSessionRatedTvEpisodesAsync(int page = 0, CancellationToken cancellationToken = default)
- {
- return await GetGuestSessionRatedTvEpisodesAsync(DefaultLanguage, page, cancellationToken).ConfigureAwait(false);
- }
-
- public async Task> GetGuestSessionRatedTvEpisodesAsync(string language, int page = 0, CancellationToken cancellationToken = default)
- {
- RequireSessionId(SessionType.GuestSession);
-
- RestRequest request = _client.Create("guest_session/{guest_session_id}/rated/tv/episodes");
-
- if (page > 0)
- request.AddParameter("page", page.ToString());
-
- if (!string.IsNullOrEmpty(language))
- request.AddParameter("language", language);
-
- AddSessionId(request, SessionType.GuestSession, ParameterType.UrlSegment);
-
- SearchContainer resp = await request.GetOfT>(cancellationToken).ConfigureAwait(false);
-
- return resp;
- }
- }
-}
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientKeywords.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientKeywords.cs
deleted file mode 100644
index 1991223..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientKeywords.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System.Threading;
-using System.Threading.Tasks;
-using TMDbLib.Objects.General;
-using TMDbLib.Objects.Search;
-using TMDbLib.Rest;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient
- {
- public async Task GetKeywordAsync(int keywordId, CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("keyword/{keywordId}");
- req.AddUrlSegment("keywordId", keywordId.ToString());
-
- Keyword resp = await req.GetOfT(cancellationToken).ConfigureAwait(false);
-
- return resp;
- }
-
- public async Task> GetKeywordMoviesAsync(int keywordId, int page = 0, CancellationToken cancellationToken = default)
- {
- return await GetKeywordMoviesAsync(keywordId, DefaultLanguage, page, cancellationToken).ConfigureAwait(false);
- }
-
- public async Task> GetKeywordMoviesAsync(int keywordId, string language, int page = 0, CancellationToken cancellationToken = default)
- {
- RestRequest req = _client.Create("keyword/{keywordId}/movies");
- req.AddUrlSegment("keywordId", keywordId.ToString());
-
- language ??= DefaultLanguage;
- if (!string.IsNullOrWhiteSpace(language))
- req.AddParameter("language", language);
-
- if (page >= 1)
- req.AddParameter("page", page.ToString());
-
- SearchContainerWithId resp = await req.GetOfT>(cancellationToken).ConfigureAwait(false);
-
- return resp;
- }
- }
-}
\ No newline at end of file
diff --git a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientLists.cs b/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientLists.cs
deleted file mode 100644
index baa6e6b..0000000
--- a/Jellyfin.Plugin.MetaShark/Vendor/TMDbLib/Client/TMDbClientLists.cs
+++ /dev/null
@@ -1,210 +0,0 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using TMDbLib.Objects.Authentication;
-using TMDbLib.Objects.General;
-using TMDbLib.Objects.Lists;
-using TMDbLib.Rest;
-
-namespace TMDbLib.Client
-{
- public partial class TMDbClient
- {
- private async Task GetManipulateMediaListAsyncInternal(string listId, int movieId, string method, CancellationToken cancellationToken = default)
- {
- RequireSessionId(SessionType.UserSession);
-
- if (string.IsNullOrWhiteSpace(listId))
- throw new ArgumentNullException(nameof(listId));
-
- // Movie Id is expected by the API and can not be null
- if (movieId <= 0)
- throw new ArgumentOutOfRangeException(nameof(movieId));
-
- RestRequest req = _client.Create("list/{listId}/{method}");
- req.AddUrlSegment("listId", listId);
- req.AddUrlSegment("method", method);
- AddSessionId(req, SessionType.UserSession);
-
- req.SetBody(new { media_id = movieId });
-
- using RestResponse response = await req.Post(cancellationToken).ConfigureAwait(false);
-
- // Status code 12 = "The item/record was updated successfully"
- // Status code 13 = "The item/record was deleted successfully"
- PostReply item = await response.GetDataObject().ConfigureAwait(false);
-
- // TODO: Previous code checked for item=null
- return item.StatusCode == 12 || item.StatusCode == 13;
- }
-
- ///
- /// Retrieve a list by it's id
- ///
- /// The id of the list you want to retrieve
- /// If specified the api will attempt to return a localized result. ex: en,it,es
- /// A cancellation token
- public async Task GetListAsync(string listId, string language = null, CancellationToken cancellationToken = default)
- {
- if (string.IsNullOrWhiteSpace(listId))
- throw new ArgumentNullException(nameof(listId));
-
- RestRequest req = _client.Create("list/{listId}");
- req.AddUrlSegment("listId", listId);
-
- language ??= DefaultLanguage;
- if (!string.IsNullOrWhiteSpace(language))
- req.AddParameter("language", language);
-
- GenericList resp = await req.GetOfT(cancellationToken).ConfigureAwait(false);
-
- return resp;
- }
-
- ///
- /// Will check if the provided movie id is present in the specified list
- ///
- /// Id of the list to check in
- /// Id of the movie to check for in the list
- /// A cancellation token
- public async Task GetListIsMoviePresentAsync(string listId, int movieId, CancellationToken cancellationToken = default)
- {
- if (string.IsNullOrWhiteSpace(listId))
- throw new ArgumentNullException(nameof(listId));
-
- if (movieId <= 0)
- throw new ArgumentOutOfRangeException(nameof(movieId));
-
- RestRequest req = _client.Create("list/{listId}/item_status");
- req.AddUrlSegment("listId", listId);
- req.AddParameter("movie_id", movieId.ToString());
-
- using RestResponse