diff --git a/lib/Db/TimelineQueryFaces.php b/lib/Db/TimelineQueryFaces.php index ddb4b3bf..79242c5c 100644 --- a/lib/Db/TimelineQueryFaces.php +++ b/lib/Db/TimelineQueryFaces.php @@ -19,10 +19,14 @@ trait TimelineQueryFaces { // Get cluster ID $sq = $query->getConnection()->getQueryBuilder(); - $id = $sq->select('id')->from('recognize_face_clusters') - ->where($query->expr()->eq('user_id', $sq->createNamedParameter($faceUid))) - ->andWhere($query->expr()->eq('title', $sq->createNamedParameter($faceName))) - ->executeQuery()->fetchOne(); + $idQuery = $sq->select('id')->from('recognize_face_clusters') + ->where($query->expr()->eq('user_id', $sq->createNamedParameter($faceUid))); + + // If name is a number then it is an ID + $nameField = is_numeric($faceName) ? 'id' : 'title'; + $idQuery->andWhere($query->expr()->eq($nameField, $sq->createNamedParameter($faceName))); + + $id = $idQuery->executeQuery()->fetchOne(); if (!$id) throw new \Exception("Unknown person: $faceStr"); // Join with cluster diff --git a/src/components/Tag.vue b/src/components/Tag.vue index f4fff669..24007408 100644 --- a/src/components/Tag.vue +++ b/src/components/Tag.vue @@ -39,7 +39,6 @@ import { getPreviewUrl } from "../services/FileUtils"; import { NcCounterBubble } from '@nextcloud/vue' -import axios from '@nextcloud/axios' import GlobalMixin from '../mixins/GlobalMixin'; import { constants } from '../services/Utils'; @@ -114,7 +113,7 @@ export default class Tag extends Mixins(GlobalMixin) { /** Open tag */ openTag() { if (this.isFace) { - const name = this.data.name; + const name = this.data.name || this.data.fileid.toString(); const user = this.data.user_id; this.$router.push({ name: 'people', params: { name, user }}); } else { diff --git a/src/services/DavRequests.ts b/src/services/DavRequests.ts index 750cfe15..1f22a85c 100644 --- a/src/services/DavRequests.ts +++ b/src/services/DavRequests.ts @@ -488,7 +488,7 @@ export async function getTagsData(): Promise { count: data.length, detail: data.map((face) => ({ ...face, - fileid: hashCode(face.name), + fileid: face.id, istag: true, isface: true, } as any)),