v2.38 — Issue #2: Dauerverbindung Cloud Server (persistenter http.Client)

- CloudService: static final http.Client _client als Instanzvariable
- Alle http.get/post/put/delete/upload nutzen nun _client statt neuem Client
- DownloadService: gleicher Fix für _retryHttpPost und _retryHttpGet
Build: ✓ flutter analyze
This commit is contained in:
Dustin
2026-08-02 15:56:22 +02:00
parent 6ed416c8b1
commit 0fc383daba
2 changed files with 20 additions and 16 deletions
+4 -2
View File
@@ -13,6 +13,8 @@ import '../config/app_config.dart';
/// Download-Service: Lädt YouTube-Audio über den yt-proxy herunter.
/// Nutzt ChangeNotifier für UI-Updates via ListenableBuilder.
class DownloadService extends ChangeNotifier {
static final http.Client _client = http.Client();
static final DownloadService _instanz = DownloadService._();
factory DownloadService() => _instanz;
DownloadService._();
@@ -349,7 +351,7 @@ class DownloadService extends ChangeNotifier {
Object? lastError;
for (int versuch = 0; versuch < maxVersuche; versuch++) {
try {
final response = await http
final response = await _client
.post(url, headers: headers, body: body)
.timeout(timeout);
return response;
@@ -386,7 +388,7 @@ class DownloadService extends ChangeNotifier {
Object? lastError;
for (int versuch = 0; versuch < maxVersuche; versuch++) {
try {
final response = await http
final response = await _client
.get(url, headers: headers)
.timeout(timeout);
return response;