mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-11-21 20:00:49 +01:00
Rename the Dart package, Android and iOS identifiers, Rust crates, native libraries, and Discord plugin. Preserve legacy data readers and compatibility aliases. Update localized branding, documentation, artwork, build tooling, and release artifacts. Route Telegram release notifications to @mornyeupdates and link @mornyecommunity.
30 lines
973 B
Dart
30 lines
973 B
Dart
import 'package:mornye/services/platform_bridge.dart';
|
|
|
|
typedef NativeCacheJobRunner =
|
|
Future<Map<String, dynamic>> Function(
|
|
Map<String, dynamic> request, {
|
|
String? requestId,
|
|
});
|
|
|
|
/// Returns null on the desktop adapter. Mobile filesystem work uses the
|
|
/// existing cancellable native worker without changing the public FFI API.
|
|
Future<Map<String, dynamic>?> runNativeCacheMaintenance(
|
|
Map<String, dynamic> request, {
|
|
String? requestId,
|
|
NativeCacheJobRunner? nativeJobRunner,
|
|
}) async {
|
|
if (nativeJobRunner != null) {
|
|
return nativeJobRunner(request, requestId: requestId);
|
|
}
|
|
if (!PlatformBridge.supportsCoreBackend) return null;
|
|
return PlatformBridge.runNativeDataJob(request, requestId: requestId);
|
|
}
|
|
|
|
int cacheMaintenanceDeletedCount(Map<String, dynamic> result) {
|
|
final deleted = result['deleted'];
|
|
if (deleted is! int || deleted < 0) {
|
|
throw StateError('Invalid native cache maintenance result');
|
|
}
|
|
return deleted;
|
|
}
|