Generalized filters bar, added to network page.

This commit is contained in:
2019-11-15 02:37:17 +01:00
parent 23492bb5d0
commit 0575dbc7e4
17 changed files with 193 additions and 113 deletions

View File

@@ -77,6 +77,8 @@ function commonQuery(queryBuilder, {
before = new Date(2 ** 44), // May 2109
limit = 100,
}) {
const finalFilter = [].concat(filter); // ensure filter is array
queryBuilder
.leftJoin('sites', 'releases.site_id', 'sites.id')
.leftJoin('studios', 'releases.studio_id', 'studios.id')
@@ -93,7 +95,7 @@ function commonQuery(queryBuilder, {
.select('*')
.from('tags_associated')
.leftJoin('tags', 'tags_associated.tag_id', 'tags.id')
.whereIn('tags.slug', filter)
.whereIn('tags.slug', finalFilter)
.andWhereRaw('tags_associated.release_id = releases.id');
})
.andWhere('date', '>', after)