Restrcutured the database, and updated pipeline to include cover art.
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using MangaReader.Core.Data;
|
||||
using MangaReader.Core.Metadata;
|
||||
using MangaReader.Core.Pipeline;
|
||||
using MangaReader.Core.Search;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.UI.Dispatching;
|
||||
using Microsoft.UI.Xaml.Media.Imaging;
|
||||
using SixLabors.ImageSharp;
|
||||
@@ -11,6 +13,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -18,7 +21,14 @@ using System.Windows.Input;
|
||||
|
||||
namespace MangaReader.WinUI.ViewModels;
|
||||
|
||||
public partial class LibraryViewModel : ViewModelBase
|
||||
public partial class LibraryViewModel(MangaContext context) : ViewModelBase
|
||||
{
|
||||
public void GetSomething()
|
||||
{
|
||||
var mangas = context.Mangas
|
||||
.Include(x => x.Sources)
|
||||
.ThenInclude(x => x.Chapters);
|
||||
|
||||
//mangas.Select(x => new MangaS)
|
||||
}
|
||||
}
|
||||
39
MangaReader.WinUI/ViewModels/MainViewModel.cs
Normal file
39
MangaReader.WinUI/ViewModels/MainViewModel.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using MangaReader.Core.Metadata;
|
||||
using MangaReader.Core.Pipeline;
|
||||
using MangaReader.Core.Search;
|
||||
using MangaReader.WinUI.Views;
|
||||
using Microsoft.UI.Dispatching;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media.Animation;
|
||||
using Microsoft.UI.Xaml.Media.Imaging;
|
||||
using SixLabors.ImageSharp;
|
||||
using SixLabors.ImageSharp.PixelFormats;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace MangaReader.WinUI.ViewModels;
|
||||
|
||||
public partial class MainViewModel : ViewModelBase
|
||||
{
|
||||
private string? _keyword;
|
||||
|
||||
public string? Keyword
|
||||
{
|
||||
get
|
||||
{
|
||||
return _keyword;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _keyword, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,12 @@ namespace MangaReader.WinUI.ViewModels;
|
||||
|
||||
public class ViewModelLocator
|
||||
{
|
||||
public static MainViewModel MainViewModel
|
||||
=> App.ServiceProvider.GetRequiredService<MainViewModel>();
|
||||
|
||||
public static SearchViewModel SearchViewModel
|
||||
=> App.ServiceProvider.GetRequiredService<SearchViewModel>();
|
||||
|
||||
public static LibraryViewModel LibraryViewModel
|
||||
=> App.ServiceProvider.GetRequiredService<LibraryViewModel>();
|
||||
}
|
||||
Reference in New Issue
Block a user