From 5827a51449eaf10c92f6d893406a37f78ac02ae0 Mon Sep 17 00:00:00 2001 From: iiTzArcur Date: Mon, 1 Apr 2024 10:56:27 +0200 Subject: [PATCH] search both ways when searching songs --- PlanningCenter to OPS/Actions/DrawFormItems.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PlanningCenter to OPS/Actions/DrawFormItems.cs b/PlanningCenter to OPS/Actions/DrawFormItems.cs index 0bb840f..5fb754f 100644 --- a/PlanningCenter to OPS/Actions/DrawFormItems.cs +++ b/PlanningCenter to OPS/Actions/DrawFormItems.cs @@ -1,5 +1,7 @@ -using System; +using PlanningCenter_to_OPS.Structs; +using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Windows.Forms; @@ -48,7 +50,8 @@ public void Render(Form f) { ComboBox.Items.Add($"{this.Type} {this.SongId}"); } - foreach (var song in OwnSongs.Where(song => SongInfo.attributes.title.ToLower().Contains(song.name))) + string song_lowercase_title = SongInfo.attributes.title.ToLower(); + foreach (var song in OwnSongs.Where(song => song_lowercase_title.Contains(song.name) || song.name.Contains(song_lowercase_title))) { ComboBox.Items.Add($"et {song.id} - {song.name}"); FoundSongs.Add($"et {song.id} - {song.name}", song);