Breta01 / docus

Android application for scanning and managing documents.
https://play.google.com/store/apps/details?id=com.bretahajek.docus
GNU General Public License v3.0
51 stars 7 forks source link

Pages added to wrong document #28

Open ghost opened 2 years ago

ghost commented 2 years ago

I scanned a document with two pages and then I scanned another two page document, but assigned it the same name. This created some confusion in the app which caused the second page of the second document to be added to the first document instead.

Breta01 commented 2 years ago

Ou, stupid mistake I guess. I am identifying documents just by name so collisions can occur. I think that something as adding timestamp to the name should solve the problem.

If you want, you can create a fix and I will happily integrate it into the repo.

In other case I will try to get to it once I have some free time.

Dne pá 17. 9. 2021 11:26 uživatel plonibarploni @.***> napsal:

I scanned a document with two pages and then I scanned another two page document, but assigned it the same name. This created some confusion in the app which caused the second page of the second document to be added to the first document instead.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Breta01/docus/issues/28, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOP5YFQ4M3ON3QUAQSOLQTUCKYNFANCNFSM5EGCUUFQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ghost commented 2 years ago

I took a quick look around the code but I didn't clearly find the code that manages this, so if you could point me to the code I might be able to propose a fix.

It seems like you're using a database to store the document info, so it might make sense to reference the document internally by it's ID in order to prevent such collisions.

Breta01 commented 2 years ago

Okay, I was just checking the code. The issue is in:

Images of pages are then saved in folder which uses naming convention: documentName-<timestamp> so that should be ok.