Nextcloud Pictures-Directory not shown in Gallery

REPRODUCIBILITY: 100% (always)
OSVERSION: 4.5.0.19
HARDWARE: Sony Xperia XZ2 Compact - h8314 - h8314 - 0.5.0.1 - aarch64
UI LANGUAGE: Deutsch (user: de_DE, os: de_DE.utf8)
REGRESSION: not specified

DESCRIPTION:

After setting up the correct path to Pictures on WebDAV-Resource the Directory don’t show up in Gallery like OneDrive for example.

PRECONDITIONS:

Set up on Synology-NAS with WebDAV. Manual Backups work always!

STEPS TO REPRODUCE:

  1. Create a Nextcloud Account
  2. Set path to Picture-Directory
  3. No Picture-Directory in Gallery

EXPECTED RESULTS:

Picture-Directory show up at Gallery

ACTUAL RESULTS:

No Picture-Directory for Nextcloud show up in Gallety

MODIFICATIONS:

  • Patchmanager: yes
  • OpenRepos: yes
  • Chum: yes
  • Other: none specified

ADDITIONAL INFORMATION:

Device Owner User: defaultuser
Home Encryption: not supported


the initial version of this bug report was created using Bugger 0.9.9+git4

I am confused, do you run nextcloud on top of the NAS OS (probably DSM) or nextcloud exclusively or should be expexted that nextcloud account can access any generic WebDAV solution?

I am confused, do you run nextcloud on top of the NAS OS (probably DSM) or nextcloud exclusively or should be expexted that nextcloud account can access any generic WebDAV solution?

I am using Synology NAS with newst DSM 7.x Operating-System which doesn´t allow to install Nextcloud-Support like in the old Days. I enabled WebDAV on the Synology-NAS and connection and manual Backup to it/from it works always so i wonder why it isn’t the same with the Gallery.

If this isn´t supposed to work so then i have a wish that Jolla can add a generic “WebDAV Resources” to Accounts.

I guess for pictures it is more complicated because you have to access the database interface of nextcloud. However, I think also with DSM 7.x it is possible to install nextcloud on top of DSM, see here https://blog.viking-studios.net/nextcloud-installation-auf-einer-synology-diskstation-mit-dsm-7-0/ (unfortunately only in German).

I’m german, so no problem here.

So installation Nextcloud to Synology is a deep operation/modification which i doesn´t want for several reasons (securtiy, clearness of the vanilla system…etc)

So there is no other “easy” solution to show a WebDAV-Resource in Gallery?

I think there is a tool to mount WebDAV resources to the filesystem. If the mount point is set properly, the tracker should include pictures in gallery then.

Edit: It is called davfs2 and is available from Chum and Openrepos.

I use dafs2 also but i will only show certain Dirs because there are Gigabytes of Pictures which tracker3 shouldn ´t scan/create thumbnails for Days creating them.

Alternatively, rclone can be used to both mount, and sync, WebDAV resources.

Not packaged, but you can install from rclone.org.

1 Like

I know, i write a Tutorial for it before here:

The Question was how to add a new Direcory-Item to Gallery.

In the meantime i create a android_storage Directory in home-Dir (my used Tama-Port has sadly no official Android-Support, so this Dir doesn´t exists) and now the Gallery shows there an Empty new Line, i try around with Softlinks if this could work and will post here.

I think I remember from patching the Gallery app that it checks for AD running and only enables that folder then.

However, it’s relatively easy to hack Gallery to show other paths:

1 Like

I did add this to gallery.qml but it seems there are some missing parts (import-section):

Looks alright, but that only configures the display of the folder.
It still has to be added to the Indexer (tracker3) so it can display anything.

Haven’t done that part but there’s

gsettings get org.freedesktop.Tracker3.Miner.Files index-recursive-directories

which has a list of dirs that’s indexed. You’ll have to add $HOME/NAS/Bilder to that list. I believe that can be done with something like

# note the -p for devel-su
devel-su -p tracker3 index --add --recursive '$HOME/NAS/Bilder'
1 Like

Looks alright, but that only configures the display of the folder.

