mirror of
https://github.com/Crunchy-DL/Crunchy-Downloader.git
synced 2026-01-11 20:10:26 +00:00
38 lines
No EOL
978 B
C#
38 lines
No EOL
978 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
using CRD.Downloader;
|
|
using CRD.Views;
|
|
using ReactiveUI;
|
|
|
|
namespace CRD.ViewModels;
|
|
|
|
public partial class SeriesPageViewModel : ViewModelBase{
|
|
|
|
|
|
[ObservableProperty]
|
|
public HistorySeries _selectedSeries;
|
|
|
|
public SeriesPageViewModel(){
|
|
_selectedSeries = Crunchyroll.Instance.SelectedSeries;
|
|
|
|
if (_selectedSeries.ThumbnailImage == null){
|
|
_selectedSeries.LoadImage();
|
|
}
|
|
}
|
|
|
|
[RelayCommand]
|
|
public async Task UpdateData(string? season){
|
|
await SelectedSeries.FetchData(season);
|
|
|
|
MessageBus.Current.SendMessage(new NavigationMessage(typeof(SeriesPageViewModel),false,true));
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void NavBack(){
|
|
SelectedSeries.UpdateNewEpisodes();
|
|
MessageBus.Current.SendMessage(new NavigationMessage(null,true,false));
|
|
}
|
|
|
|
} |