fix(cache): use app-private image cache
This commit is contained in:
@@ -287,10 +287,17 @@ FutureOr<SentryEvent?> _beforeSend(SentryEvent event, Hint _) {
|
||||
if (exceptions != null) {
|
||||
bool shouldDrop(SentryException e) {
|
||||
final v = e.value;
|
||||
final lowerValue = v?.toLowerCase();
|
||||
// Windows file-lock errors from cache manager cleanup
|
||||
if (e.type == 'FileSystemException' && v != null && v.contains('plexImageCache') && v.contains('errno = 32')) {
|
||||
return true;
|
||||
}
|
||||
if (e.type == 'FileSystemException' &&
|
||||
lowerValue != null &&
|
||||
lowerValue.contains('cached_network_image_ce') &&
|
||||
(lowerValue.contains('lock failed') || lowerValue.contains('writefrom failed'))) {
|
||||
return true;
|
||||
}
|
||||
// Linux without DBus/NetworkManager
|
||||
if (e.type == 'DBusServiceUnknownException' || (v != null && v.contains('system_bus_socket'))) {
|
||||
return true;
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'dart:async';
|
||||
// ignore: implementation_imports
|
||||
import 'package:cached_network_image_ce/src/cache/default_cache_manager.dart' as ce_cache;
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
import '../utils/media_server_http_client.dart';
|
||||
|
||||
@@ -31,6 +32,7 @@ class PlexImageCacheManager extends ce_cache.DefaultCacheManager {
|
||||
stalePeriod: const Duration(days: 14),
|
||||
maxNrOfCacheObjects: 3000,
|
||||
httpClientFactory: () => _SharedHttpClient(_artworkHttpClient.inner),
|
||||
cacheDirectoryProvider: getApplicationCacheDirectory,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user