Refactor, rename the concept of "download media" to "download assets", including related mentions

This commit is contained in:
Tyrrrz
2022-10-29 17:39:53 +03:00
parent 1131f8659d
commit 560a069c35
18 changed files with 168 additions and 120 deletions

View File

@@ -16,7 +16,7 @@ public partial class SettingsService : SettingsManager
public int ParallelLimit { get; set; } = 1;
public bool ShouldReuseMedia { get; set; }
public bool ShouldReuseAssets { get; set; }
public string? LastToken { get; set; }
@@ -26,7 +26,7 @@ public partial class SettingsService : SettingsManager
public string? LastMessageFilterValue { get; set; }
public bool LastShouldDownloadMedia { get; set; }
public bool LastShouldDownloadAssets { get; set; }
public SettingsService()
{

View File

@@ -186,8 +186,8 @@ public class DashboardViewModel : PropertyChangedBase
dialog.Before?.Pipe(Snowflake.FromDate),
dialog.PartitionLimit,
dialog.MessageFilter,
dialog.ShouldDownloadMedia,
_settingsService.ShouldReuseMedia,
dialog.ShouldDownloadAssets,
_settingsService.ShouldReuseAssets,
_settingsService.DateFormat
);

View File

@@ -59,7 +59,7 @@ public class ExportSetupViewModel : DialogScreen
? MessageFilter.Parse(MessageFilterValue)
: MessageFilter.Null;
public bool ShouldDownloadMedia { get; set; }
public bool ShouldDownloadAssets { get; set; }
public bool IsAdvancedSectionDisplayed { get; set; }
@@ -72,7 +72,7 @@ public class ExportSetupViewModel : DialogScreen
SelectedFormat = _settingsService.LastExportFormat;
PartitionLimitValue = _settingsService.LastPartitionLimitValue;
MessageFilterValue = _settingsService.LastMessageFilterValue;
ShouldDownloadMedia = _settingsService.LastShouldDownloadMedia;
ShouldDownloadAssets = _settingsService.LastShouldDownloadAssets;
// Show the "advanced options" section by default if any
// of the advanced options are set to non-default values.
@@ -81,7 +81,7 @@ public class ExportSetupViewModel : DialogScreen
Before != default ||
!string.IsNullOrWhiteSpace(PartitionLimitValue) ||
!string.IsNullOrWhiteSpace(MessageFilterValue) ||
ShouldDownloadMedia != default;
ShouldDownloadAssets != default;
}
public void ToggleAdvancedSection() => IsAdvancedSectionDisplayed = !IsAdvancedSectionDisplayed;
@@ -92,7 +92,7 @@ public class ExportSetupViewModel : DialogScreen
_settingsService.LastExportFormat = SelectedFormat;
_settingsService.LastPartitionLimitValue = PartitionLimitValue;
_settingsService.LastMessageFilterValue = MessageFilterValue;
_settingsService.LastShouldDownloadMedia = ShouldDownloadMedia;
_settingsService.LastShouldDownloadAssets = ShouldDownloadAssets;
// If single channel - prompt file path
if (IsSingleChannel)

View File

@@ -38,10 +38,10 @@ public class SettingsViewModel : DialogScreen
set => _settingsService.ParallelLimit = Math.Clamp(value, 1, 10);
}
public bool ShouldReuseMedia
public bool ShouldReuseAssets
{
get => _settingsService.ShouldReuseMedia;
set => _settingsService.ShouldReuseMedia = value;
get => _settingsService.ShouldReuseAssets;
set => _settingsService.ShouldReuseAssets = value;
}
public SettingsViewModel(SettingsService settingsService) =>

View File

@@ -167,8 +167,8 @@
Text="{Binding MessageFilterValue}"
ToolTip="Only include messages that satisfy this filter (e.g. 'from:foo#1234' or 'has:image')." />
<!-- Download media -->
<Grid Margin="16,16" ToolTip="Download referenced media content (user avatars, attached files, embedded images, etc)">
<!-- Download assets -->
<Grid Margin="16,16" ToolTip="Download assets referenced by the export (user avatars, attached files, embedded images, etc.)">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
@@ -177,12 +177,12 @@
<TextBlock
Grid.Column="0"
VerticalAlignment="Center"
Text="Download media" />
Text="Download assets" />
<ToggleButton
Grid.Column="1"
HorizontalAlignment="Right"
VerticalAlignment="Center"
IsChecked="{Binding ShouldDownloadMedia}" />
IsChecked="{Binding ShouldDownloadAssets}" />
</Grid>
</StackPanel>
</StackPanel>

View File

@@ -82,20 +82,20 @@
IsChecked="{Binding IsTokenPersisted}" />
</DockPanel>
<!-- Reuse media -->
<!-- Reuse assets -->
<DockPanel
Margin="16,8"
Background="Transparent"
LastChildFill="False"
ToolTip="Reuse already existing media content to skip redundant downloads">
ToolTip="Reuse previously downloaded assets to avoid redundant requests">
<TextBlock
VerticalAlignment="Center"
DockPanel.Dock="Left"
Text="Reuse downloaded media" />
Text="Reuse downloaded assets" />
<ToggleButton
VerticalAlignment="Center"
DockPanel.Dock="Right"
IsChecked="{Binding ShouldReuseMedia}" />
IsChecked="{Binding ShouldReuseAssets}" />
</DockPanel>
<!-- Date format -->