-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/NoMercy-Entertainment/NoMerc…
…yMediaServerCS into dev
- Loading branch information
Showing
1 changed file
with
118 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,118 @@ | ||
using NoMercy.NmSystem.Extensions; | ||
using SixLabors.ImageSharp; | ||
using SixLabors.ImageSharp.PixelFormats; | ||
using SixLabors.ImageSharp.Processing; | ||
using SixLabors.ImageSharp.Processing.Processors.Dithering; | ||
using SixLabors.ImageSharp.Processing.Processors.Quantization; | ||
|
||
namespace NoMercy.Setup; | ||
|
||
public class Dev | ||
{ | ||
public static async Task Run() | ||
Check warning on line 12 in src/NoMercy.Setup/Dev.cs
|
||
{ | ||
// OpenSubtitlesClient client = new(); | ||
// OpenSubtitlesClient subtitlesClient = await client.Login(); | ||
// SubtitleSearchResponse? x = await subtitlesClient.SearchSubtitles("Black Panther Wakanda Forever (2022)", "dut"); | ||
// Logger.OpenSubs(x); | ||
|
||
// TvdbArtworkClient artworkClient = new(63150614); | ||
// TvdbArtWorkResponse? artworkDetails = await artworkClient.Details(); | ||
// Logger.Tvdb(artworkDetails); | ||
// TvdbArtWorkExtendedResponse? artWorkExtendedResponse = await artworkClient.Extended(); | ||
// Logger.Tvdb(artWorkExtendedResponse); | ||
// TvdbArtWorkStatusesResponse? arTvdbStatusesResponse = await artworkClient.Statuses(); | ||
// Logger.Tvdb(arTvdbStatusesResponse); | ||
// TvdbArtWorkTypesResponse? artworkTypesResponse = await artworkClient.Types(); | ||
// Logger.Tvdb(artworkTypesResponse); | ||
// | ||
// TvdbAwardsClient awardsClient = new(1); | ||
// TvdbAwardsResponse? tvdbAwardsResponse = await awardsClient.Awards(); | ||
// Logger.Tvdb(tvdbAwardsResponse); | ||
// TvdbAwardResponse? tvdbAwardResponse = await awardsClient.Details(); | ||
// Logger.Tvdb(tvdbAwardResponse); | ||
// TvdbAwardExtendedResponse? tvdbAwardExtendedResponse = await awardsClient.Extended(); | ||
// Logger.Tvdb(tvdbAwardExtendedResponse); | ||
// | ||
// | ||
// TvdbAwardCategoriesClient awardsCategoriesClient = new(2); | ||
// TvdbAwardCategoryResponse? tvdbAwardCategoryResponse = await awardsCategoriesClient.Categories(); | ||
// Logger.Tvdb(tvdbAwardCategoryResponse); | ||
// TvdbAwardCategoryExtendedResponse? tvdbAwardCategoryExtendedResponse = await awardsCategoriesClient.CategoriesExtended(); | ||
// Logger.Tvdb(tvdbAwardCategoryExtendedResponse); | ||
|
||
// TvdbPersonClient personClient = new(64425524); | ||
// TvdbCharacterResponse? character = await personClient.Character(); | ||
// Logger.Tvdb(character); | ||
// TvdbPeopleTypeResponse? people = await personClient.People(); | ||
// Logger.Tvdb(people); | ||
// TvdbPeopleTypeResponse? peopleTypes = await personClient.Types(); | ||
// Logger.Tvdb(peopleTypes); | ||
|
||
|
||
|
||
// | ||
// TvdbCompanyClient companyClient = new(2151); | ||
// TvdbCompaniesResponse? tvdbCompaniesResponse = await companyClient.Companies(); | ||
// Logger.Tvdb(tvdbCompaniesResponse?.Data.Take(20)); | ||
// TvdbCompanyResponse? tvdbCompanyResponseDetails = await companyClient.Details(); | ||
// Logger.Tvdb(tvdbCompanyResponseDetails); | ||
// TvdbCompanyTypesResponse? tvdbCompanyTypesResponse = await companyClient.Types(); | ||
// Logger.Tvdb(tvdbCompanyTypesResponse); | ||
// | ||
// TvdbContentRatingClient ratingClient = new(); | ||
// TvdbContentRatingsResponse? ratings = await ratingClient.ContentRatings(); | ||
// Logger.Tvdb(ratings); | ||
// | ||
// TvdbCountriesClient countriesClient = new(); | ||
// TvdbCountriesResponse? countries = await countriesClient.Countries(); | ||
// Logger.Tvdb(countries); | ||
// | ||
// TvdbEntitiesClient entitiesClient = new(); | ||
// TvdbEntitiesResponse? entities = await entitiesClient.Entities(); | ||
// Logger.Tvdb(entities); | ||
// | ||
// TvdbGenderClient genderClient = new(); | ||
// TvdbGendersResponse? tvdbGenders = await genderClient.Genders(); | ||
// Logger.Tvdb(tvdbGenders); | ||
// | ||
// TvdbGenresClient client = new(1); | ||
// TvdbGenresResponse? genres = await client.Genres(); | ||
// Logger.Tvdb(genres); | ||
// TvdbGenreResponse? genre = await client.Details(); | ||
// Logger.Tvdb(genre); | ||
|
||
// TvdbInspirationClient inspirationClient = new(); | ||
// TvdbInspirationTypesResponse? inspirationTypes = await inspirationClient.InspirationTypes(); | ||
// Logger.Tvdb(inspirationTypes); | ||
|
||
// TvdbLanguagesClient languagesClient = new(); | ||
// TvdbLanguagesResponse? languages = await languagesClient.Languages(); | ||
// Logger.Tvdb(languages); | ||
} | ||
|
||
public static string GetDominantColor(string path) | ||
{ | ||
using Image<Rgb24> image = Image.Load<Rgb24>(path); | ||
image.Mutate(x => x | ||
.Resize(new ResizeOptions() | ||
{ | ||
Sampler = KnownResamplers.NearestNeighbor, | ||
Size = new(100, 0) | ||
}) | ||
.Quantize(new OctreeQuantizer | ||
{ | ||
Options = | ||
{ | ||
MaxColors = 1, | ||
Dither = new OrderedDither(1), | ||
DitherScale = 1 | ||
} | ||
})); | ||
|
||
Rgb24 dominant = image[0, 0]; | ||
|
||
return dominant.ToHexString(); | ||
|
||
} | ||
} |