From b95edde7dfdd90d933f56f7031675a644f806464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Marchal?= Date: Fri, 18 Nov 2022 02:17:06 +0100 Subject: [PATCH] Shuffle translation fixes --- Handlers/ShuffleHandler.cs | 2 ++ Views/Shuffle.xaml | 4 ++-- Views/Shuffle.xaml.cs | 22 +++++++++++----------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Handlers/ShuffleHandler.cs b/Handlers/ShuffleHandler.cs index b3199d2..c1838c6 100644 --- a/Handlers/ShuffleHandler.cs +++ b/Handlers/ShuffleHandler.cs @@ -81,6 +81,7 @@ namespace unison AddedSongs++; } + commandList.Add(new PlayCommand(0)); await _mpd.SafelySendCommandAsync(commandList); } // more available songs than requested => @@ -101,6 +102,7 @@ namespace unison AddedSongs++; } + commandList.Add(new PlayCommand(0)); await _mpd.SafelySendCommandAsync(commandList); } } diff --git a/Views/Shuffle.xaml b/Views/Shuffle.xaml index ff23f8c..310cd0d 100644 --- a/Views/Shuffle.xaml +++ b/Views/Shuffle.xaml @@ -77,7 +77,7 @@ - + @@ -99,7 +99,7 @@ - + diff --git a/Views/Shuffle.xaml.cs b/Views/Shuffle.xaml.cs index 5ea949c..a218931 100644 --- a/Views/Shuffle.xaml.cs +++ b/Views/Shuffle.xaml.cs @@ -126,26 +126,26 @@ namespace unison private static ITag FilterEquivalence_Type(string value) { - if (value == "Song") + if (value == unison.Resources.Resources.FilterType_Song) return MpdTags.Title; - else if (value == "Artist") + else if (value == unison.Resources.Resources.FilterType_Artist) return MpdTags.Artist; - else if (value == "Album") + else if (value == unison.Resources.Resources.FilterType_Album) return MpdTags.Album; - else if (value == "Year") + else if (value == unison.Resources.Resources.FilterType_Year) return MpdTags.Date; - else if (value == "Genre") + else if (value == unison.Resources.Resources.FilterType_Genre) return MpdTags.Genre; return MpdTags.Title; } private static FilterOperator FilterEquivalence_Operator(string value) { - if (value == "contains") + if (value == unison.Resources.Resources.Operator_Contains) return FilterOperator.Contains; - else if (value == "is") + else if (value == unison.Resources.Resources.Operator_Is) return FilterOperator.Equal; - else if (value == "is not") + else if (value == unison.Resources.Resources.Operator_IsNot) return FilterOperator.Different; return FilterOperator.Equal; } @@ -180,9 +180,9 @@ namespace unison private void FilterType_SelectionChanged(object sender, SelectionChangedEventArgs e) { string item = e.AddedItems[0].ToString(); - if (item == "Genre") + if (item == unison.Resources.Resources.FilterType_Genre) FilterType_Change(sender, "OperatorTypeB", GenreList); - else if (item == "Directory") + else if (item == unison.Resources.Resources.FilterType_Directory) FilterType_Change(sender, "OperatorTypeC", FolderList); else { @@ -258,7 +258,7 @@ namespace unison { if (child.Name == "FilterType") { - if (child.SelectedItem.ToString() == "Directory") + if (child.SelectedItem.ToString() == unison.Resources.Resources.FilterType_Directory) isDir = true; else tag = FilterEquivalence_Type(child.SelectedItem.ToString());