fixed copied item catalog date
This commit is contained in:
parent
a636c444e1
commit
52fb0a7e15
3 changed files with 11 additions and 2 deletions
|
@ -438,13 +438,15 @@ class AvesEntry {
|
||||||
return _bestTitle;
|
return _bestTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
CatalogMetadata? get catalogMetadata => _catalogMetadata;
|
int? get catalogDateMillis => _catalogDateMillis;
|
||||||
|
|
||||||
set catalogDateMillis(int? dateMillis) {
|
set catalogDateMillis(int? dateMillis) {
|
||||||
_catalogDateMillis = dateMillis;
|
_catalogDateMillis = dateMillis;
|
||||||
_bestDate = null;
|
_bestDate = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CatalogMetadata? get catalogMetadata => _catalogMetadata;
|
||||||
|
|
||||||
set catalogMetadata(CatalogMetadata? newMetadata) {
|
set catalogMetadata(CatalogMetadata? newMetadata) {
|
||||||
final oldDateModifiedSecs = dateModifiedSecs;
|
final oldDateModifiedSecs = dateModifiedSecs;
|
||||||
final oldRotationDegrees = rotationDegrees;
|
final oldRotationDegrees = rotationDegrees;
|
||||||
|
|
|
@ -105,7 +105,9 @@ abstract class CollectionSource with SourceBase, AlbumMixin, LocationMixin, TagM
|
||||||
_rawEntries.removeWhere((entry) => newContentIds.contains(entry.contentId));
|
_rawEntries.removeWhere((entry) => newContentIds.contains(entry.contentId));
|
||||||
}
|
}
|
||||||
|
|
||||||
entries.forEach((entry) => entry.catalogDateMillis = _savedDates[entry.contentId]);
|
entries.where((entry) => entry.catalogDateMillis == null).forEach((entry) {
|
||||||
|
entry.catalogDateMillis = _savedDates[entry.contentId];
|
||||||
|
});
|
||||||
|
|
||||||
_entryById.addAll(newIdMapEntries);
|
_entryById.addAll(newIdMapEntries);
|
||||||
_rawEntries.addAll(entries);
|
_rawEntries.addAll(entries);
|
||||||
|
@ -246,6 +248,8 @@ abstract class CollectionSource with SourceBase, AlbumMixin, LocationMixin, TagM
|
||||||
title: newFields['title'] as String?,
|
title: newFields['title'] as String?,
|
||||||
dateModifiedSecs: newFields['dateModifiedSecs'] as int?,
|
dateModifiedSecs: newFields['dateModifiedSecs'] as int?,
|
||||||
));
|
));
|
||||||
|
} else {
|
||||||
|
debugPrint('failed to find source entry with uri=$sourceUri');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
await metadataDb.saveEntries(movedEntries);
|
await metadataDb.saveEntries(movedEntries);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import 'package:aves/theme/icons.dart';
|
||||||
import 'package:aves/widgets/viewer/debug/db.dart';
|
import 'package:aves/widgets/viewer/debug/db.dart';
|
||||||
import 'package:aves/widgets/viewer/debug/metadata.dart';
|
import 'package:aves/widgets/viewer/debug/metadata.dart';
|
||||||
import 'package:aves/widgets/viewer/info/common.dart';
|
import 'package:aves/widgets/viewer/info/common.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:tuple/tuple.dart';
|
import 'package:tuple/tuple.dart';
|
||||||
|
@ -59,6 +60,7 @@ class ViewerDebugPage extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
InfoRowGroup(
|
InfoRowGroup(
|
||||||
info: {
|
info: {
|
||||||
|
'hash': '#${shortHash(entry)}',
|
||||||
'uri': entry.uri,
|
'uri': entry.uri,
|
||||||
'contentId': '${entry.contentId}',
|
'contentId': '${entry.contentId}',
|
||||||
'path': entry.path ?? '',
|
'path': entry.path ?? '',
|
||||||
|
@ -74,6 +76,7 @@ class ViewerDebugPage extends StatelessWidget {
|
||||||
const Divider(),
|
const Divider(),
|
||||||
InfoRowGroup(
|
InfoRowGroup(
|
||||||
info: {
|
info: {
|
||||||
|
'catalogDateMillis': toDateValue(entry.catalogDateMillis),
|
||||||
'dateModifiedSecs': toDateValue(entry.dateModifiedSecs, factor: 1000),
|
'dateModifiedSecs': toDateValue(entry.dateModifiedSecs, factor: 1000),
|
||||||
'sourceDateTakenMillis': toDateValue(entry.sourceDateTakenMillis),
|
'sourceDateTakenMillis': toDateValue(entry.sourceDateTakenMillis),
|
||||||
'bestDate': '${entry.bestDate}',
|
'bestDate': '${entry.bestDate}',
|
||||||
|
|
Loading…
Reference in a new issue