Skip to content

Commit

Permalink
Fix: don't edit location/time in the file object
Browse files Browse the repository at this point in the history
  • Loading branch information
ua741 committed Jul 12, 2024
1 parent 4aa92ff commit 8e136ec
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions mobile/lib/ui/viewer/file/file_details_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import "package:photos/events/people_changed_event.dart";
import "package:photos/generated/l10n.dart";
import 'package:photos/models/file/file.dart';
import 'package:photos/models/file/file_type.dart';
import "package:photos/models/location/location.dart";
import "package:photos/models/metadata/file_magic.dart";
import "package:photos/services/file_magic_service.dart";
import 'package:photos/theme/ente_theme.dart';
Expand Down Expand Up @@ -60,12 +59,9 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {
"longRef": null,
};

int? creationTime;
Location? location;

late final StreamSubscription<PeopleChangedEvent> _peopleChangedEvent;

bool _isImage = false;
bool _isImage = false;
late int _currentUserID;
bool showExifListTile = false;
final ValueNotifier<bool> hasLocationData = ValueNotifier(false);
Expand Down Expand Up @@ -126,13 +122,6 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {
}
final properties = await FFProbeUtil.getProperties(mediaInfo);

location = properties.location;
if (location != null) {
hasLocationData.value = true;
}
creationTime = DateTime.tryParse(properties.creationTime ?? "")
?.microsecondsSinceEpoch;

setState(() {});
}

Expand Down Expand Up @@ -165,9 +154,7 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {
);
fileDetailsTiles.addAll([
CreationTimeItem(
file.copyWith(
creationTime: creationTime,
),
file,
_currentUserID,
),
const FileDetailsDivider(),
Expand Down Expand Up @@ -206,9 +193,7 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {
? Column(
children: [
LocationTagsWidget(
widget.file.copyWith(
location: location,
),
widget.file,
),
const FileDetailsDivider(),
],
Expand Down

0 comments on commit 8e136ec

Please sign in to comment.