chore(server): remove unused code (#13367)

This commit is contained in:
Jason Rasmussen
2024-10-11 00:44:38 -04:00
committed by GitHub
parent 8daa8073ae
commit 930df46f74
26 changed files with 34 additions and 415 deletions

View File

@@ -499,39 +499,6 @@ export class AssetRepository implements IAssetRepository {
});
}
getWith(
pagination: PaginationOptions,
property: WithProperty,
libraryId?: string,
withDeleted = false,
): Paginated<AssetEntity> {
let where: FindOptionsWhere<AssetEntity> | FindOptionsWhere<AssetEntity>[] = {};
switch (property) {
case WithProperty.SIDECAR: {
where = [{ sidecarPath: Not(IsNull()), isVisible: true }];
break;
}
default: {
throw new Error(`Invalid getWith property: ${property}`);
}
}
if (libraryId) {
where = [{ ...where, libraryId }];
}
return paginate(this.repository, pagination, {
where,
withDeleted,
order: {
// Ensures correct order when paginating
createdAt: 'ASC',
},
});
}
getLastUpdatedAssetForAlbumId(albumId: string): Promise<AssetEntity | null> {
return this.repository.findOne({
where: { albums: { id: albumId } },

View File

@@ -74,10 +74,6 @@ export class DatabaseRepository implements IDatabaseRepository {
await this.dataSource.query(`CREATE EXTENSION IF NOT EXISTS ${extension}`);
}
async updateExtension(extension: DatabaseExtension, version?: string): Promise<void> {
await this.dataSource.query(`ALTER EXTENSION ${extension} UPDATE${version ? ` TO '${version}'` : ''}`);
}
async updateVectorExtension(extension: VectorExtension, targetVersion?: string): Promise<VectorUpdateResult> {
const { availableVersion, installedVersion } = await this.getExtensionVersion(extension);
if (!installedVersion) {

View File

@@ -113,20 +113,6 @@ export class MapRepository implements IMapRepository {
}));
}
async fetchStyle(url: string) {
try {
const response = await fetch(url);
if (!response.ok) {
throw new Error(`Failed to fetch data from ${url} with status ${response.status}: ${await response.text()}`);
}
return response.json();
} catch (error) {
throw new Error(`Failed to fetch data from ${url}: ${error}`);
}
}
async reverseGeocode(point: GeoPoint): Promise<ReverseGeocodeResult> {
this.logger.debug(`Request: ${point.latitude},${point.longitude}`);

View File

@@ -63,10 +63,6 @@ export class PersonRepository implements IPersonRepository {
await this.personRepository.remove(entities);
}
async deleteAll(): Promise<void> {
await this.personRepository.clear();
}
async deleteFaces({ sourceType }: DeleteFacesOptions): Promise<void> {
await this.assetFaceRepository
.createQueryBuilder('asset_faces')
@@ -269,11 +265,6 @@ export class PersonRepository implements IPersonRepository {
return results.map((person) => person.id);
}
async createFaces(entities: AssetFaceEntity[]): Promise<string[]> {
const res = await this.assetFaceRepository.save(entities);
return res.map((row) => row.id);
}
async refreshFaces(
facesToAdd: Partial<AssetFaceEntity>[],
faceIdsToRemove: string[],