Skip to content

Commit

Permalink
Add Display a marker in the queue view indicating a rescan
Browse files Browse the repository at this point in the history
- Either using the 'Force rescan' blog option or as long as the LastId of the blog is 0, a full rescan of the blog will be performed.
- Since this can take a long time depending on the crawler and blog size, a marker ("[F]") is displayed after the blog name in the queue.
  • Loading branch information
thomas694 committed Jul 30, 2024
1 parent 1fa0f1c commit 2082363
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Globalization;
using System.Windows.Data;

namespace TumblThree.Presentation.Converters
{
public class BlogQueueIndicatorConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
return values is null || values.Length < 2 ? "" : $"{((bool)values[0] || (ulong)values[1] == 0 ? "[F]" : "")}";
}

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) =>
throw new NotSupportedException();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

<c:BlogQueueProgressConverter x:Key="BlogQueueProgressConverter" />

<c:BlogQueueIndicatorConverter x:Key="BlogQueueIndicatorConverter" />

<c:StatusToBoolConverter x:Key="StatusToBoolConverter" />

<c:TotalImageConverter x:Key="TotalImageConverter" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
<Compile Include="Controls\InsertMarkerAdorner.cs" />
<Compile Include="Controls\ListBoxDragDropHelper.cs" />
<Compile Include="Controls\SelectableTextBlock.cs" />
<Compile Include="Converters\BlogQueueIndicatorConverter.cs" />
<Compile Include="Converters\BlogQueueInfoConverter.cs" />
<Compile Include="Converters\BlogQueueProgressConverter.cs" />
<Compile Include="Converters\BlogTitleConverter.cs" />
Expand Down
12 changes: 11 additions & 1 deletion src/TumblThree/TumblThree.Presentation/Views/QueueView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="15" />
<ColumnDefinition Width="65" />
<ColumnDefinition Width="3" />
</Grid.ColumnDefinitions>
Expand Down Expand Up @@ -131,9 +132,18 @@
</ctrl:SearchableTextBlock.Text>
</ctrl:SearchableTextBlock>

<TextBlock FontWeight="SemiBold" Grid.Row="1" Grid.Column="2">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource BlogQueueIndicatorConverter}">
<Binding Path="Blog.ForceRescan" />
<Binding Path="Blog.LastId" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>

<ctrl:Rating Value="{Binding Blog.Rating, Converter={StaticResource RatingToStarsConverter}}"
Height="11"
HorizontalAlignment="Right" Grid.Row="1" Grid.Column="2" />
HorizontalAlignment="Right" Grid.Row="1" Grid.Column="3" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
Expand Down

0 comments on commit 2082363

Please sign in to comment.