Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/commands/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import { loadMigrationState, clearMigrationState } from '../utils/config';
import { logger, formatDuration } from '../utils/logger';
import { confirm } from '@inquirer/prompts';

function truncate(value: string, max: number): string {
if (value.length <= max) return value;
return value.slice(0, max - 1) + '…';
}

export async function statusCommand(): Promise<void> {
const state = loadMigrationState();

Expand Down Expand Up @@ -62,6 +67,19 @@ export async function statusCommand(): Promise<void> {
logger.info(`Progress: [${bar}] ${percent}%`);
}

// Show completed video mappings (Vimeo → Bunny)
if (completed.length > 0) {
logger.newline();
logger.info(chalk.bold('Video Mappings (Vimeo → Bunny):'));
logger.table(
completed.map((m) => ({
'Vimeo ID': m.vimeoVideoId || '(unknown)',
'Title': truncate(m.vimeoVideoName || '(untitled)', 40),
'Bunny GUID': m.bunnyVideoId || '(missing)',
}))
);
}

// Show failed videos
if (failed.length > 0) {
logger.newline();
Expand Down
29 changes: 24 additions & 5 deletions src/services/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ import {
stripAnsi,
} from '../utils/security';

function truncate(value: string, max: number): string {
if (value.length <= max) return value;
return value.slice(0, max - 1) + '…';
}

export interface MigrationOptions {
dryRun?: boolean;
folderId?: string;
Expand Down Expand Up @@ -556,11 +561,25 @@ export class MigrationService {
logger.warn(`Pending: ${pending.length}`);
}

logger.newline();
logger.info('Collections created:');
this.state.folderMappings.forEach((m) => {
logger.info(` - ${m.vimeoFolderName} → ${m.bunnyCollectionId}`);
});
if (completed.length > 0) {
logger.newline();
logger.info('Video mappings (Vimeo → Bunny):');
logger.table(
completed.map((m) => ({
'Vimeo ID': m.vimeoVideoId || '(unknown)',
'Title': truncate(stripAnsi(m.vimeoVideoName) || '(untitled)', 40),
'Bunny GUID': m.bunnyVideoId || '(missing)',
}))
);
}

if (this.state.folderMappings.length > 0) {
logger.newline();
logger.info('Collections created:');
this.state.folderMappings.forEach((m) => {
logger.info(` - ${m.vimeoFolderName} → ${m.bunnyCollectionId}`);
});
}
}

getState(): MigrationState | null {
Expand Down