From d2516d039bdff3737b9343b103c31e6f794f675a Mon Sep 17 00:00:00 2001 From: Elwador <75888166+Elwador@users.noreply.github.com> Date: Thu, 27 Jun 2024 22:52:12 +0200 Subject: [PATCH] Add - History tab language selection Add - Muxing description language selection --- CRD/Downloader/CrEpisode.cs | 15 +- CRD/Downloader/CrSeries.cs | 57 +++- CRD/Downloader/Crunchyroll.cs | 23 +- CRD/Downloader/History.cs | 40 +-- CRD/Styling/ControlsGalleryStyles.axaml | 106 ------ CRD/Utils/Structs/CalendarStructs.cs | 2 +- CRD/Utils/Structs/CrDownloadOptions.cs | 6 + CRD/Utils/Structs/History/HistorySeries.cs | 2 + CRD/ViewModels/AddDownloadPageViewModel.cs | 6 +- CRD/ViewModels/SeriesPageViewModel.cs | 4 +- CRD/ViewModels/SettingsPageViewModel.cs | 53 ++- CRD/Views/SeriesPageView.axaml | 365 +++++++++++---------- CRD/Views/SettingsPageView.axaml | 28 +- 13 files changed, 363 insertions(+), 344 deletions(-) delete mode 100644 CRD/Styling/ControlsGalleryStyles.axaml diff --git a/CRD/Downloader/CrEpisode.cs b/CRD/Downloader/CrEpisode.cs index 0e2f46e..8e02bac 100644 --- a/CRD/Downloader/CrEpisode.cs +++ b/CRD/Downloader/CrEpisode.cs @@ -17,16 +17,22 @@ namespace CRD.Downloader; public class CrEpisode(){ private readonly Crunchyroll crunInstance = Crunchyroll.Instance; - public async Task ParseEpisodeById(string id, string locale){ + public async Task ParseEpisodeById(string id, string crLocale,bool forcedLang = false){ if (crunInstance.CmsToken?.Cms == null){ Console.Error.WriteLine("Missing CMS Access Token"); return null; } NameValueCollection query = HttpUtility.ParseQueryString(new UriBuilder().Query); - + query["preferred_audio_language"] = "ja-JP"; - query["locale"] = Languages.Locale2language(locale).CrLocale; + if (!string.IsNullOrEmpty(crLocale)){ + query["locale"] = crLocale; + if (forcedLang){ + query["force_locale"] = crLocale; + } + } + var request = HttpClientReq.CreateRequestMessage($"{Api.Cms}/episodes/{id}", HttpMethod.Get, true, true, query); @@ -198,7 +204,8 @@ public class CrEpisode(){ DownloadSpeed = 0 }; epMeta.AvailableSubs = item.SubtitleLocales; - epMeta.Description = item.Description; + epMeta.Description = item.Description; + if (episodeP.EpisodeAndLanguages.Langs.Count > 0){ epMeta.SelectedDubs = dubLang .Where(language => episodeP.EpisodeAndLanguages.Langs.Any(epLang => epLang.CrLocale == language)) diff --git a/CRD/Downloader/CrSeries.cs b/CRD/Downloader/CrSeries.cs index b28ec20..4c1965b 100644 --- a/CRD/Downloader/CrSeries.cs +++ b/CRD/Downloader/CrSeries.cs @@ -133,12 +133,12 @@ public class CrSeries(){ } - public async Task ListSeriesId(string id,string Locale, CrunchyMultiDownload? data){ + public async Task ListSeriesId(string id,string crLocale, CrunchyMultiDownload? data){ await crunInstance.CrAuth.RefreshToken(true); bool serieshasversions = true; - CrSeriesSearch? parsedSeries = await ParseSeriesById(id,Locale); // one piece - GRMG8ZQZR + CrSeriesSearch? parsedSeries = await ParseSeriesById(id,crLocale); // one piece - GRMG8ZQZR if (parsedSeries == null){ Console.Error.WriteLine("Parse Data Invalid"); @@ -154,7 +154,7 @@ public class CrSeries(){ var s = result[season][key]; if (data?.S != null && s.Id != data.Value.S) continue; int fallbackIndex = 0; - var seasonData = await GetSeasonDataById(s.Id); + var seasonData = await GetSeasonDataById(s.Id,""); if (seasonData.Data != null){ if (crunInstance.CrunOptions.History){ @@ -285,7 +285,7 @@ public class CrSeries(){ return crunchySeriesList; } - public async Task GetSeasonDataById(string seasonID, bool log = false){ + public async Task GetSeasonDataById(string seasonID,string? crLocale,bool forcedLang = false, bool log = false){ CrunchyEpisodeList episodeList = new CrunchyEpisodeList(){ Data = new List(), Total = 0, Meta = new Meta() }; if (crunInstance.CmsToken?.Cms == null){ @@ -293,8 +293,20 @@ public class CrSeries(){ return episodeList; } + NameValueCollection query; if (log){ - var showRequest = HttpClientReq.CreateRequestMessage($"{Api.Cms}/seasons/{seasonID}?preferred_audio_language=ja-JP", HttpMethod.Get, true, true, null); + + query = HttpUtility.ParseQueryString(new UriBuilder().Query); + + query["preferred_audio_language"] = "ja-JP"; + if (!string.IsNullOrEmpty(crLocale)){ + query["locale"] = crLocale; + if (forcedLang){ + query["force_locale"] = crLocale; + } + } + + var showRequest = HttpClientReq.CreateRequestMessage($"{Api.Cms}/seasons/{seasonID}", HttpMethod.Get, true, true, query); var response = await HttpClientReq.Instance.SendHttpRequest(showRequest); @@ -305,10 +317,18 @@ public class CrSeries(){ } } - var episodeRequest = new HttpRequestMessage(HttpMethod.Get, $"{Api.Cms}/seasons/{seasonID}/episodes?preferred_audio_language=ja-JP"); - - episodeRequest.Headers.Authorization = new AuthenticationHeaderValue("Bearer", crunInstance.Token?.access_token); - + query = HttpUtility.ParseQueryString(new UriBuilder().Query); + + query["preferred_audio_language"] = "ja-JP"; + if (!string.IsNullOrEmpty(crLocale)){ + query["locale"] = crLocale; + if (forcedLang){ + query["force_locale"] = crLocale; + } + } + + var episodeRequest = HttpClientReq.CreateRequestMessage( $"{Api.Cms}/seasons/{seasonID}/episodes",HttpMethod.Get, true,true,query); + var episodeRequestResponse = await HttpClientReq.Instance.SendHttpRequest(episodeRequest); if (!episodeRequestResponse.IsOk){ @@ -356,7 +376,7 @@ public class CrSeries(){ return ret; } - public async Task ParseSeriesById(string id,string? locale,bool forced = false){ + public async Task ParseSeriesById(string id,string? crLocale,bool forced = false){ if (crunInstance.CmsToken?.Cms == null){ Console.Error.WriteLine("Missing CMS Access Token"); return null; @@ -365,10 +385,10 @@ public class CrSeries(){ NameValueCollection query = HttpUtility.ParseQueryString(new UriBuilder().Query); query["preferred_audio_language"] = "ja-JP"; - if (!string.IsNullOrEmpty(locale)){ - query["locale"] = Languages.Locale2language(locale).CrLocale; + if (!string.IsNullOrEmpty(crLocale)){ + query["locale"] = crLocale; if (forced){ - query["force_locale"] = Languages.Locale2language(locale).CrLocale; + query["force_locale"] = crLocale; } } @@ -393,15 +413,22 @@ public class CrSeries(){ return seasonsList; } - public async Task SeriesById(string id){ + public async Task SeriesById(string id,string? crLocale,bool forced = false){ if (crunInstance.CmsToken?.Cms == null){ Console.Error.WriteLine("Missing CMS Access Token"); return null; } NameValueCollection query = HttpUtility.ParseQueryString(new UriBuilder().Query); - + query["preferred_audio_language"] = "ja-JP"; + if (!string.IsNullOrEmpty(crLocale)){ + query["locale"] = crLocale; + if (forced){ + query["force_locale"] = crLocale; + } + + } var request = HttpClientReq.CreateRequestMessage($"{Api.Cms}/series/{id}", HttpMethod.Get, true, true, query); diff --git a/CRD/Downloader/Crunchyroll.cs b/CRD/Downloader/Crunchyroll.cs index 8624fec..1d75c7e 100644 --- a/CRD/Downloader/Crunchyroll.cs +++ b/CRD/Downloader/Crunchyroll.cs @@ -69,7 +69,7 @@ public class Crunchyroll{ #endregion - public string DefaultLocale = "en"; + public string DefaultLocale = "en-US"; public JsonSerializerSettings? SettingsJsonSerializerSettings = new(){ NullValueHandling = NullValueHandling.Ignore, @@ -159,6 +159,7 @@ public class Crunchyroll{ CrunOptions.DlVideoOnce = true; CrunOptions.StreamEndpoint = "web/firefox"; CrunOptions.SubsAddScaledBorder = ScaledBorderAndShadowSelection.ScaledBorderAndShadowYes; + CrunOptions.HistoryLang = ""; CrunOptions.History = true; @@ -321,10 +322,10 @@ public class Crunchyroll{ return week; } - public async Task AddEpisodeToQue(string epId, string locale, List dubLang){ + public async Task AddEpisodeToQue(string epId, string crLocale, List dubLang){ await CrAuth.RefreshToken(true); - var episodeL = await CrEpisode.ParseEpisodeById(epId, locale); + var episodeL = await CrEpisode.ParseEpisodeById(epId, crLocale); if (episodeL != null){ @@ -335,6 +336,13 @@ public class Crunchyroll{ var sList = await CrEpisode.EpisodeData((CrunchyEpisode)episodeL); var selected = CrEpisode.EpisodeMeta(sList, dubLang); + + if (CrunOptions.IncludeVideoDescription){ + if (selected.Data is{ Count: > 0 }){ + var episode = await CrEpisode.ParseEpisodeById(selected.Data.First().MediaId, string.IsNullOrEmpty(CrunOptions.DescriptionLang) ? DefaultLocale : CrunOptions.DescriptionLang, true); + selected.Description = episode?.Description ?? selected.Description; + } + } if (selected.Data is{ Count: > 0 }){ if (CrunOptions.History){ @@ -373,7 +381,7 @@ public class Crunchyroll{ } } - public void AddSeriesToQueue(CrunchySeriesList list, CrunchyMultiDownload data){ + public async Task AddSeriesToQueue(CrunchySeriesList list, CrunchyMultiDownload data){ var selected = CrSeries.ItemSelectMultiDub(list.Data, data.DubLang, data.But, data.AllEpisodes, data.E); bool failed = false; @@ -398,6 +406,13 @@ public class Crunchyroll{ crunchyEpMeta.DownloadPath = historyEpisode.downloadDirPath; } } + + if (CrunOptions.IncludeVideoDescription){ + if (crunchyEpMeta.Data is{ Count: > 0 }){ + var episode = await CrEpisode.ParseEpisodeById(crunchyEpMeta.Data.First().MediaId, string.IsNullOrEmpty(CrunOptions.DescriptionLang) ? DefaultLocale : CrunOptions.DescriptionLang, true); + crunchyEpMeta.Description = episode?.Description ?? crunchyEpMeta.Description; + } + } Queue.Add(crunchyEpMeta); } else{ diff --git a/CRD/Downloader/History.cs b/CRD/Downloader/History.cs index 16141b9..f49e3f0 100644 --- a/CRD/Downloader/History.cs +++ b/CRD/Downloader/History.cs @@ -27,7 +27,7 @@ public class History(){ public async Task UpdateSeries(string seriesId, string? seasonId){ await crunInstance.CrAuth.RefreshToken(true); - CrSeriesSearch? parsedSeries = await crunInstance.CrSeries.ParseSeriesById(seriesId, "ja", true); + CrSeriesSearch? parsedSeries = await crunInstance.CrSeries.ParseSeriesById(seriesId, "ja-JP", true); if (parsedSeries == null){ Console.Error.WriteLine("Parse Data Invalid"); @@ -55,8 +55,8 @@ public class History(){ } } - var seasonData = await crunInstance.CrSeries.GetSeasonDataById(sId); - UpdateWithSeasonData(seasonData); + var seasonData = await crunInstance.CrSeries.GetSeasonDataById(sId,string.IsNullOrEmpty(crunInstance.CrunOptions.HistoryLang) ? crunInstance.DefaultLocale : crunInstance.CrunOptions.HistoryLang,true); + await UpdateWithSeasonData(seasonData); } } } @@ -152,10 +152,7 @@ public class History(){ if (historySeries != null){ var historySeason = historySeries.Seasons.FirstOrDefault(s => s.SeasonId == episode.SeasonId); - var series = await crunInstance.CrSeries.SeriesById(seriesId); - if (series?.Data != null){ - historySeries.SeriesTitle = series.Data.First().Title; - } + await RefreshSeriesData(seriesId, historySeries); if (historySeason != null){ historySeason.SeasonTitle = episode.SeasonTitle; @@ -192,12 +189,7 @@ public class History(){ crunInstance.HistoryList.Add(historySeries); var newSeason = NewHistorySeason(episode); - var series = await crunInstance.CrSeries.SeriesById(seriesId); - if (series?.Data != null){ - historySeries.SeriesDescription = series.Data.First().Description; - historySeries.ThumbnailImageUrl = GetSeriesThumbnail(series); - historySeries.SeriesTitle = series.Data.First().Title; - } + await RefreshSeriesData(seriesId, historySeries); historySeries.Seasons.Add(newSeason); historySeries.UpdateNewEpisodes(); @@ -217,10 +209,8 @@ public class History(){ var historySeries = crunInstance.HistoryList.FirstOrDefault(series => series.SeriesId == seriesId); if (historySeries != null){ var historySeason = historySeries.Seasons.FirstOrDefault(s => s.SeasonId == firstEpisode.SeasonId); - var series = await crunInstance.CrSeries.SeriesById(seriesId); - if (series?.Data != null){ - historySeries.SeriesTitle = series.Data.First().Title; - } + + await RefreshSeriesData(seriesId, historySeries); if (historySeason != null){ historySeason.SeasonTitle = firstEpisode.SeasonTitle; @@ -274,12 +264,7 @@ public class History(){ newSeason.EpisodesList.Sort(new NumericStringPropertyComparer()); - var series = await crunInstance.CrSeries.SeriesById(seriesId); - if (series?.Data != null){ - historySeries.SeriesDescription = series.Data.First().Description; - historySeries.ThumbnailImageUrl = GetSeriesThumbnail(series); - historySeries.SeriesTitle = series.Data.First().Title; - } + await RefreshSeriesData(seriesId, historySeries); historySeries.Seasons.Add(newSeason); @@ -295,6 +280,15 @@ public class History(){ } } + private async Task RefreshSeriesData(string seriesId, HistorySeries historySeries){ + var series = await crunInstance.CrSeries.SeriesById(seriesId,string.IsNullOrEmpty(crunInstance.CrunOptions.HistoryLang) ? crunInstance.DefaultLocale : crunInstance.CrunOptions.HistoryLang,true); + if (series?.Data != null){ + historySeries.SeriesDescription = series.Data.First().Description; + historySeries.ThumbnailImageUrl = GetSeriesThumbnail(series); + historySeries.SeriesTitle = series.Data.First().Title; + } + } + private void SortSeasons(HistorySeries series){ var sortedSeasons = series.Seasons .OrderBy(s => s.SeasonNum != null ? int.Parse(s.SeasonNum) : 0) diff --git a/CRD/Styling/ControlsGalleryStyles.axaml b/CRD/Styling/ControlsGalleryStyles.axaml deleted file mode 100644 index 50cb62c..0000000 --- a/CRD/Styling/ControlsGalleryStyles.axaml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/CRD/Utils/Structs/CalendarStructs.cs b/CRD/Utils/Structs/CalendarStructs.cs index 997f11c..8180129 100644 --- a/CRD/Utils/Structs/CalendarStructs.cs +++ b/CRD/Utils/Structs/CalendarStructs.cs @@ -47,7 +47,7 @@ public partial class CalendarEpisode : INotifyPropertyChanged{ if (match.Success){ var locale = match.Groups[1].Value; // Capture the locale part var id = match.Groups[2].Value; // Capture the ID part - Crunchyroll.Instance.AddEpisodeToQue(id, locale, Crunchyroll.Instance.CrunOptions.DubLang); + Crunchyroll.Instance.AddEpisodeToQue(id, Languages.Locale2language(locale).CrLocale, Crunchyroll.Instance.CrunOptions.DubLang); } } diff --git a/CRD/Utils/Structs/CrDownloadOptions.cs b/CRD/Utils/Structs/CrDownloadOptions.cs index 3871f83..f2305bc 100644 --- a/CRD/Utils/Structs/CrDownloadOptions.cs +++ b/CRD/Utils/Structs/CrDownloadOptions.cs @@ -80,6 +80,9 @@ public class CrDownloadOptions{ [YamlMember(Alias = "mux_video_description", ApplyNamingConventions = false)] public bool IncludeVideoDescription{ get; set; } + + [YamlMember(Alias = "mux_description_lang", ApplyNamingConventions = false)] + public string? DescriptionLang{ get; set; } [YamlIgnore] public string Force{ get; set; } @@ -132,6 +135,9 @@ public class CrDownloadOptions{ [YamlMember(Alias = "history", ApplyNamingConventions = false)] public bool History{ get; set; } + [YamlMember(Alias = "history_lang", ApplyNamingConventions = false)] + public string? HistoryLang{ get; set; } + [YamlMember(Alias = "sonarr_properties", ApplyNamingConventions = false)] public SonarrProperties? SonarrProperties{ get; set; } diff --git a/CRD/Utils/Structs/History/HistorySeries.cs b/CRD/Utils/Structs/History/HistorySeries.cs index c60d9f3..c41e094 100644 --- a/CRD/Utils/Structs/History/HistorySeries.cs +++ b/CRD/Utils/Structs/History/HistorySeries.cs @@ -147,6 +147,8 @@ public class HistorySeries : INotifyPropertyChanged{ await Crunchyroll.Instance.CrHistory.UpdateSeries(SeriesId, seasonId); FetchingData = false; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(FetchingData))); + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SeriesTitle))); + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SeriesDescription))); Crunchyroll.Instance.CrHistory.MatchHistoryEpisodesWithSonarr(false, this); UpdateNewEpisodes(); } diff --git a/CRD/ViewModels/AddDownloadPageViewModel.cs b/CRD/ViewModels/AddDownloadPageViewModel.cs index bbb46f0..2771f65 100644 --- a/CRD/ViewModels/AddDownloadPageViewModel.cs +++ b/CRD/ViewModels/AddDownloadPageViewModel.cs @@ -91,7 +91,7 @@ public partial class AddDownloadPageViewModel : ViewModelBase{ } if (currentSeriesList != null){ - Crunchyroll.Instance.AddSeriesToQueue(currentSeriesList.Value, new CrunchyMultiDownload(Crunchyroll.Instance.CrunOptions.DubLang, AddAllEpisodes, false, selectedEpisodes)); + await Crunchyroll.Instance.AddSeriesToQueue(currentSeriesList.Value, new CrunchyMultiDownload(Crunchyroll.Instance.CrunOptions.DubLang, AddAllEpisodes, false, selectedEpisodes)); } @@ -119,7 +119,7 @@ public partial class AddDownloadPageViewModel : ViewModelBase{ if (match.Success){ var locale = match.Groups[1].Value; // Capture the locale part var id = match.Groups[2].Value; // Capture the ID part - Crunchyroll.Instance.AddEpisodeToQue(id, locale, Crunchyroll.Instance.CrunOptions.DubLang); + Crunchyroll.Instance.AddEpisodeToQue(id, Languages.Locale2language(locale).CrLocale, Crunchyroll.Instance.CrunOptions.DubLang); UrlInput = ""; selectedEpisodes.Clear(); SelectedItems.Clear(); @@ -142,7 +142,7 @@ public partial class AddDownloadPageViewModel : ViewModelBase{ ButtonEnabled = false; ShowLoading = true; - var list = await Crunchyroll.Instance.CrSeries.ListSeriesId(id, "", new CrunchyMultiDownload(Crunchyroll.Instance.CrunOptions.DubLang, true)); + var list = await Crunchyroll.Instance.CrSeries.ListSeriesId(id, Languages.Locale2language(locale).CrLocale, new CrunchyMultiDownload(Crunchyroll.Instance.CrunOptions.DubLang, true)); ShowLoading = false; if (list != null){ currentSeriesList = list; diff --git a/CRD/ViewModels/SeriesPageViewModel.cs b/CRD/ViewModels/SeriesPageViewModel.cs index 1599438..846159d 100644 --- a/CRD/ViewModels/SeriesPageViewModel.cs +++ b/CRD/ViewModels/SeriesPageViewModel.cs @@ -78,8 +78,8 @@ public partial class SeriesPageViewModel : ViewModelBase{ [RelayCommand] public async Task UpdateData(string? season){ await SelectedSeries.FetchData(season); - - MessageBus.Current.SendMessage(new NavigationMessage(typeof(SeriesPageViewModel), false, true)); + + // MessageBus.Current.SendMessage(new NavigationMessage(typeof(SeriesPageViewModel), false, true)); } [RelayCommand] diff --git a/CRD/ViewModels/SettingsPageViewModel.cs b/CRD/ViewModels/SettingsPageViewModel.cs index e40b165..8eb42a4 100644 --- a/CRD/ViewModels/SettingsPageViewModel.cs +++ b/CRD/ViewModels/SettingsPageViewModel.cs @@ -93,6 +93,13 @@ public partial class SettingsPageViewModel : ViewModelBase{ [ObservableProperty] private ComboBoxItem _selectedHSLang; + + [ObservableProperty] + private ComboBoxItem _selectedHistoryLang; + + [ObservableProperty] + private ComboBoxItem _selectedDescriptionLang; + [ObservableProperty] private string _selectedDubs = "ja-JP"; @@ -228,6 +235,36 @@ public partial class SettingsPageViewModel : ViewModelBase{ new ComboBoxItem(){ Content = "none" }, }; + public ObservableCollection HistoryLangList{ get; } = new(){ + new ComboBoxItem(){ Content = "default" }, + new ComboBoxItem(){ Content = "de-DE" }, + new ComboBoxItem(){ Content = "en-US" }, + new ComboBoxItem(){ Content = "es-419" }, + new ComboBoxItem(){ Content = "es-ES" }, + new ComboBoxItem(){ Content = "fr-FR" }, + new ComboBoxItem(){ Content = "it-IT" }, + new ComboBoxItem(){ Content = "pt-BR" }, + new ComboBoxItem(){ Content = "pt-PT" }, + new ComboBoxItem(){ Content = "ru-RU" }, + new ComboBoxItem(){ Content = "hi-IN" }, + new ComboBoxItem(){ Content = "ar-SA" }, + }; + + public ObservableCollection DescriptionLangList{ get; } = new(){ + new ComboBoxItem(){ Content = "default" }, + new ComboBoxItem(){ Content = "de-DE" }, + new ComboBoxItem(){ Content = "en-US" }, + new ComboBoxItem(){ Content = "es-419" }, + new ComboBoxItem(){ Content = "es-ES" }, + new ComboBoxItem(){ Content = "fr-FR" }, + new ComboBoxItem(){ Content = "it-IT" }, + new ComboBoxItem(){ Content = "pt-BR" }, + new ComboBoxItem(){ Content = "pt-PT" }, + new ComboBoxItem(){ Content = "ru-RU" }, + new ComboBoxItem(){ Content = "hi-IN" }, + new ComboBoxItem(){ Content = "ar-SA" }, + }; + public ObservableCollection DubLangList{ get; } = new(){ }; @@ -287,9 +324,15 @@ public partial class SettingsPageViewModel : ViewModelBase{ DownloadDirPath = string.IsNullOrEmpty(options.DownloadDirPath) ? CfgManager.PathVIDEOS_DIR : options.DownloadDirPath; + ComboBoxItem? descriptionLang = DescriptionLangList.FirstOrDefault(a => a.Content != null && (string)a.Content == options.DescriptionLang) ?? null; + SelectedDescriptionLang = descriptionLang ?? DescriptionLangList[0]; + + ComboBoxItem? historyLang = HistoryLangList.FirstOrDefault(a => a.Content != null && (string)a.Content == options.HistoryLang) ?? null; + SelectedHistoryLang = historyLang ?? HistoryLangList[0]; + ComboBoxItem? hsLang = HardSubLangList.FirstOrDefault(a => a.Content != null && (string)a.Content == options.Hslang) ?? null; SelectedHSLang = hsLang ?? HardSubLangList[0]; - + ComboBoxItem? defaultDubLang = DefaultDubLangList.FirstOrDefault(a => a.Content != null && (string)a.Content == (options.DefaultAudio ?? "")) ?? null; SelectedDefaultDubLang = defaultDubLang ?? DefaultDubLangList[0]; @@ -408,6 +451,14 @@ public partial class SettingsPageViewModel : ViewModelBase{ Crunchyroll.Instance.CrunOptions.DlSubs = softSubs; + string descLang = SelectedDescriptionLang.Content + ""; + + Crunchyroll.Instance.CrunOptions.DescriptionLang = descLang != "default" ? descLang : ""; + + string historyLang = SelectedHistoryLang.Content + ""; + + Crunchyroll.Instance.CrunOptions.HistoryLang = historyLang != "default" ? historyLang : ""; + string hslang = SelectedHSLang.Content + ""; Crunchyroll.Instance.CrunOptions.Hslang = hslang != "none" ? Languages.FindLang(hslang).Locale : hslang; diff --git a/CRD/Views/SeriesPageView.axaml b/CRD/Views/SeriesPageView.axaml index 0a1b776..41eb101 100644 --- a/CRD/Views/SeriesPageView.axaml +++ b/CRD/Views/SeriesPageView.axaml @@ -9,216 +9,221 @@ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="CRD.Views.SeriesPageView"> - - - - - - - - - - - - - - - - - - - - + + - - - - + + + + - + - + + - - - - - - Edit + + + + + + + + + + + + + + + + + + + + + + + + Edit + + + + - - - - - + - - - - + + + + - + Description="{Binding SeasonTitle}" + IsExpanded="False"> - - + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file diff --git a/CRD/Views/SettingsPageView.axaml b/CRD/Views/SettingsPageView.axaml index 3a5fb54..7421305 100644 --- a/CRD/Views/SettingsPageView.axaml +++ b/CRD/Views/SettingsPageView.axaml @@ -119,7 +119,7 @@ - + @@ -135,6 +135,15 @@ + + + + + + + - + - + - + @@ -297,12 +306,21 @@ Text="{Binding FileTitle}" /> - + + + + + + + +