Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Commit

Permalink
> Fix filtering for And mode
Browse files Browse the repository at this point in the history
  • Loading branch information
trueromanus committed Mar 4, 2020
1 parent 52ee4f3 commit b530d6c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Anilibria/Pages/Releases/ReleasesView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,8 @@
Grid.Column="1"
Margin="2 16 6 0">
<Grid
Tapped="ReleaseName_Tapped">
Tapped="ReleaseName_Tapped"
RightTapped="Grid_RightTapped">
<TextBlock
converters:BackgroundThemeConverter.TextMapper="TextBlockAccent"
Text="{Binding OpenedRelease.Title}"
Expand Down Expand Up @@ -1908,7 +1909,7 @@
/>
<Grid
Margin="0 2 0 0"
Tapped="ReleaseName_Tapped">
RightTapped="Grid_RightTapped">
<ScrollViewer
x:Name="CardDescription"
MaxHeight="190">
Expand Down
2 changes: 2 additions & 0 deletions src/Anilibria/Pages/Releases/ReleasesView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ private void OpenInExternalPlayer_Tapped ( object sender , TappedRoutedEventArgs

private void ResetNewTorrentsNotification_Tapped ( object sender , TappedRoutedEventArgs e ) => m_ViewModel.ResetNewTorrentNotificationCommand.Execute ( null );

private void Grid_RightTapped ( object sender , RightTappedRoutedEventArgs e ) => FlyoutBase.ShowAttachedFlyout ( sender as FrameworkElement );

}

}
4 changes: 2 additions & 2 deletions src/Anilibria/Pages/Releases/ReleasesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1615,8 +1615,8 @@ private bool ContainsInArrayCaseSensitive ( string filter , IEnumerable<string>
}

private bool AllInArrayCaseSensitive ( IEnumerable<string> filterValues , IEnumerable<string> originalValues ) {
var processedFilterValues = filterValues.Select ( a => a.Replace ( "ё" , "е" ) ).ToList ();
var processedOriginalValues = originalValues.Where ( a => a != null ).Select ( a => a.Replace ( "ё" , "е" ) ).ToList ();
var processedFilterValues = filterValues.Select ( a => a.Replace ( "ё" , "е" ).ToLowerInvariant() ).ToList ();
var processedOriginalValues = originalValues.Where ( a => a != null ).Select ( a => a.Replace ( "ё" , "е" ).ToLowerInvariant () ).ToList ();

return processedFilterValues.All ( a => processedOriginalValues.Any ( b => b.Contains ( a ) ) );
}
Expand Down

0 comments on commit b530d6c

Please sign in to comment.