0

How can I force media-scanner to index a particular folder?

I use an app that takes photos and stores them in a sub-folder of it's own data folder. The data folder has a .nomedia file, so the photos sub-folder is ignored by Gallery etc. Is there an opposite of .nomedia file?

The data folder has a lot of other files an folders which should be ignored by media-scanner.

The ultimate aim is to have these photos backed up to my Google Photos account.

The target folder is not listed under Google Photos >> Settings >> Backup & Sync >> Device Folders.

I tried creating a symlink from (...)/sdcard/DCIM/foobaz to the (...)/foobaz/data/photos folder but get a message that the operation is not permitted.

Android 7.0, not rooted. (Samsung S6)

1
  • Delete the .nomedia file to force media scanning ( restart the phone. It is then that media scanner database is re indexed ) and it should appear in Google photos folder list for sync.

  • If you don't want that folder to be scanned by media folder at all, create a new folder in gallery ( use a third party file explorer from Play store , if your built in explorer can't do this ) and copy those photos into this folder manually. Verify, it's showing up in Gallery options to sync

  • Obviously, you wouldn't want to manually do this every time you use that app, so automate it. Macrodroid app implement it this way

Trigger: Application Launched / Closed → Closed → Select your app

Action: File operation → Select paths and move / copy options

This ensures that everytime you close your app, pictures are moved / copied into gallery sub folder and available for sync

  • I deleted the nomedia file but it doesn't appear in folder list. I tried forcing a re-index by installing and running "SD Scanner" app by Jeremy Erickson but that hasn't changed things. I'll let it sit for a day to see if it just needs more time – matt wilkie Jul 24 '17 at 7:38
  • Restarted phone but Photos still doesn't see it. ... Then discovered the nomedia file keeps being recreated. Looks like I have no choice but to copy the files as suggested for option 2.(might run out of room for that) – matt wilkie Jul 25 '17 at 1:05
  • Instead of copy, there is a move option also, which will prevent duplication – beeshyams Jul 25 '17 at 2:02
  • You can experiment with file operation V2 Actions also if it helps – beeshyams Jul 25 '17 at 4:50
  • Moving isn't an option because the app still needs the photos. For now I manually copied the photos using ES File Explorer, let them back up, then used 'delete from device' – matt wilkie Jul 29 '17 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.