mirror of
https://github.com/Crunchy-DL/Crunchy-Downloader.git
synced 2026-01-11 20:10:26 +00:00
- Added **automatic history backups** retained for up to 5 days - Improved **season tab** to display series more effectively - Improved **history saving** for increased data safety - Removed **"None" option** from the hardsub selection popup
407 lines
No EOL
24 KiB
XML
407 lines
No EOL
24 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:vm="clr-namespace:CRD.ViewModels"
|
|
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
|
xmlns:structs="clr-namespace:CRD.Utils.Structs"
|
|
xmlns:ui="clr-namespace:CRD.Utils.UI"
|
|
x:DataType="vm:UpcomingPageViewModel"
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
x:Class="CRD.Views.UpcomingPageView">
|
|
|
|
<UserControl.Resources>
|
|
<ui:UiListToStringConverter x:Key="UiListToStringConverter" />
|
|
<ui:UiListHasElementsConverter x:Key="UiListHasElementsConverter" />
|
|
</UserControl.Resources>
|
|
|
|
<Grid>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10">
|
|
<!-- Define columns: one for centering and one for the right-aligned content -->
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" /> <!-- For centering the ItemsControl -->
|
|
<ColumnDefinition Width="Auto" /> <!-- For the settings StackPanel -->
|
|
</Grid.ColumnDefinitions>
|
|
<ItemsControl ItemsSource="{Binding Seasons}" HorizontalAlignment="Center">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate DataType="{x:Type structs:SeasonViewModel}">
|
|
<Button
|
|
Width="120"
|
|
Height="50"
|
|
HorizontalContentAlignment="Center"
|
|
Command="{Binding $parent[UserControl].((vm:UpcomingPageViewModel)DataContext).SelectSeasonCommand}"
|
|
CommandParameter="{Binding}"
|
|
Margin="5">
|
|
|
|
<Button.Content>
|
|
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center">
|
|
<TextBlock IsVisible="{Binding IsSelected}" Text="{Binding Season}" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" />
|
|
<TextBlock IsVisible="{Binding !IsSelected}" Foreground="Gray" Text="{Binding Season}" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" />
|
|
<TextBlock Text="{Binding Year}" FontSize="12" HorizontalAlignment="Center" />
|
|
</StackPanel>
|
|
</Button.Content>
|
|
|
|
</Button>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
|
|
<StackPanel Grid.Column="1" Margin="10" HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal">
|
|
|
|
<ToggleButton Width="50" Height="50" BorderThickness="0" Margin="0 0"
|
|
VerticalAlignment="Center"
|
|
IsChecked="{Binding ShowCrFetches}"
|
|
IsEnabled="{Binding !IsLoading}">
|
|
<StackPanel Orientation="Vertical">
|
|
<controls:ImageIcon Source="../Assets/crunchy_icon_round.png" Width="25" Height="25" />
|
|
<TextBlock Text="CR" TextWrapping="Wrap" HorizontalAlignment="Center" FontSize="12"></TextBlock>
|
|
<ToolTip.Tip>
|
|
<TextBlock Text="Fetch Crunchyroll shows and append missing entries. This may create duplicates" FontSize="15" />
|
|
</ToolTip.Tip>
|
|
</StackPanel>
|
|
</ToggleButton>
|
|
|
|
<ToggleButton Width="50" Height="50" BorderThickness="0" Margin="5 0"
|
|
VerticalAlignment="Center"
|
|
IsChecked="{Binding QuickAddMode}"
|
|
IsEnabled="{Binding !IsLoading}">
|
|
<StackPanel Orientation="Vertical">
|
|
<controls:SymbolIcon Symbol="Add" FontSize="25" />
|
|
<TextBlock Text="Fast" TextWrapping="Wrap" HorizontalAlignment="Center" FontSize="12"></TextBlock>
|
|
</StackPanel>
|
|
</ToggleButton>
|
|
|
|
<StackPanel>
|
|
<ToggleButton x:Name="DropdownButtonSorting" Width="50" Height="50"
|
|
BorderThickness="0" VerticalAlignment="Center"
|
|
IsEnabled="{Binding !IsLoading}"
|
|
IsChecked="{Binding SortingSelectionOpen}">
|
|
<StackPanel Orientation="Vertical">
|
|
<controls:SymbolIcon Symbol="Sort" FontSize="25" />
|
|
<TextBlock Text="Sort" HorizontalAlignment="Center" FontSize="12"></TextBlock>
|
|
</StackPanel>
|
|
</ToggleButton>
|
|
<Popup IsLightDismissEnabled="True"
|
|
IsOpen="{Binding IsChecked, ElementName=DropdownButtonSorting, Mode=TwoWay}"
|
|
Placement="BottomEdgeAlignedRight"
|
|
PlacementTarget="{Binding ElementName=DropdownButtonSorting}">
|
|
<Border BorderThickness="1" Background="{DynamicResource ComboBoxDropDownBackground}">
|
|
<ListBox SelectionMode="Single,Toggle" Width="210"
|
|
MaxHeight="400"
|
|
ItemsSource="{Binding SortingList}" SelectedItem="{Binding SelectedSorting}">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
|
|
<controls:SymbolIcon IsVisible="{Binding !$parent[UserControl].((vm:UpcomingPageViewModel)DataContext).SortDir}" Symbol="ChevronUp" FontSize="12" Margin="0 0 10 0" />
|
|
<controls:SymbolIcon IsVisible="{Binding $parent[UserControl].((vm:UpcomingPageViewModel)DataContext).SortDir}" Symbol="ChevronDown" FontSize="12" Margin="0 0 10 0" />
|
|
<TextBlock Text="{Binding SortingTitle}"></TextBlock>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</Border>
|
|
</Popup>
|
|
</StackPanel>
|
|
|
|
|
|
<!-- <ToggleButton x:Name="CalendarSettings" HorizontalContentAlignment="Stretch"> -->
|
|
<!-- <StackPanel Orientation="Horizontal"> -->
|
|
<!-- <controls:SymbolIcon Symbol="Settings" FontSize="18" /> -->
|
|
<!-- </StackPanel> -->
|
|
<!-- </ToggleButton> -->
|
|
<!-- <Popup IsLightDismissEnabled="True" -->
|
|
<!-- MaxWidth="400" -->
|
|
<!-- MaxHeight="600" -->
|
|
<!-- IsOpen="{Binding IsChecked, ElementName=CalendarSettings, Mode=TwoWay}" -->
|
|
<!-- Placement="Bottom" -->
|
|
<!-- PlacementTarget="{Binding ElementName=CalendarSettings}"> -->
|
|
<!-- <Border BorderThickness="1" Background="{DynamicResource ComboBoxDropDownBackground}"> -->
|
|
<!-- -->
|
|
<!-- <StackPanel> -->
|
|
<!-- -->
|
|
<!-- </StackPanel> -->
|
|
<!-- -->
|
|
<!-- </Border> -->
|
|
<!-- </Popup> -->
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
|
|
<ListBox Grid.Row="1" IsVisible="{Binding !IsLoading}" ItemsSource="{Binding SelectedSeason}"
|
|
SelectedItem="{Binding SelectedSeries, Mode=TwoWay}" SelectedIndex="{Binding SelectedIndex}" SelectionChanged="SelectionChanged"
|
|
Margin="5">
|
|
|
|
<ListBox.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel Orientation="Horizontal"></WrapPanel>
|
|
</ItemsPanelTemplate>
|
|
</ListBox.ItemsPanel>
|
|
|
|
<!-- <ListBox.Styles> -->
|
|
<!-- <Style Selector="ListBoxItem:selected /template/ ContentPresenter"> -->
|
|
<!-- <Setter Property="Background" Value="Transparent"/> -->
|
|
<!-- </Style> -->
|
|
<!-- <Style Selector="ListBoxItem:selected /template/ Rectangle"> -->
|
|
<!-- <Setter Property="IsVisible" Value="False"/> -->
|
|
<!-- </Style> -->
|
|
<!-- </ListBox.Styles> -->
|
|
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
|
|
<Grid >
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="185" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
<Expander Grid.Column="0" Grid.ColumnSpan="2" ExpandDirection="Right" IsExpanded="{Binding IsExpanded}" IsVisible="{Binding !$parent[UserControl].((vm:UpcomingPageViewModel)DataContext).QuickAddMode}">
|
|
<Expander.Styles>
|
|
<Style Selector="Expander:not(:expanded) /template/ ToggleButton#ExpanderHeader">
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="BorderBrush" Value="Transparent" />
|
|
</Style>
|
|
<Style Selector="Expander:expanded /template/ ToggleButton#ExpanderHeader">
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="BorderBrush" Value="Transparent" />
|
|
</Style>
|
|
<Style Selector="ToggleButton:pointerover /template/ Border#ExpandCollapseChevronBorder">
|
|
<Setter Property="Background" Value="Transparent" />
|
|
</Style>
|
|
<Style Selector="ToggleButton:not(:checked) /template/ TextBlock#ExpandCollapseChevron">
|
|
<Setter Property="Foreground" Value="Transparent" />
|
|
</Style>
|
|
<Style Selector="ToggleButton:checked /template/ TextBlock#ExpandCollapseChevron">
|
|
<Setter Property="Foreground" Value="Transparent" />
|
|
</Style>
|
|
</Expander.Styles>
|
|
<Expander.Header>
|
|
<Border Width="117" Height="315" />
|
|
</Expander.Header>
|
|
<Expander.Content>
|
|
|
|
<StackPanel>
|
|
|
|
<ScrollViewer MaxHeight="265" MinHeight="265" PointerWheelChanged="ScrollViewer_PointerWheelChanged" Margin="0 0 0 5">
|
|
<TextBlock HorizontalAlignment="Center" TextAlignment="Center"
|
|
Text="{Binding Description}"
|
|
TextWrapping="Wrap"
|
|
Width="185"
|
|
FontSize="16"
|
|
Margin="5">
|
|
</TextBlock>
|
|
</ScrollViewer>
|
|
|
|
|
|
<Grid MaxWidth="185" IsVisible="{Binding AudioLocales, Converter={StaticResource UiListHasElementsConverter}}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- Dubs -->
|
|
<TextBlock Grid.Row="0" Grid.Column="0"
|
|
FontStyle="Italic"
|
|
FontSize="12"
|
|
Opacity="0.8"
|
|
Text="Dubs: " />
|
|
<TextBlock Grid.Row="0" Grid.Column="1"
|
|
FontStyle="Italic"
|
|
FontSize="12"
|
|
Opacity="0.8"
|
|
Text="{Binding AudioLocales, Converter={StaticResource UiListToStringConverter}}"
|
|
TextWrapping="NoWrap" />
|
|
|
|
<!-- Subs -->
|
|
<TextBlock Grid.Row="1" Grid.Column="0"
|
|
FontStyle="Italic"
|
|
FontSize="12"
|
|
Opacity="0.8"
|
|
Text="Subs: " />
|
|
<TextBlock Grid.Row="1" Grid.Column="1"
|
|
FontStyle="Italic"
|
|
FontSize="12"
|
|
Opacity="0.8"
|
|
Text="{Binding SubtitleLocales, Converter={StaticResource UiListToStringConverter}}"
|
|
TextWrapping="NoWrap" />
|
|
|
|
<ToolTip.Tip>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- Dubs -->
|
|
<TextBlock Grid.Row="0" Grid.Column="0"
|
|
FontSize="17"
|
|
Text="Dubs: " />
|
|
<TextBlock Grid.Row="0" Grid.Column="1"
|
|
FontSize="17"
|
|
Text="{Binding AudioLocales, Converter={StaticResource UiListToStringConverter}}"
|
|
TextWrapping="Wrap" />
|
|
|
|
<!-- Subs -->
|
|
<TextBlock Grid.Row="1" Grid.Column="0"
|
|
FontSize="17"
|
|
Text="Subs: " />
|
|
<TextBlock Grid.Row="1" Grid.Column="1"
|
|
FontSize="17"
|
|
Text="{Binding SubtitleLocales, Converter={StaticResource UiListToStringConverter}}"
|
|
TextWrapping="Wrap" />
|
|
|
|
|
|
</Grid>
|
|
</ToolTip.Tip>
|
|
</Grid>
|
|
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom">
|
|
<Button HorizontalAlignment="Right" VerticalAlignment="Bottom" IsVisible="{Binding Trailer}" Content="Trailer" Margin=" 0 0 5 0"
|
|
Command="{Binding $parent[UserControl].((vm:UpcomingPageViewModel)DataContext).OpenTrailer}"
|
|
CommandParameter="{Binding}">
|
|
</Button>
|
|
<StackPanel IsVisible="{Binding HasCrID}">
|
|
<Button HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
|
IsVisible="{Binding !IsInHistory}"
|
|
Command="{Binding $parent[UserControl].((vm:UpcomingPageViewModel)DataContext).AddToHistory}"
|
|
CommandParameter="{Binding}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<controls:SymbolIcon Symbol="Library" FontSize="20" />
|
|
<controls:SymbolIcon Symbol="Add" FontSize="20" />
|
|
</StackPanel>
|
|
</Button>
|
|
</StackPanel>
|
|
|
|
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Expander.Content>
|
|
</Expander>
|
|
|
|
|
|
<StackPanel Grid.Column="0" Orientation="Vertical" HorizontalAlignment="Center"
|
|
Width="185"
|
|
Height="315"
|
|
Margin="5">
|
|
<Grid>
|
|
<Image Source="{Binding ThumbnailImage}"
|
|
Width="185"
|
|
Height="265">
|
|
</Image>
|
|
|
|
<StackPanel VerticalAlignment="Top" HorizontalAlignment="Right"
|
|
IsVisible="{Binding IsInHistory}" Margin="0 5 5 5">
|
|
<Border Background="DarkGray" CornerRadius="50">
|
|
<controls:SymbolIcon Symbol="Library" Foreground="Black" FontSize="22" Margin="2" />
|
|
<ToolTip.Tip>
|
|
<TextBlock Text="Series is in History" FontSize="15" />
|
|
</ToolTip.Tip>
|
|
</Border>
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
<TextBlock HorizontalAlignment="Center" TextAlignment="Center"
|
|
Text="{Binding Title.English}"
|
|
TextWrapping="Wrap"
|
|
Width="185"
|
|
FontSize="12"
|
|
Height="35"
|
|
Margin="4,0,4,0">
|
|
<ToolTip.Tip>
|
|
<TextBlock Text="{Binding Title.English}" FontSize="15" />
|
|
</ToolTip.Tip>
|
|
</TextBlock>
|
|
|
|
<TextBlock HorizontalAlignment="Center" TextAlignment="Center"
|
|
Text="{Binding StartDateForm}"
|
|
TextWrapping="Wrap"
|
|
Width="185"
|
|
FontSize="12"
|
|
MaxHeight="20"
|
|
Margin="4,0,4,0">
|
|
<ToolTip.Tip>
|
|
<TextBlock Text="{Binding StartDateForm}" FontSize="15" />
|
|
</ToolTip.Tip>
|
|
</TextBlock>
|
|
|
|
</StackPanel>
|
|
|
|
|
|
<Grid Grid.Column="0" Grid.ColumnSpan="2" IsVisible="{Binding $parent[UserControl].((vm:UpcomingPageViewModel)DataContext).QuickAddMode}"
|
|
Background="#90000000"
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
|
|
|
|
|
<Button
|
|
Background="Transparent"
|
|
IsVisible="{Binding !IsInHistory}"
|
|
BorderThickness="0"
|
|
FontStyle="Italic"
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
|
Command="{Binding $parent[UserControl].((vm:UpcomingPageViewModel)DataContext).AddToHistory}"
|
|
CommandParameter="{Binding}"
|
|
IsEnabled="{Binding HasCrID}">
|
|
<ToolTip.Tip>
|
|
<TextBlock Text="Add to history" FontSize="15" />
|
|
</ToolTip.Tip>
|
|
<StackPanel Orientation="Horizontal">
|
|
<controls:SymbolIcon Symbol="Library" FontSize="32" IsVisible="{Binding HasCrID}" />
|
|
<controls:SymbolIcon Symbol="Add" FontSize="32" IsVisible="{Binding HasCrID}" />
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
|
|
<Button
|
|
Background="Transparent"
|
|
IsVisible="{Binding IsInHistory}"
|
|
BorderThickness="0"
|
|
FontStyle="Italic"
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
|
IsEnabled="False">
|
|
<ToolTip.Tip>
|
|
<TextBlock Text="Already in history" FontSize="15" />
|
|
</ToolTip.Tip>
|
|
<StackPanel Orientation="Horizontal">
|
|
<controls:SymbolIcon Symbol="Library" FontSize="32" />
|
|
</StackPanel>
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
|
|
<controls:ProgressRing Grid.Row="1" IsVisible="{Binding IsLoading}" VerticalAlignment="Center" HorizontalAlignment="Center" Width="100" Height="100"></controls:ProgressRing>
|
|
|
|
</Grid>
|
|
</UserControl> |