Enchance logs for easier debugging
This commit is contained in:
parent
2fa1c19d0c
commit
4cc2f70710
|
@ -1,7 +1,12 @@
|
|||
|
||||
|
||||
import 'package:photos/events/event.dart';
|
||||
|
||||
class ForceReloadHomeGalleryEvent extends Event {
|
||||
ForceReloadHomeGalleryEvent();
|
||||
final String message;
|
||||
|
||||
ForceReloadHomeGalleryEvent(this.message);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ForceReloadHomeGalleryEvent{message: $message}';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -755,7 +755,7 @@ class CollectionsService {
|
|||
await _filesDB.deleteUnSyncedLocalFiles(localIDs);
|
||||
}
|
||||
// Force reload home gallery to pull in the restored files
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent());
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent("restoredFromTrash"));
|
||||
} catch (e, s) {
|
||||
_logger.severe("failed to restore files", e, s);
|
||||
rethrow;
|
||||
|
|
|
@ -36,7 +36,7 @@ class FileMagicService {
|
|||
await _updateMagicData(files, update);
|
||||
if (visibility == visibilityVisible) {
|
||||
// Force reload home gallery to pull in the now unarchived files
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent());
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent("unarchivedFiles"));
|
||||
Bus.instance
|
||||
.fire(LocalPhotosUpdatedEvent(files, type: EventType.unarchived));
|
||||
} else {
|
||||
|
|
|
@ -75,7 +75,7 @@ extension HiddenService on CollectionsService {
|
|||
}
|
||||
await move(defaultHiddenCollection.id, entry.key, entry.value);
|
||||
}
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent());
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent("hideFiles"));
|
||||
Bus.instance.fire(
|
||||
LocalPhotosUpdatedEvent(filesToHide, type: EventType.unarchived),
|
||||
);
|
||||
|
|
|
@ -325,8 +325,8 @@ class RemoteSyncService {
|
|||
}
|
||||
}
|
||||
if (moreFilesMarkedForBackup && !_config.hasSelectedAllFoldersForBackup()) {
|
||||
debugPrint("force reload due to display new files");
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent());
|
||||
// "force reload due to display new files"
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent("newFilesDisplay"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -688,8 +688,8 @@ class RemoteSyncService {
|
|||
" remoteFiles seen first time",
|
||||
);
|
||||
if (needsGalleryReload) {
|
||||
_logger.fine('force reload home gallery');
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent());
|
||||
// 'force reload home gallery'
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent("remoteSync"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ class _LazyLoadingGalleryState extends State<LazyLoadingGallery> {
|
|||
if (kDebugMode) {
|
||||
_logger.info(
|
||||
filesUpdatedThisDay.length.toString() +
|
||||
" files were updated due to ${event.type} on " +
|
||||
" files were updated due to ${event.type.name} on " +
|
||||
getDayTitle(galleryDate.microsecondsSinceEpoch),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ class _GalleryState extends State<Gallery> {
|
|||
for (final event in widget.forceReloadEvents) {
|
||||
_forceReloadEventSubscriptions.add(
|
||||
event.listen((event) async {
|
||||
_logger.info("Force reload triggered");
|
||||
_logger.info("Force reload $event");
|
||||
final result = await _loadFiles();
|
||||
_setFilesAndReload(result.files);
|
||||
}),
|
||||
|
|
|
@ -61,7 +61,7 @@ Future<void> changeCollectionVisibility(
|
|||
final Map<String, dynamic> update = {magicKeyVisibility: newVisibility};
|
||||
await CollectionsService.instance.updateMagicMetadata(collection, update);
|
||||
// Force reload home gallery to pull in the now unarchived files
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent());
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent("CollectionArchiveChange"));
|
||||
showShortToast(
|
||||
context,
|
||||
newVisibility == visibilityArchive
|
||||
|
@ -177,7 +177,7 @@ Future<void> _updatePublicMetadata(
|
|||
}
|
||||
|
||||
if (_shouldReloadGallery(key)) {
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent());
|
||||
Bus.instance.fire(ForceReloadHomeGalleryEvent("FileMetadataChange-$key"));
|
||||
}
|
||||
} catch (e, s) {
|
||||
_logger.severe("failed to update $key = $value", e, s);
|
||||
|
|
Loading…
Reference in a new issue