Skip to content

Commit

Permalink
search both ways when searching songs
Browse files Browse the repository at this point in the history
  • Loading branch information
zefanjajobse committed Apr 1, 2024
1 parent 6434d6d commit 5827a51
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions PlanningCenter to OPS/Actions/DrawFormItems.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5827a51

Please sign in to comment.