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.
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:
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'
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
}
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.
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
.
[defaultuser@XperiaXZ2Compact ~]$ /usr/bin/sailjail -p jolla-gallery.desktop /usr/bin/jolla-gallery
constructing /run/firejail/mnt/privileged: Images,Ambienced,msyncd,Accounts,Keys …
mounting /run/firejail/mnt/privileged @ /home/defaultuser/.local/share/system/privileged
hiding /run/firejail/mnt/privileged
[D] unknown:0 - Using Wayland-EGL
library “libGLESv2_adreno.so” not found
library “eglSubDriverAndroid.so” not foundError: Input file path cannot be read: /home/defaultuser/NAS/Bilder/2023/IMG_20230423_101731.mp4
[W] unknown:0 - NemoThumbnailCache::ThumbnailData {anonymous}::generateVideoThumbnail(const QString&, const QString&, const QByteArray&, const QSize&, bool) Could not generateVideoThumbnail: “/home/defaultuser/NAS/Bilder/2023/IMG_20230423_101731.mp4” QSize(512, 512) true
Error: Input file path cannot be read: /home/defaultuser/NAS/Bilder/2023/IMG_20230417_074131.mp4
[W] unknown:0 - NemoThumbnailCache::ThumbnailData {anonymous}::generateVideoThumbnail(const QString&, const QString&, const QByteArray&, const QSize&, bool) Could not generateVideoThumbnail: “/home/defaultuser/NAS/Bilder/2023/IMG_20230417_074131.mp4” QSize(512, 512) true
Error: Input file path cannot be read: /home/defaultuser/NAS/Bilder/2023/IMG_20230415_102301.mp4
[W] unknown:0 - NemoThumbnailCache::ThumbnailData {anonymous}::generateVideoThumbnail(const QString&, const QString&, const QByteArray&, const QSize&, bool) Could not generateVideoThumbnail: “/home/defaultuser/NAS/Bilder/2023/IMG_20230415_102301.mp4” QSize(512, 512) true
Error: Input file path cannot be read: /home/defaultuser/NAS/Bilder/2023/IMG_20230414_191634.mp4
[W] unknown:0 - NemoThumbnailCache::ThumbnailData {anonymous}::generateVideoThumbnail(const QString&, const QString&, const QByteArray&, const QSize&, bool) Could not generateVideoThumbnail: “/home/defaultuser/NAS/Bilder/2023/IMG_20230414_191634.mp4” QSize(512, 512) true
[W] unknown:52 - file:///usr/lib64/qt5/qml/Sailfish/Gallery/ImageViewer.qml:52:5: QML Image: Cannot open: file:///home/defaultuser/NAS/Bilder/2023/IMG_20230501_183102.jpg
[W] unknown:52 - file:///usr/lib64/qt5/qml/Sailfish/Gallery/ImageViewer.qml:52:5: QML Image: Cannot open: file:///home/defaultuser/NAS/Bilder/2023/IMG_20230501_183100.jpg
[W] unknown:1154 - file:///usr/lib64/qt5/qml/Sailfish/Silica/PageStack.qml:1154:13: QML Binding: Binding loop detected for property “value”
[W] unknown:1154 - file:///usr/lib64/qt5/qml/Sailfish/Silica/PageStack.qml:1154:13: QML Binding: Binding loop detected for property “value”
[W] unknown:1154 - file:///usr/lib64/qt5/qml/Sailfish/Silica/PageStack.qml:1154:13: QML Binding: Binding loop detected for property “value”
Would the path /home/defaultuser/Pictures/NAS/Bilder/2023/… work better?
Would the path /home/defaultuser/Pictures/NAS/Bilder/2023/… work better?
Not in all aspects:
- Thumbnails for Pictures are created and showed in Gallery-Dirs and when opening the Overview-Page of NAS, but open a Picture is not possible (not found), Exif-Data are shown of each Picture.
- Thumbnails for Videos are not created (maybe through too big files or missing permissions) but shown without Thumbnail inside Video-Dir (which seems to be some kind of internal Sorting for Video-Files, which isn´t a bad idea). Open Video not Possible but also Info (Exif-Info are shown).
So tracker3 do its part here, the Sailjail-Permissions are all set, so there must be other Problems with my dafs2fs-share or permissions for Gallery.
Softlinking the ~/NAS/Bilder/2023 inside Pictures is no option for me because then all content will be Displayed under Pictures from Phone-Memory/SD-Card which create doubled content there.