mirror of
https://github.com/immich-app/immich.git
synced 2025-11-12 09:32:37 +09:00
* refactor(cli): yup * fix missing return for authenticate --------- Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
16 lines
793 B
TypeScript
16 lines
793 B
TypeScript
import { getAssetStatistics, getServerVersion, getSupportedMediaTypes } from '@immich/sdk';
|
|
import { BaseOptions, authenticate } from 'src/utils';
|
|
|
|
export const serverInfo = async (options: BaseOptions) => {
|
|
await authenticate(options);
|
|
|
|
const versionInfo = await getServerVersion();
|
|
const mediaTypes = await getSupportedMediaTypes();
|
|
const stats = await 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: ${stats.images}\n Videos: ${stats.videos}\n Total: ${stats.total}`);
|
|
};
|