Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: immich-app/immich
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 087a4a2ba03834b58e4c67716833e7e9a8bd39f5
Choose a base ref
..
head repository: immich-app/immich
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b1f041d3ab6d567edbe99cc3a157601d65b3c797
Choose a head ref
Showing with 17 additions and 11 deletions.
  1. +17 −11 server/src/controllers/server-info.controller.ts
28 changes: 17 additions & 11 deletions server/src/controllers/server-info.controller.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Controller, Get } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { ServerController } from 'src/controllers/server.controller';
import { EndpointLifecycle } from 'src/decorators';
import {
ServerAboutResponseDto,
@@ -14,64 +13,71 @@ import {
ServerVersionResponseDto,
} from 'src/dtos/server.dto';
import { Authenticated } from 'src/middleware/auth.guard';
import { ServerService } from 'src/services/server.service';
import { VersionService } from 'src/services/version.service';

@ApiTags('Server Info')
@Controller('server-info')
export class ServerInfoController extends ServerController {
export class ServerInfoController {
constructor(
private service: ServerService,
private versionService: VersionService,
) {}

@Get('about')
@EndpointLifecycle({ deprecatedAt: 'NEXT_RELEASE' })
@Authenticated()
getAboutInfo(): Promise<ServerAboutResponseDto> {
return super.getAboutInfo();
return this.service.getAboutInfo();
}

@Get('storage')
@EndpointLifecycle({ deprecatedAt: 'NEXT_RELEASE' })
@Authenticated()
getStorage(): Promise<ServerStorageResponseDto> {
return super.getStorage();
return this.service.getStorage();
}

@Get('ping')
@EndpointLifecycle({ deprecatedAt: 'NEXT_RELEASE' })
pingServer(): ServerPingResponse {
return super.pingServer();
return this.service.ping();
}

@Get('version')
@EndpointLifecycle({ deprecatedAt: 'NEXT_RELEASE' })
getServerVersion(): ServerVersionResponseDto {
return super.getServerVersion();
return this.versionService.getVersion();
}

@Get('features')
@EndpointLifecycle({ deprecatedAt: 'NEXT_RELEASE' })
getServerFeatures(): Promise<ServerFeaturesDto> {
return super.getServerFeatures();
return this.service.getFeatures();
}

@Get('theme')
@EndpointLifecycle({ deprecatedAt: 'NEXT_RELEASE' })
getTheme(): Promise<ServerThemeDto> {
return super.getTheme();
return this.service.getTheme();
}

@Get('config')
@EndpointLifecycle({ deprecatedAt: 'NEXT_RELEASE' })
getServerConfig(): Promise<ServerConfigDto> {
return super.getServerConfig();
return this.service.getConfig();
}

@Authenticated({ admin: true })
@EndpointLifecycle({ deprecatedAt: 'NEXT_RELEASE' })
@Get('statistics')
getServerStatistics(): Promise<ServerStatsResponseDto> {
return super.getServerStatistics();
return this.service.getStatistics();
}

@Get('media-types')
@EndpointLifecycle({ deprecatedAt: 'NEXT_RELEASE' })
getSupportedMediaTypes(): ServerMediaTypesResponseDto {
return super.getSupportedMediaTypes();
return this.service.getSupportedMediaTypes();
}
}