mirror of
https://github.com/immich-app/immich.git
synced 2025-11-18 01:12:47 +09:00
refactor(cli): organize files, simplify types, use @immich/sdk (#6747)
This commit is contained in:
17
cli/src/commands/server-info.command.ts
Normal file
17
cli/src/commands/server-info.command.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { BaseCommand } from './base-command';
|
||||
|
||||
export class ServerInfoCommand extends BaseCommand {
|
||||
public async run() {
|
||||
await this.connect();
|
||||
const { data: versionInfo } = await this.immichApi.serverInfoApi.getServerVersion();
|
||||
const { data: mediaTypes } = await this.immichApi.serverInfoApi.getSupportedMediaTypes();
|
||||
const { data: statistics } = await this.immichApi.assetApi.getAssetStatistics();
|
||||
|
||||
console.log(`Server Version: ${versionInfo.major}.${versionInfo.minor}.${versionInfo.patch}`);
|
||||
console.log(`Image Types: ${mediaTypes.image.map((extension) => extension.replace('.', ''))}`);
|
||||
console.log(`Video Types: ${mediaTypes.video.map((extension) => extension.replace('.', ''))}`);
|
||||
console.log(
|
||||
`Statistics:\n Images: ${statistics.images}\n Videos: ${statistics.videos}\n Total: ${statistics.total}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user