implemented user backups

This commit is contained in:
Fabian Freund
2025-12-18 18:38:06 +01:00
parent 2f1ecd50e1
commit 018915298a
19 changed files with 1172 additions and 78 deletions
@@ -17,6 +17,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'dart:io';
import 'package:exceptions/exceptions.dart';
import 'package:nullability/nullability.dart';
import 'package:riverpod/riverpod.dart';
@@ -29,6 +31,7 @@ import 'package:weblibre/features/user/domain/repositories/engine_settings.dart'
import 'package:weblibre/features/user/domain/repositories/general_settings.dart';
import 'package:weblibre/features/user/domain/repositories/profile.dart';
import 'package:weblibre/features/user/domain/services/fingerprinting.dart';
import 'package:weblibre/features/user/domain/services/user_backup.dart';
part 'providers.g.dart';
@@ -73,3 +76,11 @@ Future<Profile> selectedProfile(Ref ref) async {
final profiles = await ref.watch(profileRepositoryProvider.future);
return profiles.firstWhere((p) => p.uuidValue == filesystem.selectedProfile);
}
@Riverpod()
Future<List<File>> backupList(Ref ref) {
return ref
.watch(userBackupServiceProvider.notifier)
.getBackupListStream()
.toList();
}