refactor(downloads): unify deletion and scoped cache handling

This commit is contained in:
edde746
2026-07-12 08:42:23 +02:00
parent 3d36ecf094
commit c84b8b4792
12 changed files with 1023 additions and 272 deletions
+10
View File
@@ -0,0 +1,10 @@
import '../media/ids.dart';
/// Returns the user-specific active client scope, or `null` when the client is
/// absent or only exposes the public server namespace.
String? resolveActiveClientScopeId({required ServerId serverId, required String? cacheServerId}) {
if (cacheServerId == null) return null;
final userPrefix = '$serverId/';
if (!cacheServerId.startsWith(userPrefix) || cacheServerId.length == userPrefix.length) return null;
return cacheServerId;
}