mirror of
https://github.com/jellyfin/jellyfin-plugin-anidb.git
synced 2024-11-23 05:49:41 +00:00
Merge pull request #32 from Matt07211/standardized
Standardized and QOL Imporvements
This commit is contained in:
commit
a9e750952f
15
CONTRIBUTORS.md
Normal file
15
CONTRIBUTORS.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Jellyfin Contributors
|
||||
|
||||
- [JoshuaBoniface](https://github.com/joshuaboniface)
|
||||
- [Matt07211](https://github.com/Matt07211)
|
||||
- [hawken93](https://github.com/hawken93)
|
||||
- [dkanada](https://github.com/dkanada)
|
||||
- [StillLoading](https://github.com/StillLoading)
|
||||
|
||||
# Emby Contributors
|
||||
|
||||
- [LukePulverenti](https://github.com/LukePulverenti)
|
||||
- [TomGillen](https://github.com/TomGillen)
|
||||
- [DaniGTA](https://github.com/DaniGTA)
|
||||
- [mtlott](https://github.com/mtlott)
|
||||
- [mcd1992](https://github.com/mcd1992)
|
@ -21,8 +21,7 @@ namespace Jellyfin.Plugin.Anime.Configuration
|
||||
|
||||
}
|
||||
|
||||
public class PluginConfiguration
|
||||
: BasePluginConfiguration
|
||||
public class PluginConfiguration : BasePluginConfiguration
|
||||
{
|
||||
public TitlePreferenceType TitlePreference { get; set; }
|
||||
public bool TidyGenreList { get; set; }
|
||||
|
@ -61,7 +61,7 @@
|
||||
loadConfiguration: function() {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getPluginConfiguration(AnimeConfigurationPage.pluginUniqueId).then(function (config) {
|
||||
ApiClient.getPluginConfiguration(animeConfigurationPage.pluginUniqueId).then(function (config) {
|
||||
var page = $.mobile.activePage;
|
||||
|
||||
$('#titleLanguage', page).val(config.TitlePreference).change();
|
||||
|
@ -2,10 +2,15 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<RootNamespace>Jellyfin.Plugin.Anime</RootNamespace>
|
||||
<AssemblyVersion>1.0.0</AssemblyVersion>
|
||||
<FileVersion>1.0.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Jellyfin.Controller" Version="10.2.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Configuration\configPage.html" />
|
||||
</ItemGroup>
|
||||
@ -14,8 +19,4 @@
|
||||
<EmbeddedResource Include="Configuration\configPage.html" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Jellyfin.Controller" Version="10.2.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -1,18 +1,19 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Jellyfin.Plugin.Anime.Configuration;
|
||||
using Jellyfin.Plugin.Anime.Providers.AniDB.Identity;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Model.Plugins;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using Jellyfin.Plugin.Anime.Configuration;
|
||||
using Jellyfin.Plugin.Anime.Providers.AniDB.Identity;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime
|
||||
{
|
||||
public class Plugin
|
||||
: BasePlugin<PluginConfiguration>, IHasWebPages
|
||||
public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
|
||||
{
|
||||
public override string Name => "Anime";
|
||||
public override Guid Id => Guid.Parse("a4df60c5-6ab4-412a-8f79-2cab93fb2bc5");
|
||||
public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer, ILogger logger) : base(applicationPaths, xmlSerializer)
|
||||
{
|
||||
Instance = this;
|
||||
@ -20,11 +21,6 @@ namespace Jellyfin.Plugin.Anime
|
||||
AniDbTitleMatcher.DefaultInstance = new AniDbTitleMatcher(logger, new AniDbTitleDownloader(logger, applicationPaths));
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Anime"; }
|
||||
}
|
||||
|
||||
public static Plugin Instance { get; private set; }
|
||||
|
||||
public IEnumerable<PluginPageInfo> GetPages()
|
||||
@ -33,17 +29,10 @@ namespace Jellyfin.Plugin.Anime
|
||||
{
|
||||
new PluginPageInfo
|
||||
{
|
||||
Name = "anime",
|
||||
EmbeddedResourcePath = "Jellyfin.Plugin.Anime.Configuration.configPage.html"
|
||||
Name = this.Name,
|
||||
EmbeddedResourcePath = string.Format("{0}.Configuration.configPage.html", GetType().Namespace)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private Guid _id = new Guid("a4df60c5-6ab4-412a-8f79-2cab93fb2bc5");
|
||||
|
||||
public override Guid Id
|
||||
{
|
||||
get { return _id; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
using AnimeLists;
|
||||
using System.IO;
|
||||
using AnimeLists;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using System.IO;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers.AniDB.Converter
|
||||
{
|
||||
|
@ -1,12 +1,12 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using Jellyfin.Plugin.Anime.Providers.AniDB.Metadata;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Plugin.Anime.Providers.AniDB.Metadata;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers.AniDB.Identity
|
||||
{
|
||||
|
@ -1,5 +1,4 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@ -7,6 +6,7 @@ using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers.AniDB.Identity
|
||||
{
|
||||
|
@ -1,14 +1,14 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers.AniDB.Metadata
|
||||
{
|
||||
|
@ -1,14 +1,14 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers.AniDB.Metadata
|
||||
{
|
||||
|
@ -1,12 +1,12 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers.AniDB.Metadata
|
||||
{
|
||||
|
@ -1,16 +1,16 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers.AniDB.Metadata
|
||||
{
|
||||
|
@ -1,13 +1,4 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Jellyfin.Plugin.Anime.Configuration;
|
||||
using Jellyfin.Plugin.Anime.Providers.AniDB.Identity;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
@ -20,6 +11,15 @@ using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Jellyfin.Plugin.Anime.Configuration;
|
||||
using Jellyfin.Plugin.Anime.Providers.AniDB.Identity;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers.AniDB.Metadata
|
||||
{
|
||||
|
@ -1,4 +1,10 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Plugin.Anime.Providers.AniList;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
@ -6,13 +12,7 @@ using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using Jellyfin.Plugin.Anime.Providers.AniList;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
//API v2
|
||||
namespace Jellyfin.Plugin.Anime.Providers.AniList
|
||||
|
@ -1,15 +1,15 @@
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Jellyfin.Plugin.Anime.Configuration;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Plugin.Anime.Configuration;
|
||||
using Jellyfin.Plugin.Anime.Providers.AniList;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers.AniList
|
||||
{
|
||||
|
@ -1,4 +1,9 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
@ -6,11 +11,6 @@ using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers.AniSearch
|
||||
{
|
||||
|
@ -1,12 +1,12 @@
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Jellyfin.Plugin.Anime.Configuration;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Plugin.Anime.Configuration;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers.AniSearch
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using Jellyfin.Plugin.Anime.Configuration;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Jellyfin.Plugin.Anime.Configuration;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers
|
||||
{
|
||||
|
@ -1,4 +1,9 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
@ -6,11 +11,6 @@ using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers.Proxer
|
||||
{
|
||||
|
@ -1,12 +1,12 @@
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Jellyfin.Plugin.Anime.Configuration;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Jellyfin.Plugin.Anime.Configuration;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers.Proxer
|
||||
{
|
||||
|
@ -1,6 +1,4 @@
|
||||
using Jellyfin.Plugin.Anime.Providers.AniDB.Identity;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@ -8,6 +6,8 @@ using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using Jellyfin.Plugin.Anime.Providers.AniDB.Identity;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Plugin.Anime.Providers
|
||||
{
|
||||
|
@ -1,88 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AnimeLists
|
||||
{
|
||||
public class AsyncSemaphore
|
||||
{
|
||||
private static readonly Task Completed = Task.FromResult(true);
|
||||
private readonly Queue<TaskCompletionSource<bool>> _waiters = new Queue<TaskCompletionSource<bool>>();
|
||||
private int _currentCount;
|
||||
|
||||
public AsyncSemaphore(int initialCount)
|
||||
{
|
||||
if (initialCount < 0) throw new ArgumentOutOfRangeException("initialCount");
|
||||
_currentCount = initialCount;
|
||||
}
|
||||
|
||||
public Task WaitAsync()
|
||||
{
|
||||
lock (_waiters)
|
||||
{
|
||||
if (_currentCount > 0)
|
||||
{
|
||||
--_currentCount;
|
||||
return Completed;
|
||||
}
|
||||
|
||||
var waiter = new TaskCompletionSource<bool>();
|
||||
_waiters.Enqueue(waiter);
|
||||
return waiter.Task;
|
||||
}
|
||||
}
|
||||
|
||||
public void Release()
|
||||
{
|
||||
TaskCompletionSource<bool> toRelease = null;
|
||||
lock (_waiters)
|
||||
{
|
||||
if (_waiters.Count > 0)
|
||||
toRelease = _waiters.Dequeue();
|
||||
else
|
||||
++_currentCount;
|
||||
}
|
||||
if (toRelease != null)
|
||||
toRelease.SetResult(true);
|
||||
}
|
||||
}
|
||||
|
||||
public class AsyncLock
|
||||
{
|
||||
private readonly Task<Releaser> _releaser;
|
||||
private readonly AsyncSemaphore _semaphore;
|
||||
|
||||
public AsyncLock()
|
||||
{
|
||||
_semaphore = new AsyncSemaphore(1);
|
||||
_releaser = Task.FromResult(new Releaser(this));
|
||||
}
|
||||
|
||||
public Task<Releaser> LockAsync()
|
||||
{
|
||||
Task wait = _semaphore.WaitAsync();
|
||||
return wait.IsCompleted
|
||||
? _releaser
|
||||
: wait.ContinueWith((_, state) => new Releaser((AsyncLock)state),
|
||||
this, CancellationToken.None,
|
||||
TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
|
||||
}
|
||||
|
||||
public struct Releaser : IDisposable
|
||||
{
|
||||
private readonly AsyncLock _toRelease;
|
||||
|
||||
internal Releaser(AsyncLock toRelease)
|
||||
{
|
||||
_toRelease = toRelease;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_toRelease != null)
|
||||
_toRelease._semaphore.Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@ using System.IO;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
using Jellyfin.Plugin.Anime;
|
||||
|
||||
namespace AnimeLists
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user