fix: removed thubmnail and preview paths

Signed-off-by: Varun Raj <mailme@varunraj.in>
This commit is contained in:
Varun Raj committed 2024-08-31 17:14:34 +05:30
1 parent d35c1ca1dd
commit 992f12fc19
6 files changed
-12

No files matched your search

@@ -14,10 +14,8 @@ const SELECT_ORPHAN_PHOTOS = (date: string, ownerId: string) =>
a."deviceId", a."deviceId",
a."type", a."type",
a."originalPath", a."originalPath",
a."previewPath",
a."isFavorite", a."isFavorite",
a."duration", a."duration",
a."thumbnailPath",
a."encodedVideoPath", a."encodedVideoPath",
a."originalFileName", a."originalFileName",
a."sidecarPath", a."sidecarPath",
@@ -38,7 +36,6 @@ const SELECT_ORPHAN_PHOTOS = (date: string, ownerId: string) =>
aaa."albumsId" IS NULL aaa."albumsId" IS NULL
AND a."ownerId" = '${ownerId}' AND a."ownerId" = '${ownerId}'
AND a."localDateTime"::date = '${date}' AND a."localDateTime"::date = '${date}'
AND a."previewPath" IS NOT NULL
`); `);
export default async function handler( export default async function handler(
@@ -33,10 +33,8 @@ export default async function handler(
deviceId: assets.deviceId, deviceId: assets.deviceId,
type: assets.type, type: assets.type,
originalPath: assets.originalPath, originalPath: assets.originalPath,
previewPath: assets.previewPath,
isFavorite: assets.isFavorite, isFavorite: assets.isFavorite,
duration: assets.duration, duration: assets.duration,
thumbnailPath: assets.thumbnailPath,
encodedVideoPath: assets.encodedVideoPath, encodedVideoPath: assets.encodedVideoPath,
originalFileName: assets.originalFileName, originalFileName: assets.originalFileName,
sidecarPath: assets.sidecarPath, sidecarPath: assets.sidecarPath,
@@ -55,7 +53,6 @@ export default async function handler(
lte(exif.dateTimeOriginal, endDateDate), lte(exif.dateTimeOriginal, endDateDate),
eq(assets.type, "VIDEO"), eq(assets.type, "VIDEO"),
eq(assets.ownerId, currentUser.id), eq(assets.ownerId, currentUser.id),
isNotNull(assets.previewPath),
)); ));
return res.status(200).json(rows); return res.status(200).json(rows);
@@ -83,7 +83,6 @@ export default async function handler(
.selectDistinctOn([person.id], { .selectDistinctOn([person.id], {
id: person.id, id: person.id,
name: person.name, name: person.name,
thumbnailPath: person.thumbnailPath,
birthDate: person.birthDate, birthDate: person.birthDate,
isHidden: person.isHidden, isHidden: person.isHidden,
updatedAt: person.updatedAt, updatedAt: person.updatedAt,
-1
View File
@@ -60,7 +60,6 @@ export default async function handler(
.select({ .select({
id: person.id, id: person.id,
name: person.name, name: person.name,
thumbnailPath: person.thumbnailPath,
birthDate: person.birthDate, birthDate: person.birthDate,
isHidden: person.isHidden, isHidden: person.isHidden,
updatedAt: person.updatedAt, updatedAt: person.updatedAt,
-2
View File
@@ -7,12 +7,10 @@ export const assets = pgTable('assets', {
deviceId: varchar('deviceId').notNull(), deviceId: varchar('deviceId').notNull(),
type: varchar('type').notNull(), type: varchar('type').notNull(),
originalPath: varchar('originalPath').notNull(), originalPath: varchar('originalPath').notNull(),
previewPath: varchar('previewPath'),
fileCreatedAt: timestamp('fileCreatedAt', { withTimezone: true }).notNull(), fileCreatedAt: timestamp('fileCreatedAt', { withTimezone: true }).notNull(),
fileModifiedAt: timestamp('fileModifiedAt', { withTimezone: true }).notNull(), fileModifiedAt: timestamp('fileModifiedAt', { withTimezone: true }).notNull(),
isFavorite: boolean('isFavorite').default(false).notNull(), isFavorite: boolean('isFavorite').default(false).notNull(),
duration: varchar('duration'), duration: varchar('duration'),
thumbnailPath: varchar('thumbnailPath').default(''),
encodedVideoPath: varchar('encodedVideoPath').default(''), encodedVideoPath: varchar('encodedVideoPath').default(''),
// checksum: bytea('checksum').notNull(), // checksum: bytea('checksum').notNull(),
isVisible: boolean('isVisible').default(true).notNull(), isVisible: boolean('isVisible').default(true).notNull(),
-2
View File
@@ -4,10 +4,8 @@ export interface IAsset {
deviceId: string; deviceId: string;
type: string; type: string;
originalPath: string; originalPath: string;
previewPath: string;
isFavorite: boolean; isFavorite: boolean;
duration: null; duration: null;
thumbnailPath: string;
encodedVideoPath: string; encodedVideoPath: string;
originalFileName: string; originalFileName: string;
sidecarPath: null; sidecarPath: null;