();
+ ///
+ /// The previous format string used by filename to tag
+ ///
+ public string PreviousFTTFormatString => Configuration.Current.PreviousFTTFormatString;
+ ///
+ /// The previous format string used by tag to filename
+ ///
+ public string PreviousTTFFormatString => Configuration.Current.PreviousTTFFormatString;
///
/// Occurs when a notification is sent
@@ -969,6 +977,8 @@ await Task.Run(() =>
if (success > 0)
{
UpdateSelectedMusicFilesProperties();
+ Configuration.Current.PreviousFTTFormatString = formatString;
+ Aura.Active.SaveConfig("config");
}
MusicFileSaveStatesChanged?.Invoke(this, MusicFileSaveStates.Any(x => !x));
NotificationSent?.Invoke(this, new NotificationSentEventArgs(_n("Converted {0} file name to tag successfully", "Converted {0} file names to tags successfully", success, success), NotificationSeverity.Success, "format"));
@@ -1003,6 +1013,8 @@ await Task.Run(() =>
if (success > 0)
{
UpdateSelectedMusicFilesProperties();
+ Configuration.Current.PreviousTTFFormatString = formatString;
+ Aura.Active.SaveConfig("config");
}
MusicFileSaveStatesChanged?.Invoke(this, MusicFileSaveStates.Any(x => !x));
NotificationSent?.Invoke(this, new NotificationSentEventArgs(_n("Converted {0} tag to file name successfully", "Converted {0} tags to file names successfully", success, success), NotificationSeverity.Success, "format"));
diff --git a/NickvisionTagger.Shared/Models/Configuration.cs b/NickvisionTagger.Shared/Models/Configuration.cs
index b94633f2..3d1e2663 100644
--- a/NickvisionTagger.Shared/Models/Configuration.cs
+++ b/NickvisionTagger.Shared/Models/Configuration.cs
@@ -85,6 +85,14 @@ public class Configuration : ConfigurationBase
///
public string AcoustIdUserAPIKey { get; set; }
///
+ /// The previous format string used by filename to tag
+ ///
+ public string PreviousFTTFormatString { get; set; }
+ ///
+ /// The previous format string used by tag to filename
+ ///
+ public string PreviousTTFFormatString { get; set; }
+ ///
/// Whether or not to show the Extras Pane
///
/// Used on WinUI only
@@ -110,6 +118,8 @@ public Configuration()
OverwriteAlbumArtWithMusicBrainz = true;
OverwriteLyricsWithWebService = true;
AcoustIdUserAPIKey = "";
+ PreviousFTTFormatString = "";
+ PreviousTTFFormatString = "";
ExtrasPane = true;
}
diff --git a/NickvisionTagger.Shared/org.nickvision.tagger.metainfo.xml.in b/NickvisionTagger.Shared/org.nickvision.tagger.metainfo.xml.in
index 0811d233..c07dfd24 100644
--- a/NickvisionTagger.Shared/org.nickvision.tagger.metainfo.xml.in
+++ b/NickvisionTagger.Shared/org.nickvision.tagger.metainfo.xml.in
@@ -48,6 +48,7 @@
- Added an option in Preferences to limit file name characters to those only supported by Windows
- Tagger will now watch a music folder library for changes on disk and prompt the user to reload if necessary
- Tagger will now display front album art within a music file row itself if available
+ - Tagger will now remember previously used format strings for file name to tag and tag to file name conversions
- Fixed an issue where downloaded lyrics would sometimes contain html encoded characters
- Fixed an issue where file names containing the less than character caused the music file row to not display
- Improved create playlist dialog ux
diff --git a/NickvisionTagger.WinUI/App.xaml.cs b/NickvisionTagger.WinUI/App.xaml.cs
index 890ab297..537f1cb3 100644
--- a/NickvisionTagger.WinUI/App.xaml.cs
+++ b/NickvisionTagger.WinUI/App.xaml.cs
@@ -29,6 +29,7 @@ public App()
- Added information dialog for album art
- Tagger will now watch a music folder library for changes on disk and prompt the user to reload if necessary
- Tagger will now display front album art within a music file row itself if available
+- Tagger will now remember previously used format strings for file name to tag and tag to file name conversions
- Fixed an issue where downloaded lyrics would sometimes contain html encoded characters
- Improved create playlist dialog ux
- Updated translations (Thanks everyone on Weblate!)";
diff --git a/NickvisionTagger.WinUI/Controls/ComboBoxDialog.xaml.cs b/NickvisionTagger.WinUI/Controls/ComboBoxDialog.xaml.cs
index e9ff29e6..587da9d9 100644
--- a/NickvisionTagger.WinUI/Controls/ComboBoxDialog.xaml.cs
+++ b/NickvisionTagger.WinUI/Controls/ComboBoxDialog.xaml.cs
@@ -23,9 +23,10 @@ public sealed partial class ComboBoxDialog : ContentDialog
/// The title of the choices of the dialog
/// The choices of the dialog
/// Whether or not a custom entry is supported
+ /// The previous choice used if available
/// The text of the close button
/// The text of the primary button
- public ComboBoxDialog(string title, string message, string choicesTitle, string[] choices, bool supportCustom, string closeText, string primaryText)
+ public ComboBoxDialog(string title, string message, string choicesTitle, string[] choices, bool supportCustom, string? previousChoice, string closeText, string primaryText)
{
InitializeComponent();
_choices = choices;
@@ -51,6 +52,17 @@ public ComboBoxDialog(string title, string message, string choicesTitle, string[
CardCustom.Header = _("Custom");
TxtCustom.PlaceholderText = _("Enter custom choice here");
CmbChoices.SelectedIndex = 0;
+ //Load Previous
+ var previous = Array.IndexOf(_choices, previousChoice);
+ if (previous != -1)
+ {
+ CmbChoices.SelectedIndex = previous;
+ }
+ else if (!string.IsNullOrEmpty(previousChoice))
+ {
+ CmbChoices.SelectedIndex = _choices.Length - 1;
+ TxtCustom.Text = previousChoice;
+ }
}
///
diff --git a/NickvisionTagger.WinUI/Views/MainWindow.xaml.cs b/NickvisionTagger.WinUI/Views/MainWindow.xaml.cs
index 702f3311..70513aec 100644
--- a/NickvisionTagger.WinUI/Views/MainWindow.xaml.cs
+++ b/NickvisionTagger.WinUI/Views/MainWindow.xaml.cs
@@ -1120,7 +1120,7 @@ private async void AddCustomProperty(object sender, RoutedEventArgs e)
/// RoutedEventArgs
private async void FilenameToTag(object sender, RoutedEventArgs e)
{
- var dialog = new ComboBoxDialog(_("File Name to Tag"), _("Please select a format string."), _("Format String"), _controller.FormatStrings, true, _("Cancel"), _("Convert"))
+ var dialog = new ComboBoxDialog(_("File Name to Tag"), _("Please select a format string."), _("Format String"), _controller.FormatStrings, true, _controller.PreviousFTTFormatString, _("Cancel"), _("Convert"))
{
XamlRoot = MainGrid.XamlRoot
};
@@ -1138,7 +1138,7 @@ private async void FilenameToTag(object sender, RoutedEventArgs e)
/// RoutedEventArgs
private async void TagToFilename(object sender, RoutedEventArgs e)
{
- var dialog = new ComboBoxDialog(_("Tag to File Name"), _("Please select a format string."), _("Format String"), _controller.FormatStrings, true, _("Cancel"), _("Convert"))
+ var dialog = new ComboBoxDialog(_("Tag to File Name"), _("Please select a format string."), _("Format String"), _controller.FormatStrings, true, _controller.PreviousTTFFormatString, _("Cancel"), _("Convert"))
{
XamlRoot = MainGrid.XamlRoot
};