mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	feat(server): add endpoint to get supported media types on the server (#3284)
* feat(server): add endpoint to get supported media types on the server * api generation * remove xmp format * change dto * openapi * dev
This commit is contained in:
		@@ -25,3 +25,9 @@ export class ServerStatsResponseDto {
 | 
			
		||||
  })
 | 
			
		||||
  usageByUser: UsageByUserDto[] = [];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export class ServerMediaTypesResponseDto {
 | 
			
		||||
  video!: string[];
 | 
			
		||||
  image!: string[];
 | 
			
		||||
  sidecar!: string[];
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,15 @@
 | 
			
		||||
import { Inject, Injectable } from '@nestjs/common';
 | 
			
		||||
import { serverVersion } from '../domain.constant';
 | 
			
		||||
import { mimeTypes, serverVersion } from '../domain.constant';
 | 
			
		||||
import { asHumanReadable } from '../domain.util';
 | 
			
		||||
import { IStorageRepository, StorageCore, StorageFolder } from '../storage';
 | 
			
		||||
import { IUserRepository, UserStatsQueryResponse } from '../user';
 | 
			
		||||
import { ServerInfoResponseDto, ServerPingResponse, ServerStatsResponseDto, UsageByUserDto } from './response-dto';
 | 
			
		||||
import {
 | 
			
		||||
  ServerInfoResponseDto,
 | 
			
		||||
  ServerMediaTypesResponseDto,
 | 
			
		||||
  ServerPingResponse,
 | 
			
		||||
  ServerStatsResponseDto,
 | 
			
		||||
  UsageByUserDto,
 | 
			
		||||
} from './response-dto';
 | 
			
		||||
 | 
			
		||||
@Injectable()
 | 
			
		||||
export class ServerInfoService {
 | 
			
		||||
@@ -60,4 +66,12 @@ export class ServerInfoService {
 | 
			
		||||
 | 
			
		||||
    return serverStats;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getSupportedMediaTypes(): ServerMediaTypesResponseDto {
 | 
			
		||||
    return {
 | 
			
		||||
      video: [...Object.keys(mimeTypes.video)],
 | 
			
		||||
      image: [...Object.keys(mimeTypes.image)],
 | 
			
		||||
      sidecar: [...Object.keys(mimeTypes.sidecar)],
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user