mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-23 01:06:21 +01:00
22 lines
687 B
Dart
22 lines
687 B
Dart
import 'package:logging/logging.dart';
|
|
import 'package:nc_photos/entity/sqlite/database.dart' as sql;
|
|
import 'package:nc_photos/pref.dart';
|
|
import 'package:np_codegen/np_codegen.dart';
|
|
|
|
part 'v46.g.dart';
|
|
|
|
@npLog
|
|
class CompatV46 {
|
|
static Future<void> insertDbAccounts(Pref pref, sql.SqliteDb sqliteDb) async {
|
|
_log.info("[insertDbAccounts] Insert current accounts to Sqlite database");
|
|
await sqliteDb.use((db) async {
|
|
final accounts = pref.getAccounts3Or([]);
|
|
for (final a in accounts) {
|
|
_log.info("[insertDbAccounts] Insert account to Sqlite db: $a");
|
|
await db.insertAccountOf(a);
|
|
}
|
|
});
|
|
}
|
|
|
|
static final _log = _$CompatV46NpLog.log;
|
|
}
|