refactor: enum casing (#19946)

This commit is contained in:
Jason Rasmussen
2025-07-15 14:50:13 -04:00
committed by GitHub
parent 920d7de349
commit e73abe0762
174 changed files with 2675 additions and 2459 deletions

View File

@@ -27,7 +27,7 @@ export class ServerService extends BaseService {
async onBootstrap(): Promise<void> {
const featureFlags = await this.getFeatures();
if (featureFlags.configFile) {
await this.systemMetadataRepository.set(SystemMetadataKey.ADMIN_ONBOARDING, {
await this.systemMetadataRepository.set(SystemMetadataKey.AdminOnboarding, {
isOnboarded: true,
});
}
@@ -38,7 +38,7 @@ export class ServerService extends BaseService {
const version = `v${serverVersion.toString()}`;
const { buildMetadata } = this.configRepository.getEnv();
const buildVersions = await this.serverInfoRepository.getBuildVersions();
const licensed = await this.systemMetadataRepository.get(SystemMetadataKey.LICENSE);
const licensed = await this.systemMetadataRepository.get(SystemMetadataKey.License);
return {
version,
@@ -60,7 +60,7 @@ export class ServerService extends BaseService {
}
async getStorage(): Promise<ServerStorageResponseDto> {
const libraryBase = StorageCore.getBaseFolder(StorageFolder.LIBRARY);
const libraryBase = StorageCore.getBaseFolder(StorageFolder.Library);
const diskInfo = await this.storageRepository.checkDiskUsage(libraryBase);
const usagePercentage = (((diskInfo.total - diskInfo.free) / diskInfo.total) * 100).toFixed(2);
@@ -111,7 +111,7 @@ export class ServerService extends BaseService {
async getSystemConfig(): Promise<ServerConfigDto> {
const config = await this.getConfig({ withCache: false });
const isInitialized = await this.userRepository.hasAdmin();
const onboarding = await this.systemMetadataRepository.get(SystemMetadataKey.ADMIN_ONBOARDING);
const onboarding = await this.systemMetadataRepository.get(SystemMetadataKey.AdminOnboarding);
return {
loginPageMessage: config.server.loginPageMessage,
@@ -163,11 +163,11 @@ export class ServerService extends BaseService {
}
async deleteLicense(): Promise<void> {
await this.systemMetadataRepository.delete(SystemMetadataKey.LICENSE);
await this.systemMetadataRepository.delete(SystemMetadataKey.License);
}
async getLicense(): Promise<LicenseResponseDto> {
const license = await this.systemMetadataRepository.get(SystemMetadataKey.LICENSE);
const license = await this.systemMetadataRepository.get(SystemMetadataKey.License);
if (!license) {
throw new NotFoundException();
}
@@ -186,7 +186,7 @@ export class ServerService extends BaseService {
const licenseData = { ...dto, activatedAt: new Date() };
await this.systemMetadataRepository.set(SystemMetadataKey.LICENSE, licenseData);
await this.systemMetadataRepository.set(SystemMetadataKey.License, licenseData);
return licenseData;
}