-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
1,078 additions
and
1 deletion.
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,10 @@ | ||
namespace Juro.Core.Models; | ||
|
||
public class Provider | ||
{ | ||
public string Key { get; set; } = default!; | ||
|
||
public string Name { get; set; } = default!; | ||
|
||
public ProviderType Type { get; set; } | ||
} |
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,8 @@ | ||
namespace Juro.Core.Models; | ||
|
||
public enum ProviderType | ||
{ | ||
Anime, | ||
Manga, | ||
Movie, | ||
} |
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,23 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Httpz" Version="1.1.7" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8" PrivateAssets="all" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.8" PrivateAssets="all" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.8" /> | ||
<PackageReference Include="Spectre.Console" Version="0.49.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Juro.Providers.Adult\Juro.Providers.Adult.csproj" /> | ||
<ProjectReference Include="..\Juro.Providers\Juro.Providers.csproj" /> | ||
<ProjectReference Include="..\Juro\Juro.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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,40 @@ | ||
using Juro.DataBuilder.Models; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace Juro.DataBuilder; | ||
|
||
public class JuroContext : DbContext | ||
{ | ||
public DbSet<ManamiAnimeItem> AnimeItems { get; set; } | ||
|
||
public DbSet<AnimeSeason> AnimeSeasons { get; set; } | ||
|
||
public DbSet<AnimeModel> Gogoanime { get; set; } | ||
|
||
public DbSet<AnimeModel> AnimePahe { get; set; } | ||
|
||
public DbSet<AnimeModel> Kaido { get; set; } | ||
|
||
public DbSet<AnimeModel> Aniwave { get; set; } | ||
|
||
public DbSet<AnimeModel> OtakuDesu { get; set; } | ||
|
||
public string DbPath { get; } | ||
|
||
public JuroContext() | ||
{ | ||
var folder = Environment.SpecialFolder.LocalApplicationData; | ||
var path = Environment.GetFolderPath(folder); | ||
DbPath = Path.Join(path, "juro.db"); | ||
} | ||
|
||
public JuroContext(string dbPath) | ||
{ | ||
DbPath = dbPath; | ||
} | ||
|
||
// The following configures EF to create a Sqlite database file in the | ||
// special "local" folder for your platform. | ||
protected override void OnConfiguring(DbContextOptionsBuilder options) => | ||
options.UseSqlite($"Data Source={DbPath}"); | ||
} |
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,36 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using Juro.Core.Models.Anime; | ||
|
||
namespace Juro.DataBuilder.Models; | ||
|
||
public class AnimeModel | ||
{ | ||
[Key] | ||
public int AnimeId { get; set; } | ||
|
||
public string Id { get; set; } = default!; | ||
|
||
public AnimeSites Site { get; set; } | ||
|
||
public string Title { get; set; } = default!; | ||
|
||
public string? Released { get; set; } | ||
|
||
public string? Category { get; set; } | ||
|
||
public string? Link { get; set; } | ||
|
||
public string? Image { get; set; } | ||
|
||
public string? Type { get; set; } | ||
|
||
public string? Status { get; set; } | ||
|
||
public string? OtherNames { get; set; } | ||
|
||
public string? Summary { get; set; } | ||
|
||
public List<GenreModel> Genres { get; set; } = []; | ||
|
||
public override string ToString() => $"{Title}"; | ||
} |
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,28 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace Juro.DataBuilder.Models; | ||
|
||
public class GenreModel | ||
{ | ||
[Key] | ||
public int GenreId { get; set; } | ||
|
||
public string Name { get; set; } = default!; | ||
|
||
public string? Url { get; set; } | ||
|
||
public GenreModel() { } | ||
|
||
public GenreModel(string name) | ||
{ | ||
Name = name; | ||
} | ||
|
||
public GenreModel(string name, string url) | ||
{ | ||
Name = name; | ||
Url = url; | ||
} | ||
|
||
public override string ToString() => $"{Name}"; | ||
} |
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,87 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Juro.DataBuilder.Models; | ||
|
||
public class License | ||
{ | ||
[JsonPropertyName("name")] | ||
public string Name { get; set; } = default!; | ||
|
||
[JsonPropertyName("url")] | ||
public string Url { get; set; } = default!; | ||
} | ||
|
||
public class Root | ||
{ | ||
[JsonPropertyName("license")] | ||
public License License { get; set; } = default!; | ||
|
||
[JsonPropertyName("repository")] | ||
public string Repository { get; set; } = default!; | ||
|
||
[JsonPropertyName("lastUpdate")] | ||
public string LastUpdate { get; set; } = default!; | ||
|
||
[JsonPropertyName("data")] | ||
public List<ManamiAnimeItem> Data { get; set; } = []; | ||
} | ||
|
||
public class ManamiAnimeItem | ||
{ | ||
[Key] | ||
[JsonIgnore] | ||
public int Id { get; set; } | ||
|
||
[JsonPropertyName("sources")] | ||
public List<string> Sources { get; set; } = []; | ||
|
||
[JsonPropertyName("title")] | ||
public string Title { get; set; } = default!; | ||
|
||
[JsonPropertyName("type")] | ||
public string Type { get; set; } = default!; | ||
|
||
[JsonPropertyName("episodes")] | ||
public int Episodes { get; set; } | ||
|
||
[JsonPropertyName("status")] | ||
public int Status { get; set; } | ||
|
||
[JsonPropertyName("animeSeason")] | ||
public AnimeSeason AnimeSeason { get; set; } = default!; | ||
|
||
[JsonPropertyName("picture")] | ||
public string Picture { get; set; } = default!; | ||
|
||
[JsonPropertyName("thumbnail")] | ||
public string Thumbnail { get; set; } = default!; | ||
|
||
[JsonPropertyName("synonyms")] | ||
public List<string> Synonyms { get; set; } = []; | ||
|
||
[JsonPropertyName("relatedAnime")] | ||
public List<string> RelatedAnime { get; set; } = []; | ||
|
||
[JsonPropertyName("tags")] | ||
public List<string> Tags { get; set; } = []; | ||
|
||
public string? GogoanimeId { get; set; } | ||
public string? AnimePaheId { get; set; } | ||
public string? KaidoId { get; set; } | ||
public string? AniwaveId { get; set; } | ||
public string? OtakuDesuId { get; set; } | ||
} | ||
|
||
public class AnimeSeason | ||
{ | ||
[Key] | ||
[JsonIgnore] | ||
public int Id { get; set; } | ||
|
||
[JsonPropertyName("season")] | ||
public string Season { get; set; } = default!; | ||
|
||
[JsonPropertyName("year")] | ||
public int Year { get; set; } | ||
} |
Oops, something went wrong.