chore: migrate database files (#8126)

This commit is contained in:
Jason Rasmussen
2024-03-20 16:02:51 -05:00
committed by GitHub
parent 84f7ca855a
commit c1402eee8e
310 changed files with 358 additions and 362 deletions

View File

@@ -0,0 +1,21 @@
import { Injectable } from '@nestjs/common';
import { Instrumentation } from 'src/infra/instrumentation';
import { GitHubRelease, IServerInfoRepository } from 'src/interfaces/server-info.repository';
@Instrumentation()
@Injectable()
export class ServerInfoRepository implements IServerInfoRepository {
async getGitHubRelease(): Promise<GitHubRelease> {
try {
const response = await fetch('https://api.github.com/repos/immich-app/immich/releases/latest');
if (!response.ok) {
throw new Error(`GitHub API request failed with status ${response.status}: ${await response.text()}`);
}
return response.json();
} catch (error) {
throw new Error(`Failed to fetch GitHub release: ${error}`);
}
}
}