mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-28 06:12:53 +02:00
chore: archive inactive projects to apps-archived/
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>
This commit is contained in:
parent
b97149ac12
commit
61d181fbc2
3148 changed files with 437 additions and 46640 deletions
60
apps-archived/reader/apps/mobile/utils/audioMigration.ts
Normal file
60
apps-archived/reader/apps/mobile/utils/audioMigration.ts
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
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()}`;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue