Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 710e7c88d8 | |||
| b6ee5552f0 |
@@ -79,8 +79,8 @@ android {
|
||||
applicationId "com.ariacockpit"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 10806
|
||||
versionName "0.1.8.6"
|
||||
versionCode 10807
|
||||
versionName "0.1.8.7"
|
||||
// Fallback fuer Libraries mit Product Flavors
|
||||
missingDimensionStrategy 'react-native-camera', 'general'
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "aria-cockpit",
|
||||
"version": "0.1.8.6",
|
||||
"version": "0.1.8.7",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"android": "react-native run-android",
|
||||
|
||||
@@ -497,6 +497,49 @@ const SettingsScreen: React.FC = () => {
|
||||
})();
|
||||
}
|
||||
|
||||
// Datei-Manager: Einzel-Datei-Download. ChatScreen subscribet auch auf
|
||||
// file_response — der versucht aber nur Chat-Bubble-Attachments zu
|
||||
// patchen und macht nix wenn die requestId nicht zu einer Nachricht
|
||||
// passt. Hier behandeln wir die Manager-initiierten Downloads
|
||||
// (requestId-Praefix 'single-' aus bulkDownload). Schreibt nach
|
||||
// ~/Download/ wie der ZIP-Pfad.
|
||||
if (message.type === ('file_response' as any)) {
|
||||
const p: any = message.payload || {};
|
||||
const reqId = (p.requestId as string) || '';
|
||||
if (!reqId.startsWith('single-')) return; // nicht unsere Anfrage
|
||||
if (p.error) {
|
||||
ToastAndroid.show('Download fehlgeschlagen: ' + p.error, ToastAndroid.LONG);
|
||||
return;
|
||||
}
|
||||
const b64 = (p.base64 as string) || '';
|
||||
if (!b64) return;
|
||||
const fileName = (p.name as string) ||
|
||||
(p.serverPath as string || '').split('/').pop() ||
|
||||
'aria-download';
|
||||
(async () => {
|
||||
try {
|
||||
const dir = RNFS.DownloadDirectoryPath;
|
||||
const filePath = `${dir}/${fileName}`;
|
||||
// Falls Datei schon existiert: Suffix anhaengen damit nichts
|
||||
// ueberschrieben wird.
|
||||
let target = filePath;
|
||||
let i = 1;
|
||||
while (await RNFS.exists(target)) {
|
||||
const dot = fileName.lastIndexOf('.');
|
||||
const base = dot > 0 ? fileName.slice(0, dot) : fileName;
|
||||
const ext = dot > 0 ? fileName.slice(dot) : '';
|
||||
target = `${dir}/${base} (${i})${ext}`;
|
||||
i++;
|
||||
}
|
||||
await RNFS.writeFile(target, b64, 'base64');
|
||||
const sizeKb = Math.round(((b64.length * 0.75)) / 1024);
|
||||
ToastAndroid.show(`Gespeichert: ${target.split('/').pop()} (${sizeKb} KB)`, ToastAndroid.LONG);
|
||||
} catch (e: any) {
|
||||
ToastAndroid.show('Speichern fehlgeschlagen: ' + e.message, ToastAndroid.LONG);
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
// Voice wurde gespeichert → Liste neu laden + ggf. auswaehlen
|
||||
if (message.type === ('xtts_voice_saved' as any)) {
|
||||
const name = (message.payload as any).name as string;
|
||||
|
||||
Reference in New Issue
Block a user