#!/usr/bin/env sh
-if [ ! -d "./client/dist" ]; then
- echo "client/dist does not exist, compile client files..."
+if [ ! -f "./client/dist/index.html" ]; then
+ echo "client/dist/index.html does not exist, compile client files..."
npm run build:client
fi
`(SELECT "VideoTags"."videoId"
FROM "Tags"
INNER JOIN "VideoTags" ON "Tags"."id" = "VideoTags"."tagId"
- WHERE name LIKE ${escapedValue}
+ WHERE name ILIKE ${escapedValue}
)`
)
} else if (field === 'host') {
// FIXME: Include our pod? (not stored in the database)
podInclude.where = {
host: {
- $like: '%' + value + '%'
+ $iLike: '%' + value + '%'
}
}
podInclude.required = true
} else if (field === 'author') {
authorInclude.where = {
name: {
- $like: '%' + value + '%'
+ $iLike: '%' + value + '%'
}
}
// authorInclude.or = true
} else {
query.where[field] = {
- $like: '%' + value + '%'
+ $iLike: '%' + value + '%'
}
}
authorInclude, tagInclude
]
- if (tagInclude.where) {
- // query.include.push([ Video['sequelize'].models.Tag ])
- }
-
return Video.findAndCountAll(query).then(({ rows, count }) => {
return {
data: rows,