]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video.ts
Fix error logging
[github/Chocobozzz/PeerTube.git] / server / models / video / video.ts
index 629051ae46c24af0b3747a897e6014b848f10667..47d3cad1de4791205a609242e214eae5801bc320 100644 (file)
@@ -553,7 +553,7 @@ transcodeVideofile = function (this: VideoInstance) {
           .catch(err => {
             // Autodesctruction...
             video.destroy().asCallback(function (err) {
-              if (err) logger.error('Cannot destruct video after transcoding failure.', { error: err })
+              if (err) logger.error('Cannot destruct video after transcoding failure.', err)
             })
 
             return rej(err)
@@ -730,28 +730,28 @@ searchAndPopulateAuthorAndPodAndTags = function (value: string, field: string, s
       `(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 + '%'
     }
   }
 
@@ -759,10 +759,6 @@ searchAndPopulateAuthorAndPodAndTags = function (value: string, field: string, s
     authorInclude, tagInclude
   ]
 
-  if (tagInclude.where) {
-    // query.include.push([ Video['sequelize'].models.Tag ])
-  }
-
   return Video.findAndCountAll(query).then(({ rows, count }) => {
     return {
       data: rows,