You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-08-10 23:22:22 +02:00
feat(server): apk links API endpoint for Obtainium Android mobile-server version sync (#18700)
This commit is contained in:
@@ -3,6 +3,7 @@ import { ApiNotFoundResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { LicenseKeyDto, LicenseResponseDto } from 'src/dtos/license.dto';
|
||||
import {
|
||||
ServerAboutResponseDto,
|
||||
ServerApkLinksDto,
|
||||
ServerConfigDto,
|
||||
ServerFeaturesDto,
|
||||
ServerMediaTypesResponseDto,
|
||||
@@ -34,6 +35,12 @@ export class ServerController {
|
||||
return this.service.getAboutInfo();
|
||||
}
|
||||
|
||||
@Get('android-links')
|
||||
@Authenticated()
|
||||
getAndroidLinks(): ServerApkLinksDto {
|
||||
return this.service.getAndroidLinks();
|
||||
}
|
||||
|
||||
@Get('storage')
|
||||
@Authenticated()
|
||||
getStorage(): Promise<ServerStorageResponseDto> {
|
||||
|
@@ -37,6 +37,13 @@ export class ServerAboutResponseDto {
|
||||
thirdPartySupportUrl?: string;
|
||||
}
|
||||
|
||||
export class ServerApkLinksDto {
|
||||
arm64v8a!: string;
|
||||
armeabiv7a!: string;
|
||||
universal!: string;
|
||||
x86_64!: string;
|
||||
}
|
||||
|
||||
export class ServerStorageResponseDto {
|
||||
diskSize!: string;
|
||||
diskUse!: string;
|
||||
|
@@ -5,6 +5,7 @@ import { OnEvent } from 'src/decorators';
|
||||
import { LicenseKeyDto, LicenseResponseDto } from 'src/dtos/license.dto';
|
||||
import {
|
||||
ServerAboutResponseDto,
|
||||
ServerApkLinksDto,
|
||||
ServerConfigDto,
|
||||
ServerFeaturesDto,
|
||||
ServerMediaTypesResponseDto,
|
||||
@@ -48,6 +49,16 @@ export class ServerService extends BaseService {
|
||||
};
|
||||
}
|
||||
|
||||
getAndroidLinks(): ServerApkLinksDto {
|
||||
const baseURL = `https://github.com/immich-app/immich/releases/download/v${serverVersion.toString()}`;
|
||||
return {
|
||||
arm64v8a: `${baseURL}/app-arm64-v8a-release.apk`,
|
||||
armeabiv7a: `${baseURL}/app-armeabi-v7a-release.apk`,
|
||||
universal: `${baseURL}/app-release.apk`,
|
||||
x86_64: `${baseURL}/app-x86_64-release.apk`,
|
||||
};
|
||||
}
|
||||
|
||||
async getStorage(): Promise<ServerStorageResponseDto> {
|
||||
const libraryBase = StorageCore.getBaseFolder(StorageFolder.LIBRARY);
|
||||
const diskInfo = await this.storageRepository.checkDiskUsage(libraryBase);
|
||||
|
Reference in New Issue
Block a user