I’m not 100% sure this is enough modification, at least the Gallery should show an empty Entry but it doesn´t. And Videos from the ~/NAS/Bilder/2023 are shown inside the Video-Dir of Gallery without Thumbnail. So there must be something of a sorting Part inside the Gallery-Code.

Tracker3 is working and Tracking, so this Part should be adressed.

Ah, yes you have just added a Model to the app.

You need to display it in GalleryStartPage.qml using a MediaSource element:

    SilicaGridView {
         id: view
         objectName: "albumsView"
         //...
         model: MediaSourceModel {
      
             // Existing entries...

             MediaSource {
                id: nasPhotoSource
                //% "Photos"
                title: "NAS %1".arg(qsTrId("gallery-bt-photos"))
                icon: "PhotoIcon.qml"
                page: "GalleryGridPage.qml"
                model: nasStorage
                ready: true
                busy: model.status == DocumentGalleryModel.Active
                count: model ? model.count : 0
                type: MediaSource.Photos
            }

            // other entries

        }
2 Likes

Thanks for that Code-Snippet, now its displayed and also the Thumbnails but the Pictures can´t be opened but it shows the Exif-Data correct, i guess Gallery have no rights to access the Pictures?

Most likely, yes.

You can just add your paths to the Pictures permission, or invent a new Permission and add that in the .desktop file.

1 Like

Quotation marks need to be used:

devel-su -p tracker3 index --add --recursive "$HOME/NAS/Bilder"

I did add:

[X-Sailjail]
Permissions=UserDirs;MediaIndexing;Ambience;Privileged;Internet;Synchronization;RemovableMedia;Audio;Accounts;PublicDir,Pictures;Videos

to /usr/share/applications/jolla-gallery.desktop

But can´t still open Pictures.

With Linux-Mint-Terminal (Gnome-Terminal) that Quotation → ’ works:

[defaultuser@XperiaXZ2Compact ~]$ tracker3 index
Pfad Rekursiv
/home/defaultuser/Desktop *
/home/defaultuser/Documents *
/home/defaultuser/Downloads *
/home/defaultuser/Music *
/home/defaultuser/Pictures *
/home/defaultuser/Videos *

(tracker index:2400): GLib-CRITICAL **: 11:14:30.352: g_file_test: assertion ‘filename != NULL’ failed

(tracker index:2400): Tracker-WARNING **: 11:14:30.352: Could not expand XDG user directory $HOME/android_storage/DCIM

(tracker index:2400): GLib-CRITICAL **: 11:14:30.353: g_file_test: assertion ‘filename != NULL’ failed

(tracker index:2400): Tracker-WARNING **: 11:14:30.353: Could not expand XDG user directory $HOME/android_storage/Download

(tracker index:2400): GLib-CRITICAL **: 11:14:30.353: g_file_test: assertion ‘filename != NULL’ failed

(tracker index:2400): Tracker-WARNING **: 11:14:30.353: Could not expand XDG user directory $HOME/android_storage/Pictures

(tracker index:2400): GLib-CRITICAL **: 11:14:30.353: g_file_test: assertion ‘filename != NULL’ failed

(tracker index:2400): Tracker-WARNING **: 11:14:30.353: Could not expand XDG user directory $HOME/android_storage/Podcasts

(tracker index:2400): GLib-CRITICAL **: 11:14:30.353: g_file_test: assertion ‘filename != NULL’ failed

(tracker index:2400): Tracker-WARNING **: 11:14:30.353: Could not expand XDG user directory $HOME/android_storage/Music
/home/defaultuser/NAS/Bilder/2023 *

I get the same warnings but everything seems to work despite them.
If I copy pictures to android_storage/Pictures, Gallery shows them in the Android Storage folder.

This does not work, though:
If there are videos in android_storage/Movies, Gallery does not show them. This is because android_storage/Movies does not seem to belong to the default folders to be indexed.

After this command

devel-su -p tracker3 index --add --recursive "$HOME/android_storage/Movies"

it gets better. Gallery starts showing those videos in the Videos folder (although not in Android Storage). No need to run tracker3 index .

1 Like