diff options
| author | Zach DeCook <zachdecook@librem.one> | 2023-01-10 13:00:40 +0000 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2023-01-10 13:00:40 +0000 |
| commit | 653a6c4db19efbbd72c39e7723b06d6ce8291f1a (patch) | |
| tree | a2b59780f7db4f1b52fa68a2f3843cc4d4944c04 /laravel | |
| parent | 8af58ae9f433f6d6d881e77f9128f77ea9deba19 (diff) | |
| download | prosongsa-653a6c4db19efbbd72c39e7723b06d6ce8291f1a.tar.gz | |
Song: Fix searching for "Psalms" => "Psalm"
Diffstat (limited to 'laravel')
| -rw-r--r-- | laravel/app/Song.php | 6 | ||||
| -rw-r--r-- | laravel/composer.lock | 12 |
2 files changed, 8 insertions, 10 deletions
diff --git a/laravel/app/Song.php b/laravel/app/Song.php index e2f2589..c4722a2 100644 --- a/laravel/app/Song.php +++ b/laravel/app/Song.php @@ -18,10 +18,8 @@ class Song extends Model $parser = new BiblePassageParser(); // Can throw an exception. $refs = $parser->parse($passage); - $book = (string)($refs[0]->from()->book()); - $chapter = $refs[0]->from()->chapter(); - - return Song::where('verse', 'LIKE', "$book $chapter:%")->orWhere('verse',"$book $chapter")->orWhere('verse', 'LIKE', "%; $book $chapter:%"); + $bc = explode(':', $refs[0])[0]; + return Song::where('verse', 'LIKE', "$bc:%")->orWhere('verse',"$bc")->orWhere('verse','like',$refs[0].";%")->orWhere('verse', 'LIKE', "%; $bc:%"); } public function textTranspose($key) { diff --git a/laravel/composer.lock b/laravel/composer.lock index 22b53c8..9db0e12 100644 --- a/laravel/composer.lock +++ b/laravel/composer.lock @@ -4521,16 +4521,16 @@ }, { "name": "techwilk/bible-verse-parser", - "version": "2.2.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/TechWilk/bible-verse-parser.git", - "reference": "9edb9a94ac44cb0e4a2815159280c7375cc91f0c" + "reference": "44e8cbeecf60b747f844dd3cd7b5a4ce8015237d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/TechWilk/bible-verse-parser/zipball/9edb9a94ac44cb0e4a2815159280c7375cc91f0c", - "reference": "9edb9a94ac44cb0e4a2815159280c7375cc91f0c", + "url": "https://api.github.com/repos/TechWilk/bible-verse-parser/zipball/44e8cbeecf60b747f844dd3cd7b5a4ce8015237d", + "reference": "44e8cbeecf60b747f844dd3cd7b5a4ce8015237d", "shasum": "" }, "require": { @@ -4568,9 +4568,9 @@ ], "support": { "issues": "https://github.com/TechWilk/bible-verse-parser/issues", - "source": "https://github.com/TechWilk/bible-verse-parser/tree/2.2.0" + "source": "https://github.com/TechWilk/bible-verse-parser/tree/2.3.0" }, - "time": "2022-05-15T20:03:15+00:00" + "time": "2022-09-27T18:58:48+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", |
