Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android app: duplicate photos/videos #1337

Open
tmciver opened this issue Jan 3, 2021 · 5 comments
Open

android app: duplicate photos/videos #1337

tmciver opened this issue Jan 3, 2021 · 5 comments
Labels

Comments

@tmciver
Copy link

tmciver commented Jan 3, 2021

I'm using the Android app to sync photos/videos from my phone to my Perkeep server. I've seen many instances of duplicate permanodes being create but this does not always happen.

Assuming this issue can be addressed at some point is there a way to remove duplicate permanodes? I have not seen any way in the docs to delete them.

@aviau
Copy link
Member

aviau commented Jan 21, 2021

The web ui has a delete button that does just that. Otherwise deleting a permanode is by creating a delete claim.

pk put can do it. See pk put delete -help.

This should be documented under pk put -help examples, but it isn't. I'll submit a patch.

@aviau aviau added the android label Jan 21, 2021
@aviau aviau changed the title Duplicate Permanodes android app: duplicate photos/videos Jan 21, 2021
@tmciver
Copy link
Author

tmciver commented Jan 28, 2021

@aviau Thanks for the reply. I had not noticed that I could do it through the web UI. But that turns out to be a bit tedious in my case since there seem to be quite a few duplicates. I'd like a way to say "delete all but one permanodes that point to the same data". I realize that one might not want to do this in general but in my case I'm confident it would be safe. Do you know if there's a way to do that? If not, I could try writing the code to do that myself.

@aviau
Copy link
Member

aviau commented Jan 28, 2021

You can do it with a simple shell/python script using pk commands, or the http API.

  • Iterate over all permanodes (pk search -limit -1 -1 '')
  • Find what they are pointing to pk describe <permanode> (see camliContent)
  • Delete it if you have seen it before. pk put delete <permanode>

Note that pk search has paging support in case you have a very large number of permanodes. See pk search -help (-limit and -continue)

@tmciver
Copy link
Author

tmciver commented Jan 28, 2021

@aviau Awesome! Thanks for that. I'll try it out.

@MichaHoffmann
Copy link
Member

When bumping the android app just now i realized that there are two inotify events when taking a picture. First the picture is created with a ".pending" prefix and then its moved into position. We enqueue both events and its a race if both files are uploaded. Probably thats the case of duplicates. Should be fixed in #1598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants