-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from insomniachi/anime_plugin_improvements
plugin improvements
- Loading branch information
Showing
122 changed files
with
1,480 additions
and
1,388 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-512 Bytes
(93%)
Plugins Store/Totoro.Plugins.MediaDetection.Win11MediaPlayer.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,29 @@ | ||
using Totoro.Plugins.Anime.Models; | ||
using System.ComponentModel; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Runtime.Serialization; | ||
using Totoro.Plugins.Anime.Models; | ||
using Totoro.Plugins.Options; | ||
|
||
namespace Totoro.Plugins.Anime.AllAnime; | ||
|
||
internal static class Config | ||
public class Config : AnimeProviderConfigObject | ||
{ | ||
public static string Url { get; set; } = "https://allanime.to/"; | ||
public static StreamType StreamType { get; set; } = StreamType.EnglishSubbed; | ||
public static string CountryOfOrigin { get; set; } = "JP"; | ||
public static string Api = "https://api.allanime.day/api"; | ||
[Description("Url to home page")] | ||
[Glyph(Glyphs.Url)] | ||
public string Url { get; set; } = "https://allanime.to/"; | ||
|
||
[DisplayName("Stream Type")] | ||
[Description("Choose what to play by default, sub/dub")] | ||
[AllowedValues(@"English Subbed", @"English Dubbed", @"Raw")] | ||
[Glyph(Glyphs.StreamType)] | ||
public StreamType StreamType { get; set; } = StreamType.Subbed(Languages.English); | ||
|
||
[DisplayName("Country Of Origin")] | ||
[Description("Filter anime by country")] | ||
[AllowedValues("ALL", "JP", "CN", "KR")] | ||
[Glyph("\uF2B7")] | ||
public string CountryOfOrigin { get; set; } = "JP"; | ||
|
||
[IgnoreDataMember] | ||
public string Api = "https://api.allanime.day/api"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,27 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Reflection; | ||
using Totoro.Plugins.Anime.Contracts; | ||
using Totoro.Plugins.Anime.Models; | ||
using Totoro.Plugins.Contracts; | ||
using Totoro.Plugins.Options; | ||
|
||
namespace Totoro.Plugins.Anime.AllAnime; | ||
|
||
[ExcludeFromCodeCoverage] | ||
public class Plugin : IPlugin<AnimeProvider> | ||
public class Plugin : Plugin<AnimeProvider, Config> | ||
{ | ||
public AnimeProvider Create() => new() | ||
public override AnimeProvider Create() => new() | ||
{ | ||
Catalog = new Catalog(), | ||
StreamProvider = new StreamProvider(), | ||
AiredAnimeEpisodeProvider = new AiredEpisodesProvider(), | ||
IdMapper = new IdMapper(), | ||
}; | ||
|
||
public PluginInfo GetInfo() => new() | ||
public override PluginInfo GetInfo() => new() | ||
{ | ||
DisplayName = "AllAnime", | ||
Name = "allanime", | ||
Version = Assembly.GetExecutingAssembly().GetName().Version!, | ||
Icon = typeof(Plugin).Assembly.GetManifestResourceStream("Totoro.Plugins.Anime.AllAnime.allanime-icon.png"), | ||
Description = "AllAnime's goal is to provide you with the highest possible amount of daily anime episodes/manga chapters for free and without any kind of limitation." | ||
}; | ||
|
||
public PluginOptions GetOptions() | ||
{ | ||
return new PluginOptions() | ||
.AddOption(x => x.WithName(nameof(Config.Url)) | ||
.WithDisplayName("Url") | ||
.WithDescription("Url to home page") | ||
.WithValue(Config.Url) | ||
.WithGlyph("\uE71B") | ||
.ToPluginOption()) | ||
.AddOption(x => x.WithName(nameof(Config.StreamType)) | ||
.WithDisplayName("Stream Type") | ||
.WithDescription("Choose what to play by default, sub/dub") | ||
.WithGlyph("\uF2B7") | ||
.WithValue(Config.StreamType) | ||
.WithAllowedValues(new[] { StreamType.EnglishSubbed, StreamType.EnglishDubbed, StreamType.Raw }) | ||
.ToSelectablePluginOption()) | ||
.AddOption(x => x.WithName(nameof(Config.CountryOfOrigin)) | ||
.WithDisplayName("Country Of Origin") | ||
.WithDescription("Filter anime by country") | ||
.WithGlyph("\uE909") | ||
.WithValue(Config.CountryOfOrigin) | ||
.WithAllowedValues(new[] { "ALL", "JP", "CN", "KR" }) | ||
.ToSelectablePluginOption()); | ||
} | ||
|
||
public void SetOptions(PluginOptions options) | ||
{ | ||
Config.Url = options.GetString(nameof(Config.Url), Config.Url); | ||
Config.StreamType = options.GetEnum(nameof(Config.StreamType), Config.StreamType); | ||
Config.CountryOfOrigin = options.GetString(nameof(Config.CountryOfOrigin), Config.CountryOfOrigin); | ||
} | ||
|
||
object IPlugin.Create() => Create(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.