mirror of
https://github.com/immich-app/immich.git
synced 2026-03-01 10:08:42 +03:00
fix: automatic media location migration without internal assets (#20489)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Insertable, Kysely, NotNull, Selectable, UpdateResult, Updateable, sql } from 'kysely';
|
||||
import { jsonArrayFrom } from 'kysely/helpers/postgres';
|
||||
import { isEmpty, isUndefined, omitBy } from 'lodash';
|
||||
import { InjectKysely } from 'nestjs-kysely';
|
||||
import { Stack } from 'src/database';
|
||||
@@ -338,20 +337,7 @@ export class AssetRepository {
|
||||
|
||||
@GenerateSql()
|
||||
getFileSamples() {
|
||||
return this.db
|
||||
.selectFrom('asset')
|
||||
.select((eb) => [
|
||||
'asset.id',
|
||||
'asset.originalPath',
|
||||
'asset.sidecarPath',
|
||||
'asset.encodedVideoPath',
|
||||
jsonArrayFrom(eb.selectFrom('asset_file').select('path').whereRef('asset.id', '=', 'asset_file.assetId')).as(
|
||||
'files',
|
||||
),
|
||||
])
|
||||
.where('asset.libraryId', 'is', null)
|
||||
.limit(sql.lit(3))
|
||||
.execute();
|
||||
return this.db.selectFrom('asset_file').select(['assetId', 'path']).limit(sql.lit(3)).execute();
|
||||
}
|
||||
|
||||
@GenerateSql({ params: [DummyValue.UUID] })
|
||||
|
||||
Reference in New Issue
Block a user