michaeltroger / greenpass-android

Green Pass PDF Wallet Android App
https://play.google.com/store/apps/details?id=com.michaeltroger.gruenerpass
GNU General Public License v3.0
71 stars 3 forks source link

[ENHANCEMENT] Duplicate files in Green Pass #268

Open amarradi opened 2 months ago

amarradi commented 2 months ago

[ENHANCEMENT]

Is there a way to somehow summarize duplicate files by file name and display them more clearly? How do I find this? I open a mail with an attachment and use the Greenpass by default, so the attachment is loaded directly into the Greenpass again the second time I open it.

michaeltroger commented 2 months ago

Yes, the app would currently always import the same file again and again. This is due to the fact that the app is not like a classical PDF Reader. For this app, any file that is opened is immediately copied into the app's storage. That's also one reason why I tended to disable the "open with Green Pass" option in earlier days, to avoid confusion. "Opening" is more like importing.

Currently I guess you would need to know the document name in question and then use the search functionally to manually remove duplicates. There is no way to show duplicates in an automated way.

From technical perspective, avoiding duplicates is doable. I think one could check the checksum of the file and save it in the database. Then when a new file is imported check if the same exists already. But do you really think visualizing duplicates is something that would be useful? I would rather think of avoiding them in the first place. Building a specific UI for duplicates sounds like quite some overhead.

amarradi commented 2 months ago

Avoiding this would be best, but it would then have to be checked with each import whether the checksum already exists or whether it is new.