Add prompt in archiver when updating existing entry with the URL of the entry

This commit is contained in:
Hank Grabowski 2022-01-21 11:17:14 -05:00
parent 0e29d54528
commit 0d2a93078a
3 changed files with 8 additions and 1 deletions

View file

@ -98,6 +98,9 @@ void main(List<String> arguments) async {
final entries = timelineResult.value; final entries = timelineResult.value;
print('# Post/Comments returned for Page $page: ${entries.length}'); print('# Post/Comments returned for Page $page: ${entries.length}');
for (final entry in entries) { for (final entry in entries) {
if (allEntries.containsKey(entry.id)) {
print('Replacing existing entry for ${entry.url}');
}
allEntries[entry.id] = entry; allEntries[entry.id] = entry;
if (settings['download-images']) { if (settings['download-images']) {
final imageEntryResults = await imageArchive.addEntryImages(entry); final imageEntryResults = await imageArchive.addEntryImages(entry);

View file

@ -2,6 +2,7 @@ class FriendicaEntry {
final Map<String, dynamic> originalJson; final Map<String, dynamic> originalJson;
final int id; final int id;
final String text; final String text;
final String url;
final int commentCount; final int commentCount;
final List<String> images; final List<String> images;
@ -10,12 +11,14 @@ class FriendicaEntry {
required this.text, required this.text,
required this.id, required this.id,
required this.commentCount, required this.commentCount,
required this.url,
required this.images}); required this.images});
FriendicaEntry.fromJson(Map<String, dynamic> json) FriendicaEntry.fromJson(Map<String, dynamic> json)
: originalJson = json, : originalJson = json,
id = json['id'] ?? -1, id = json['id'] ?? -1,
text = json['text'] ?? '', text = json['text'] ?? '',
url = json['external_url'] ?? '',
commentCount = _commentCountFromJson(json), commentCount = _commentCountFromJson(json),
images = _imagesFromJson(json); images = _imagesFromJson(json);
@ -25,6 +28,7 @@ class FriendicaEntry {
FriendicaPost{ FriendicaPost{
id: $id, id: $id,
text: $text, text: $text,
url: $url,
commentCount: $commentCount, commentCount: $commentCount,
images: $images, images: $images,
} }

View file

@ -1,6 +1,6 @@
name: friendica_archiver name: friendica_archiver
description: A simple command-line application. description: A simple command-line application.
version: 1.0.0 version: 1.1.0
# homepage: https://www.example.com # homepage: https://www.example.com
environment: environment: