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

Support for ".nomedia" folder. Avoid bloated mediadb and crash when adding to mediadb #36

Closed
k3b opened this issue Apr 8, 2016 · 2 comments

Comments

@k3b
Copy link
Owner

k3b commented Apr 8, 2016

APhotoManager ver 0.4.6 and below does not obeye ".nomedia" folder so it adds photos from ".nomedia" folder to database.

A Crash in ver 0.4.6 ist reproducable this way: When opening a photo by file-path APhotoManager translates the path to a content-uri.

If the photo is not in found in the media database APhotoManager starts the media scanner to add the unknown file(s). After scan has finished the photo is opend without checks.

If the photo is in a ".nomedia" folder (or in bluetooth download) the scanner does not add the photo so after scanner has finished the photo is not in the media database.

@k3b k3b added the bug label Apr 8, 2016
@k3b k3b modified the milestones: v0.4.6.160304, v0.4.7 Apr 8, 2016
@k3b
Copy link
Owner Author

k3b commented May 10, 2016

There is more work than fixing the crash for this to complete:

The old APhotoManager completely depends on the media database to show photos

  • If APhotoManager is invoked with a file uri this uri is coverted to media-db-content: uri.
  • If the file is not found in the media-db it is added.
  • if files are copied/moved/deleted the media-db is also updated.

Neccessary changes:

  • When obeying the ".nomedia" indicator APhotoManager is not allowed to add photos from these directories to the media db.
  • GalleryView and PhotoDetailView must learn to use either media-db-data or (new) list of local files.
  • filtering/sorting does not work without database.
  • when files are copied/moved/deleted the media-db update is different depending on source-directory is (not) ".nomedia" and destination-directory is (not) ".nomedia"

Note: In some cases adding a ".nomedia" file to the media-db succeeds in some cases the content provider prevents it.

Note: There is also code neccessary to remove files from ".nomedia" folders from the media-db if APhotoManager-ver 0.4.6 and below has been run before.

Implementing this will take some time ...

k3b added a commit that referenced this issue May 11, 2016
@k3b k3b changed the title Crash when opening photo in .nomedia folder Support for ".nomedia" folder. Avoid bloated mediadb and crash when adding to mediadb May 17, 2016
k3b added a commit that referenced this issue May 17, 2016
….nomedia" after delete/copy/move fileoperatons
k3b added a commit that referenced this issue May 31, 2016
…ctivity to also work with files instead of imageIDs
k3b added a commit that referenced this issue May 31, 2016
k3b added a commit that referenced this issue Jun 6, 2016
k3b added a commit that referenced this issue Jun 6, 2016
k3b added a commit that referenced this issue Jun 6, 2016
k3b added a commit that referenced this issue Jun 14, 2016
@k3b k3b closed this as completed Jun 20, 2016
@kodeblacc
Copy link
Contributor

This issue is still happening, even in the latest release of the software and logcat doesn't reveal the problem.

It is reproducible with Dir File Manager and OI file manager

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

No branches or pull requests

2 participants