mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(server): feature flags (#9492)
This commit is contained in:
parent
5583635947
commit
0f129cae4a
11 changed files with 59 additions and 132 deletions
|
|
@ -23,6 +23,7 @@ import { ISystemMetadataRepository } from 'src/interfaces/system-metadata.interf
|
|||
import { IUserRepository, UserStatsQueryResponse } from 'src/interfaces/user.interface';
|
||||
import { asHumanReadable } from 'src/utils/bytes';
|
||||
import { mimeTypes } from 'src/utils/mime-types';
|
||||
import { isFacialRecognitionEnabled, isSmartSearchEnabled } from 'src/utils/misc';
|
||||
import { Version } from 'src/utils/version';
|
||||
|
||||
@Injectable()
|
||||
|
|
@ -83,7 +84,23 @@ export class ServerInfoService {
|
|||
}
|
||||
|
||||
async getFeatures(): Promise<ServerFeaturesDto> {
|
||||
return this.configCore.getFeatures();
|
||||
const { reverseGeocoding, map, machineLearning, trash, oauth, passwordLogin, notifications } =
|
||||
await this.configCore.getConfig();
|
||||
|
||||
return {
|
||||
smartSearch: isSmartSearchEnabled(machineLearning),
|
||||
facialRecognition: isFacialRecognitionEnabled(machineLearning),
|
||||
map: map.enabled,
|
||||
reverseGeocoding: reverseGeocoding.enabled,
|
||||
sidecar: true,
|
||||
search: true,
|
||||
trash: trash.enabled,
|
||||
oauth: oauth.enabled,
|
||||
oauthAutoLaunch: oauth.autoLaunch,
|
||||
passwordLogin: passwordLogin.enabled,
|
||||
configFile: this.configCore.isUsingConfigFile(),
|
||||
email: notifications.smtp.enabled,
|
||||
};
|
||||
}
|
||||
|
||||
async getTheme() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue