mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 11:47:25 +01:00
library: Only return top-level works
This commit is contained in:
parent
902ad97225
commit
a8c66da52f
1 changed files with 5 additions and 1 deletions
|
|
@ -116,7 +116,11 @@ impl MusicusLibrary {
|
||||||
|
|
||||||
let works: Vec<Work> = works::table
|
let works: Vec<Work> = works::table
|
||||||
.left_join(work_persons::table.inner_join(persons::table))
|
.left_join(work_persons::table.inner_join(persons::table))
|
||||||
.filter(works::name.like(&search).or(persons::name.like(&search)))
|
.filter(
|
||||||
|
works::parent_work_id
|
||||||
|
.is_null()
|
||||||
|
.and(works::name.like(&search).or(persons::name.like(&search))),
|
||||||
|
)
|
||||||
.limit(9)
|
.limit(9)
|
||||||
.select(works::all_columns)
|
.select(works::all_columns)
|
||||||
.distinct()
|
.distinct()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue