What are currently considered the best practices in using .nomedia touch files (to avoid media being indexed)?
should SailfishOS native applications drop their own files? (I’ve seen a few Android apps doing exactly that)
should we leave it to the end user to decide and create the files themselves?
Context:
Stellarium comes with a very large amount of pictures (backgrounds, constellations in various cultures, etc.) which “pollute” the Gallery.
So:
Should I upgrade the .spec file so the RPM drops a .nomedia inside Stellarium’s datadir ?
Only /home is indexed. You should not install anything to /home. If that files are installed by an app running by user it should be an option in app settings that allows to index pictures from datadir or not. Average user knows nothing about .nomedia files but always cares about “polluted” Gallery.
It is?
Seems wrong to me. On a stationary GNU/Linux it used to be relatively common to mount /usr/share from a different partition, but that is not the same as abusing a user-mounted SDCard for that. Expand your root partition instead.
In any case, you are free to drop a .nomedia in /usr/share top level directory (wherever that is on your SDCard).
Until the recent models with significant storage (my current Xperia 10iii and PinePhone Pro both have 128GiB storage), saddly this wasn’t a (good) option: there wasn’t that much storage to expand upon without needing to compromise the home partition.
The usual strategy isn’t straigh mounting /usr/share (that would render the phone unbootable if the card is missing) but just moving a couple of very large directories used by applications to the SD-card and putting symlinks to those back in /usr/share
Hi, and sorry for hijacking this thread (didn’t want to make a new one and I’m not soo off topic).
Is there a reason why the file .nomedia gets immediately deleted when creating it in the root directory of sd-card (/run/media/defaultuser/<cardid>/)?
I cded into the directory and first tried touch .nomedia; ls -a
and then touch .foo; ls -a; mv .foo .nomeda; ls -a
and even touch .foo; chmod -w .foo; ls -la; mv .foo .nomedia; ls -a
always ending up with not having .nomedia in it.
It works fine when creating the file in subdirectories.
P.S. SFOS 5.2.0.17 on JP2601, SD card is exFAT formatted
It just disappears?
I cannot reproduce this.
And any other file can be created, hidden or not?
Have you tried creating .nomedia files in subdirectories?
I’m on 5.1.0.11 and the sdcard is formatted ext4. Not that I think it matters.
Can you post grep /run/media /etc/mtab please?
Also ls -al /run/media/defaultuser/*/
Is it possible to run fsck on exFAT filesystems? Worth a try. Unmount it first, then devel-su fsck -lNMV /run/media/defaultuser/*/
Yes, it disappears immediately after creating it. And only this specific name.
Hint: Before inserting the card, I had already created a .nomedia in its root directory on my PC. After inserting the card into the phone that file persisted a while (maybe for about 5min). When I saw that unwanted picture and audio files where appearing in my media db, I cleaned and restarted localsearch (former tracker). From that moment on, every attempt to recreate .nomedia failed.
I also tried localsearch index --remove /run/media/defaultuser/<cardid> but without success.
Not sure about fsck on exFAT (unfortunately, SFOS lacks man pages).
It seems to be Android-related.
When AAS is disabled, both .nomedia and .trackerignore persist in SD-card’s root folder.
When AAS is enabled, .nomedia gets deleted after some seconds (and some other empty folders are automatically created), .trackerignore still persists.
The option Show your SailfishOS media in the Android Gallery was always disabled. (Nevertheless, I’d prefer my SD card not being visible at all to Android)
P.S. regarding your questions: I mainly used localsearch reset -s to clean-restart the tracker and then localsearch status to check for completion and whether it indexed too much.
P.P.S. From now on all tests without AAS being enabled:
Both .nomedia and .trackerignore on the card’s root are being ignored by localsearch (it happily traverses the full SD card).
When either .nomedia or .trackerignore reside in a subfolder, localsearch adheres to them (i.e. skips that subtree).
Yeah I tried that yesterday and it did not delete the file either.
Not saying your experience is invalid.
P.S. regarding your questions: I mainly used localsearch reset -s to clean-restart the tracker and then localsearch status to check for completion and whether it indexed too much.