mirror of
https://github.com/Crunchy-DL/Crunchy-Downloader.git
synced 2026-05-04 09:19:08 +00:00
Add - Timing Sync - to sync dubs to the video Chg - History Lang is now default language for episode title, description... Chg - Renamed "Fetch Series" to "Refresh Series" to prevent confusion Fix - Fixed Crash with search when episodes had X.X numbering
72 lines
No EOL
2.3 KiB
C#
72 lines
No EOL
2.3 KiB
C#
using System.ComponentModel;
|
|
using System.Threading.Tasks;
|
|
using CRD.Downloader;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace CRD.Utils.Structs.History;
|
|
|
|
public class HistoryEpisode : INotifyPropertyChanged{
|
|
|
|
[JsonProperty("episode_title")]
|
|
public string? EpisodeTitle{ get; set; }
|
|
|
|
[JsonProperty("episode_id")]
|
|
public string? EpisodeId{ get; set; }
|
|
|
|
[JsonProperty("episode_cr_episode_number")]
|
|
public string? Episode{ get; set; }
|
|
|
|
[JsonProperty("episode_cr_episode_description")]
|
|
public string? EpisodeDescription{ get; set; }
|
|
|
|
[JsonProperty("episode_cr_season_number")]
|
|
public string? EpisodeSeasonNum{ get; set; }
|
|
|
|
[JsonProperty("episode_was_downloaded")]
|
|
public bool WasDownloaded{ get; set; }
|
|
|
|
[JsonProperty("episode_special_episode")]
|
|
public bool SpecialEpisode{ get; set; }
|
|
|
|
[JsonProperty("sonarr_episode_id")]
|
|
public string? SonarrEpisodeId{ get; set; }
|
|
|
|
[JsonProperty("sonarr_has_file")]
|
|
public bool SonarrHasFile{ get; set; }
|
|
|
|
[JsonProperty("sonarr_episode_number")]
|
|
public string? SonarrEpisodeNumber{ get; set; }
|
|
|
|
[JsonProperty("sonarr_season_number")]
|
|
public string? SonarrSeasonNumber{ get; set; }
|
|
|
|
[JsonProperty("sonarr_absolut_number")]
|
|
public string? SonarrAbsolutNumber{ get; set; }
|
|
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
public void ToggleWasDownloaded(){
|
|
WasDownloaded = !WasDownloaded;
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(WasDownloaded)));
|
|
}
|
|
|
|
public void ToggleWasDownloadedSeries(HistorySeries? series){
|
|
WasDownloaded = !WasDownloaded;
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(WasDownloaded)));
|
|
|
|
if (series?.Seasons != null){
|
|
foreach (var historySeason in series.Seasons){
|
|
historySeason.UpdateDownloadedSilent();
|
|
}
|
|
|
|
series.UpdateNewEpisodes();
|
|
}
|
|
|
|
CfgManager.UpdateHistoryFile();
|
|
}
|
|
|
|
public async Task DownloadEpisode(){
|
|
await Crunchyroll.Instance.AddEpisodeToQue(EpisodeId, string.IsNullOrEmpty(Crunchyroll.Instance.CrunOptions.HistoryLang) ? Crunchyroll.Instance.DefaultLocale : Crunchyroll.Instance.CrunOptions.HistoryLang,
|
|
Crunchyroll.Instance.CrunOptions.DubLang);
|
|
}
|
|
} |