mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 01:01:09 +02:00
Move inactive projects out of active workspace: - bauntown (community website) - maerchenzauber (AI story generation) - memoro (voice memo app) - news (news aggregation) - nutriphi (nutrition tracking) - reader (reading app) - uload (URL shortener) - wisekeep (AI wisdom extraction) Update CLAUDE.md documentation: - Add presi to active projects - Document archived projects section - Update workspace configuration Archived apps can be re-activated by moving back to apps/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
60 lines
1.7 KiB
TypeScript
60 lines
1.7 KiB
TypeScript
import { TextData, AudioVersion } from '~/types/database';
|
|
|
|
/**
|
|
* Migriert alte Audio-Daten zum neuen audioVersions Format
|
|
*/
|
|
export function migrateAudioData(data: TextData): TextData {
|
|
// Wenn bereits audioVersions existiert, keine Migration nötig
|
|
if (data.audioVersions && data.audioVersions.length > 0) {
|
|
return data;
|
|
}
|
|
|
|
// Wenn alte audio Daten existieren, migriere sie
|
|
if (data.audio && data.audio.chunks && data.audio.chunks.length > 0) {
|
|
const versionId = `v1-${data.audio.lastGenerated ? new Date(data.audio.lastGenerated).getTime() : Date.now()}`;
|
|
const audioVersion: AudioVersion = {
|
|
id: versionId,
|
|
chunks: data.audio.chunks,
|
|
settings: data.audio.settings || {
|
|
voice: data.tts?.voice || 'de-DE-Neural2-A',
|
|
speed: data.tts?.speed || 1,
|
|
},
|
|
totalSize: data.audio.totalSize,
|
|
hasLocalCache: data.audio.hasLocalCache,
|
|
createdAt: data.audio.lastGenerated || new Date().toISOString(),
|
|
};
|
|
|
|
return {
|
|
...data,
|
|
audioVersions: [audioVersion],
|
|
currentAudioVersion: versionId,
|
|
};
|
|
}
|
|
|
|
// Keine Audio-Daten vorhanden
|
|
return data;
|
|
}
|
|
|
|
/**
|
|
* Holt die aktuelle Audio-Version basierend auf currentAudioVersion
|
|
*/
|
|
export function getCurrentAudioVersion(data: TextData): AudioVersion | null {
|
|
if (!data.audioVersions || data.audioVersions.length === 0) {
|
|
return null;
|
|
}
|
|
|
|
if (data.currentAudioVersion) {
|
|
const version = data.audioVersions.find((v) => v.id === data.currentAudioVersion);
|
|
if (version) return version;
|
|
}
|
|
|
|
// Fallback: nimm die neueste Version
|
|
return data.audioVersions[data.audioVersions.length - 1];
|
|
}
|
|
|
|
/**
|
|
* Generiert eine neue Versions-ID
|
|
*/
|
|
export function generateVersionId(): string {
|
|
return `v${Date.now()}`;
|
|
}
|