Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Hosted Weblate 2024-11-27 21:04:53 +00:00
commit d9e33a7cd1
No known key found for this signature in database
GPG key ID: A3FAAA06E6569B4C

View file

@ -59,13 +59,14 @@ class MediaStoreSource extends CollectionSource {
await vaults.init(); await vaults.init();
await favourites.init(); await favourites.init();
await covers.init(); await covers.init();
final currentTimeZoneOffset = DateTime.now().timeZoneOffset.inMilliseconds;
final catalogTimeZoneOffset = settings.catalogTimeZoneOffsetMillis; final deviceOffset = DateTime.now().timeZoneOffset.inMilliseconds;
if (currentTimeZoneOffset != catalogTimeZoneOffset) { final catalogOffset = settings.catalogTimeZoneOffsetMillis;
unawaited(reportService.recordError('Time zone offset change: $currentTimeZoneOffset -> $catalogTimeZoneOffset. Clear catalog metadata to get correct date/times.')); if (deviceOffset != catalogOffset) {
unawaited(reportService.recordError('Time zone offset change: $catalogOffset -> $deviceOffset. Clear catalog metadata to get correct date/times.'));
await localMediaDb.clearDates(); await localMediaDb.clearDates();
await localMediaDb.clearCatalogMetadata(); await localMediaDb.clearCatalogMetadata();
settings.catalogTimeZoneOffsetMillis = currentTimeZoneOffset; settings.catalogTimeZoneOffsetMillis = deviceOffset;
} }
await loadDates(); await loadDates();
debugPrint('$runtimeType load essentials complete in ${stopwatch.elapsed.inMilliseconds}ms'); debugPrint('$runtimeType load essentials complete in ${stopwatch.elapsed.inMilliseconds}ms');