Fix opening nameless faces
parent
d779a9ea22
commit
e81b7c6d59
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -488,7 +488,7 @@ export async function getTagsData(): Promise<IDay[]> {
|
|||
count: data.length,
|
||||
detail: data.map((face) => ({
|
||||
...face,
|
||||
fileid: hashCode(face.name),
|
||||
fileid: face.id,
|
||||
istag: true,
|
||||
isface: true,
|
||||
} as any)),
|
||||
|
|
Loading…
Reference in New Issue