mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 15:02:42 +01:00
logging framework
This commit is contained in:
@@ -7,6 +7,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import '../../database/dao/sources_dao.dart';
|
||||
import '../../database/database.dart';
|
||||
import '../../l10n/generated/app_localizations.dart';
|
||||
import '../../util/logger.dart';
|
||||
import '../state/database.dart';
|
||||
import '../util/padding.dart';
|
||||
|
||||
@@ -216,6 +217,7 @@ class _SettingsSourceScreen extends HookConsumerWidget {
|
||||
} catch (e, _) {
|
||||
// showErrorSnackbar(context, e.toString());
|
||||
// log.severe('Saving source', e, st);
|
||||
logger.w('fuck');
|
||||
error = true;
|
||||
} finally {
|
||||
isSaving.value = false;
|
||||
|
||||
@@ -6,44 +6,40 @@ import '../../database/database.dart';
|
||||
final databaseInitializer = FutureProvider<SubtracksDatabase>((ref) async {
|
||||
final db = SubtracksDatabase();
|
||||
|
||||
await db
|
||||
.batch((batch) {
|
||||
batch.insertAll(
|
||||
db.sources,
|
||||
[
|
||||
SourcesCompanion.insert(
|
||||
id: Value(1),
|
||||
name: 'test subsonic',
|
||||
isActive: Value(true),
|
||||
),
|
||||
SourcesCompanion.insert(
|
||||
id: Value(2),
|
||||
name: 'test navidrome',
|
||||
isActive: Value(null),
|
||||
),
|
||||
],
|
||||
mode: InsertMode.insertOrIgnore,
|
||||
);
|
||||
batch.insertAllOnConflictUpdate(db.subsonicSettings, [
|
||||
SubsonicSettingsCompanion.insert(
|
||||
sourceId: Value(1),
|
||||
address: Uri.parse('http://demo.subsonic.org'),
|
||||
username: 'guest1',
|
||||
password: 'guest',
|
||||
useTokenAuth: Value(true),
|
||||
),
|
||||
SubsonicSettingsCompanion.insert(
|
||||
sourceId: Value(2),
|
||||
address: Uri.parse('http://10.0.2.2:4533'),
|
||||
username: 'admin',
|
||||
password: 'password',
|
||||
useTokenAuth: Value(true),
|
||||
),
|
||||
]);
|
||||
})
|
||||
.onError((error, stack) {
|
||||
print(error);
|
||||
});
|
||||
await db.batch((batch) {
|
||||
batch.insertAll(
|
||||
db.sources,
|
||||
[
|
||||
SourcesCompanion.insert(
|
||||
id: Value(1),
|
||||
name: 'test subsonic',
|
||||
isActive: Value(true),
|
||||
),
|
||||
SourcesCompanion.insert(
|
||||
id: Value(2),
|
||||
name: 'test navidrome',
|
||||
isActive: Value(null),
|
||||
),
|
||||
],
|
||||
mode: InsertMode.insertOrIgnore,
|
||||
);
|
||||
batch.insertAllOnConflictUpdate(db.subsonicSettings, [
|
||||
SubsonicSettingsCompanion.insert(
|
||||
sourceId: Value(1),
|
||||
address: Uri.parse('http://demo.subsonic.org'),
|
||||
username: 'guest1',
|
||||
password: 'guest',
|
||||
useTokenAuth: Value(true),
|
||||
),
|
||||
SubsonicSettingsCompanion.insert(
|
||||
sourceId: Value(2),
|
||||
address: Uri.parse('http://10.0.2.2:4533'),
|
||||
username: 'admin',
|
||||
password: 'password',
|
||||
useTokenAuth: Value(true),
|
||||
),
|
||||
]);
|
||||
});
|
||||
|
||||
return db;
|
||||
});
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
import '../../util/logger.dart';
|
||||
import '../state/source.dart';
|
||||
import '../util/color_scheme.dart';
|
||||
import 'theme.dart';
|
||||
@@ -36,8 +37,12 @@ class CoverArtTheme extends HookConsumerWidget {
|
||||
: 'https://placehold.net/400x400.png',
|
||||
),
|
||||
);
|
||||
} catch (err) {
|
||||
print(err);
|
||||
} catch (error, stackTrace) {
|
||||
logger.w(
|
||||
'Could not create color scheme from image provider',
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user