Chg - FFmpeg command now also adds title and description if enabled
Fix - Short freeze when matching large series with sonarr Fix - Stopped collapsing when refreshing seasons & series Fix - Switching between history sorting didn't update correctly
This commit is contained in:
parent
36f06e7c5a
commit
49270824f2
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
|
@ -453,7 +453,11 @@ public class History(){
|
|||
Parallel.ForEach(allHistoryEpisodes, historyEpisode =>
|
||||
{
|
||||
if (updateAll || string.IsNullOrEmpty(historyEpisode.SonarrEpisodeId)){
|
||||
var episode = FindClosestMatchEpisodes(episodes, historyEpisode.EpisodeTitle);
|
||||
|
||||
// Create a copy of the episodes list for each thread
|
||||
var episodesCopy = new List<SonarrEpisode>(episodes);
|
||||
|
||||
var episode = FindClosestMatchEpisodes(episodesCopy, historyEpisode.EpisodeTitle);
|
||||
if (episode != null){
|
||||
historyEpisode.SonarrEpisodeId = episode.Id + "";
|
||||
historyEpisode.SonarrEpisodeNumber = episode.EpisodeNumber + "";
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Diagnostics;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using CRD.Utils.Structs;
|
||||
using DynamicData;
|
||||
|
||||
|
@ -86,7 +87,18 @@ public class Merger{
|
|||
args.AddRange(options.Subtitles.Select((sub, subindex) =>
|
||||
$"-metadata:s:s:{subindex} title=\"{sub.Language.Language ?? sub.Language.Name}{(sub.ClosedCaption == true ? $" {options.CcTag}" : "")}{(sub.Signs == true ? " Signs" : "")}\" -metadata:s:s:{subindex} language={sub.Language.Code}"));
|
||||
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(options.VideoTitle)){
|
||||
|
||||
args.Add($"-metadata title=\"{options.VideoTitle}\"");
|
||||
}
|
||||
|
||||
if (options.Description is{ Count: > 0 }){
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.Load(options.Description[0].Path);
|
||||
XmlNode? node = doc.SelectSingleNode("//Tag/Simple[Name='DESCRIPTION']/String");
|
||||
args.Add($"-metadata comment=\"{node?.InnerText ?? string.Empty}\"");
|
||||
}
|
||||
|
||||
if (options.Options.ffmpeg?.Count > 0){
|
||||
args.AddRange(options.Options.ffmpeg);
|
||||
|
|
|
@ -30,6 +30,9 @@ public class HistorySeason : INotifyPropertyChanged{
|
|||
|
||||
[JsonProperty("series_download_path")]
|
||||
public string? SeasonDownloadPath{ get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool IsExpanded{ get; set; }
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ using System.Net.Http;
|
|||
using System.Threading.Tasks;
|
||||
using Avalonia.Media.Imaging;
|
||||
using CRD.Downloader;
|
||||
using CRD.Utils.CustomList;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace CRD.Utils.Structs.History;
|
||||
|
@ -26,7 +27,7 @@ public class HistorySeries : INotifyPropertyChanged{
|
|||
|
||||
[JsonProperty("sonarr_slug_title")]
|
||||
public string? SonarrSlugTitle{ get; set; }
|
||||
|
||||
|
||||
[JsonProperty("sonarr_next_air_date")]
|
||||
public string? SonarrNextAirDate{ get; set; }
|
||||
|
||||
|
@ -43,7 +44,7 @@ public class HistorySeries : INotifyPropertyChanged{
|
|||
public Bitmap? ThumbnailImage{ get; set; }
|
||||
|
||||
[JsonProperty("series_season_list")]
|
||||
public required ObservableCollection<HistorySeason> Seasons{ get; set; }
|
||||
public required RefreshableObservableCollection<HistorySeason> Seasons{ get; set; }
|
||||
|
||||
[JsonProperty("series_download_path")]
|
||||
public string? SeriesDownloadPath{ get; set; }
|
||||
|
@ -53,6 +54,9 @@ public class HistorySeries : INotifyPropertyChanged{
|
|||
[JsonIgnore]
|
||||
public bool FetchingData{ get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool IsExpanded{ get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool EditModeEnabled{
|
||||
get => _editModeEnabled;
|
||||
|
@ -145,21 +149,21 @@ public class HistorySeries : INotifyPropertyChanged{
|
|||
FetchingData = true;
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(FetchingData)));
|
||||
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();
|
||||
FetchingData = false;
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(FetchingData)));
|
||||
}
|
||||
|
||||
|
||||
public void RemoveSeason(string? season){
|
||||
HistorySeason? objectToRemove = Seasons.FirstOrDefault(se => se.SeasonId == season) ?? null;
|
||||
if (objectToRemove != null){
|
||||
Seasons.Remove(objectToRemove);
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Seasons)));
|
||||
}
|
||||
|
||||
|
||||
CfgManager.WriteJsonToFile(CfgManager.PathCrHistory, Crunchyroll.Instance.HistoryList);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
@ -150,6 +150,7 @@ public partial class HistoryPageViewModel : ViewModelBase{
|
|||
partial void OnSelectedSortingChanged(ComboBoxItem value){
|
||||
if (TryParseEnum<SortingType>(value.Content + "", out var sortingType)){
|
||||
currentSortingType = sortingType;
|
||||
if (Crunchyroll.Instance.CrunOptions.HistoryPageProperties != null) Crunchyroll.Instance.CrunOptions.HistoryPageProperties.SelectedSorting = currentSortingType;
|
||||
Crunchyroll.Instance.CrHistory.SortItems();
|
||||
} else{
|
||||
Console.Error.WriteLine("Invalid viewtype selected");
|
||||
|
|
|
@ -79,6 +79,8 @@ public partial class SeriesPageViewModel : ViewModelBase{
|
|||
public async Task UpdateData(string? season){
|
||||
await SelectedSeries.FetchData(season);
|
||||
|
||||
SelectedSeries.Seasons.Refresh();
|
||||
|
||||
// MessageBus.Current.SendMessage(new NavigationMessage(typeof(SeriesPageViewModel), false, true));
|
||||
}
|
||||
|
||||
|
|
|
@ -240,7 +240,7 @@
|
|||
<controls:SettingsExpander
|
||||
Header="{Binding .}"
|
||||
ItemsSource="{Binding .}"
|
||||
IsExpanded="False">
|
||||
IsExpanded="{Binding IsExpanded}">
|
||||
<controls:SettingsExpander.HeaderTemplate>
|
||||
<DataTemplate DataType="{x:Type history:HistorySeries}">
|
||||
|
||||
|
@ -373,7 +373,7 @@
|
|||
ItemsSource="{Binding EpisodesList}"
|
||||
|
||||
Description="{Binding SeasonTitle}"
|
||||
IsExpanded="False">
|
||||
IsExpanded="{Binding IsExpanded}">
|
||||
|
||||
|
||||
<controls:SettingsExpander.ItemTemplate>
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
ItemsSource="{Binding EpisodesList}"
|
||||
|
||||
Description="{Binding SeasonTitle}"
|
||||
IsExpanded="False">
|
||||
IsExpanded="{Binding IsExpanded}">
|
||||
|
||||
|
||||
<controls:SettingsExpander.ItemTemplate>
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<!-- This manifest is used on Windows only.
|
||||
Don't remove it as it might cause problems with window transparency and embedded controls.
|
||||
For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests -->
|
||||
<assemblyIdentity version="1.0.0.0" name="CRD.Desktop"/>
|
||||
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- A list of the Windows versions that this application has been tested on
|
||||
and is designed to work with. Uncomment the appropriate elements
|
||||
and Windows will automatically select the most compatible environment. -->
|
||||
|
||||
<!-- Windows 10 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
Loading…
Reference in New Issue