Android icon indicating copy to clipboard operation
Android copied to clipboard

Delete existing database upon import

Open edwin-2023 opened this issue 7 months ago • 15 comments

I'm sharing the database between me and my wife. I'm the guy who adds cards and then export. Share export via WhatsApp and import with phone of my wife. Everytime I get double entries. So now I'm delete cards first, one by one (no multi select possible). So multiselect would be nice but it would also be solvable if I got an option to select clear database upon using the import function.

edwin-2023 avatar May 20 '25 18:05 edwin-2023

I'm not sure why you would re-import all entries all the time given you can just click the "Share" button on a card to share a copy (though sadly without images) to her over WhatsApp, but I do see the value in being able to delete everything before importing. Right now, when I do this for testing I just clear the Catima app data in Android app settings, but this has the added downside of also removing all preferences.

The failure to deduplicate is a bug, (see #2349), so you shouldn't see duplicates in the first place, but that doesn't mean this request isn't still useful.

I'm a bit confused about your comment on multiselect. You can long-press multiple cards on the home screen to select them and either hit share or hit "Delete" under the 3 dots in the top right.

TheLastProject avatar May 20 '25 19:05 TheLastProject

My bet on multiselect, it does work. Has this been working for quite some time? If that's the case I must have done something wrong.

The rest, would be awesome if I could clear the database during import!

edwin-2023 avatar May 20 '25 19:05 edwin-2023

Been taking a quick look into this. It's not too hard, it just needs to be sent like 6 functions deep because the importer is kind of a mess (see #513). I also can't help but notice that the current UI flow is very much not designed for an extra checkbox to delete existing data or not.

I think it would probably be good to take a second to think about what the UI for this should look like :) If it doesn't have to happen right at import, it also simplifies everything a lot, as the messy importer code wouldn't need touching.

TheLastProject avatar May 20 '25 20:05 TheLastProject

Ai. Perhaps an option in the settings section? New settings subsection with; Clear database now (with a warning) But to be honest. Still nice to have but now I found the multiselect I can live with it. It's only 30sh card I have to delete before import.

Another nice one for that subsection. Backup database upon new entry on selectable location

Regards, edwin

edwin-2023 avatar May 21 '25 06:05 edwin-2023

I'm part of the "uncommon" crowd. I have Catima loaded on multiple devices and use the Export function on my main phone to backup the Catima database, sync it to my NAS, then copy the files to backup devices to Import.

Having to delete the duplicates is not that time consuming but I don't want to have to sit down and figure out what all the new cards are to share. For me it's just simpler to backup everything in one hit, copy the file to another device, then restore everything.

If the dedupe coding eventually gets repaired that will sort out this issue.

yrp888 avatar Jul 02 '25 07:07 yrp888

Thanks, that's how I do it also. I use 1 device as master and the others as manually slave.

edwin-2023 avatar Jul 02 '25 08:07 edwin-2023

Is there any update for this "duplicate entries" issue? (probably caused by images of entries)

KlausD-GH avatar Sep 06 '25 08:09 KlausD-GH

If no update is posted in an issue you can generally safely assume no update exists. I mostly do Catima by myself in my spare time next to a fulltime job and other projects I contribute to (like IzzyOnDroid), with the occasional help from contributors (which I very much appreciate). A single person just can't solve 150 issues alone, so many things won't get a fix unless someone jumps in to help :)

TheLastProject avatar Sep 06 '25 09:09 TheLastProject

I worked around it by multi select & delete before import. No rush 😉

edwin-2023 avatar Sep 06 '25 10:09 edwin-2023

If no update is posted in an issue you can generally safely assume no update exists. I mostly do Catima by myself in my spare time next to a fulltime job and other projects I contribute to (like IzzyOnDroid), with the occasional help from contributors (which I very much appreciate). A single person just can't solve 150 issues alone, so many things won't get a fix unless someone jumps in to help :)

I can work around it too, and appreciate all the effort you've put into the app so far. My coding days were long over 3 decades ago so I am no help!

yrp888 avatar Sep 06 '25 10:09 yrp888

Hi @TheLastProject , can I work on this issue?

matuspetro avatar Oct 03 '25 09:10 matuspetro

Sure @matuspetro. What is your plan on how to implement this? What would the UI and flow be like?

TheLastProject avatar Oct 04 '25 16:10 TheLastProject

I assume, if I fix issue #2349, this issue will be fixed too. But it is possible while importing data to ask user, if user wants to delete all cards or not. But I am ready to fix it as you want @TheLastProject 😊

matuspetro avatar Oct 04 '25 16:10 matuspetro

They're different issues. But if #2349 gets fixed, this issue is indeed less important, because people will less often get cards they don't want in their Catima.

TheLastProject avatar Oct 04 '25 16:10 TheLastProject

I agree, thats why Im focusing on issue #2349. Can you assigne me there?

matuspetro avatar Oct 04 '25 17:10 matuspetro