This is an updated fork of TraceMoe.NET library with the following improvements:
- Added Nullable Reference Types support
- Removed dependency on SkiaSharp library
- Improved API and documentation
- Removed unnecessary components (e.g. Discord bot)
- Added support for URL API (i.e. let the server download the file)
- Added cancellation support (via CancellationToken)
- And various other fixes and improvements...
The latest version of the library is available from NuGet:
The project is using C# 8.0 and .NET Standard 2.1 and therefore requires the following environment:
- .NET Core SDK 3.0 or newer
- [Optional] Visual Studio 2019 version 16.3 or newer with .NET Core cross-platform development workload (for building using Visual Studio)
using Slko.TraceMoeNET;
using System;
using System.Threading.Tasks;
namespace Example
{
class Program
{
static async Task Main(string[] args)
{
using var client = new TraceMoeClient(); // C# 8.0 using declaration
var searchResult = await client.SearchByURLAsync("https://i.imgur.com/OkiJZFc.jpg");
if (searchResult.Results.Length > 0)
{
// Should output this:
// Most relevant result is Sakura Trick
Console.WriteLine($"Most relevant result is {searchResult.Results[0].TitleRomaji}");
}
else
{
Console.WriteLine("Not found");
}
}
}
}
This repository also contains a simple console client for testing the library. You will need to compile it from source code to use.
Clone the repository, open Slko.TraceMoeNET.sln
in Visual Studio, and build the solution.
Set Slko.TraceMoeNET.ConsoleClient
as startup project and press Run.
$ git clone https://github.com/Slko/TraceMoeNET
$ cd TraceMoeNET
$ dotnet build
$ cd Tests/Slko.TraceMoeNET.ConsoleClient
$ dotnet run