scubajeff / lespas

Les Pas, photo album app for Nextcloud user
Apache License 2.0
455 stars 22 forks source link

Not syncing photos from server #2

Closed zoenglinghou closed 2 years ago

zoenglinghou commented 3 years ago

Describe the bug After logging in, the app is not syncing photos from NC.

To Reproduce Steps to reproduce the behavior:

  1. Log in and grant access
  2. Turn on periodic syncing
  3. Wait for a long time (overnight for me)
  4. No image/preview showing up

Expected behavior Images/preview showing up in the main interface

Screenshots Screenshot_20201223-140250 Screenshot_20201223-140319

Smartphone (please complete the following information):

scubajeff commented 3 years ago

app sync with folder /lespas on server. every subfolder under /lespas will appear as an album in app.

zoenglinghou commented 3 years ago

Thank you for your answer! I would try it out by simlinking the photos folder to /lespas

zoenglinghou commented 3 years ago

hmmm, does the app download from the server? I symlinked my photos and movies photo under /lespas and ran occ file:scan on them. They show up on the NC web interface but not downloaded on les pas. Les pas can also upload images. So does symlink not work or does les pas not syncing from server?

scubajeff commented 3 years ago

lespas use webdav. i thought webdav can do well with symlink files. will test this on my side today. hang on.

scubajeff commented 3 years ago

symlink nextcloud's /Photos folder to /lespas/nextcloud. and a new album 'nextcloud' appeared in my lespas app. could you please give me more detail on how you symlink?

my server setup is nextcloud v20.04 running on ubuntu 20.04

zoenglinghou commented 3 years ago

I have the same server setup as yours. I symlinked /Photos/Camera and /Movies/Camera with subfolders to /lespas/. I don't know if it is the recursive folder structure that causes les pas to fail.

scubajeff commented 3 years ago

recusive is fine although lespas only sync files within those subfolders.

PietroMB commented 3 years ago

I have the same issiue described by zoenglinghou, I've also tryed create the directory "/lespas" via browser, but the app looks not upload image at all, but pls don't give up! this is a fantastic project! There is a way to give you more detailed log? I'm not a pro in android but I'll be glade to help you out with this project

scubajeff commented 3 years ago

you don't need to create the home folder lespas/, it will be created by lespas app automatically once you signed in. so this makes me wonder where are you guys looking for your files.

lespas/ folder will be created by lespas app in your Nextcloud home folder, lespas will sync album it created in the app to a subfolder with album's name under lespas/. or you can created a subfolder or symlink a traget as a subfolder under lespas/ on the server side, lespas app will sync them to your phone as an album, of course empty folder will not show up, since lespas organize photos into album and needs at lease one photo to act as the cover art. recursion folders are fine and will not stop lespas from syncing, just that it won't walk further down any subfolders in the album's folder.

the other possibility will be WebDAV, it's related to sever setup of Apache or/and PHP that stop WebDAV from reading symlink files. That's something not easy for me to debug remotely. However, I didn't make any special configuration when I setup my own Nextcloud server and I tested symlinked folder, works for me here.

scubajeff commented 3 years ago

So could you guys please elaborate a little bit more about how you put files into lespas/ folder? Thought it's should be a straight forward thing but devil is in the detail. Many thanks for supporting this project.

zoenglinghou commented 3 years ago

ok, so here is my /lespas folder:

$ ls -l
total 0
lrwxrwxrwx 1 www-data www-data 16 Dec 26 12:14 Movies -> ../Movies/Camera
lrwxrwxrwx 1 www-data www-data 16 Dec 26 12:13 Photos -> ../Photos/Camera

and inside these folders are the photos uploaded to NC using the NC App, organized by dates:

tree -L 3 -l
.
├── Movies -> ../Movies/Camera
│   ├── 2020
│       ├── 01
│       ├── 05
│       ├── 06
│       ├── 07
│       ├── 08
│       ├── 10
│       ├── 11
│       └── 12
└── Photos -> ../Photos/Camera
    ├── 2020
    │   ├── 01
    │   ├── 02
    │   ├── 03
    │   ├── 04
    │   ├── 05
    │   ├── 06
    │   ├── 07
    │   ├── 08
    │   ├── 09
    │   ├── 10
    │   ├── 11
    │   └── 12
    └── Camera -> ../Movies/Camera

For whatever reason, the photos and videos are not showing up. Not sure it is because of the subfolders...

And once again, thank you for building this app!

PietroMB commented 3 years ago

At first I didn't create the folder, I waited for the app to do it automatically, but since it didn't, I thought I'd "help" by creating it manually. I use the standard docker version of nextcloud

Down below the video of what I do after reinstall the app via f-droid

https://user-images.githubusercontent.com/15186555/103150619-38d30a80-4776-11eb-8d96-95312071a8c6.mp4

PietroMB commented 3 years ago

I realized now that a strange thing happens, the application does not use the internet at all photo_2020-12-26_12-33-55

scubajeff commented 3 years ago

i see. lespas only sync files in the subfolder and the subfolder only, won't walk down further. so in your case, files in Movies and Photos should be synced to your phone, but those in 2020 and 01, 02, etc. won't. seems like lespas's folder structure is not what you like. ;)

scubajeff commented 3 years ago

@PietroMB if it singed in and created the folder, then the app should have use the network.

lespas default setting is to Not use mobile network.

ohthehugemanatee commented 3 years ago

Having this trouble, too. The app created /lespas, and I've tried

It certainly looks like there's no problem with WebDAV: the local client (which uses WebDAV I believe) wants to sync the entire lespas directory.

Replication isn't hard: just validate against publicly available docker images of nextcloud. I'm using linuxserver/nextcloud, so you can try with that. It builds off of alpine with NGINX. So maybe the issue is with NGINX?

scubajeff commented 3 years ago

@ohthehugemanatee those are exactly as designed. Albums in app have one to one relationship with a subfolder under lespas/ on server, e.g., album "Trip to Paris" in app will sync to server as a subfolder named "Trip to Paris", all the photos in that album will reside in that folder too. Of course you can create that subfolder on server first and then sync to app on phone side. Any file in lespas/ folder or any subfolder within subfolder will be ignored.

This is what Les Pas is designed for, a photo management app based on Albums.

ohthehugemanatee commented 3 years ago

I tried creating a directory and adding a handful of photos to it... that worked as expected (was visible as a gallery in le pas). So it seems like - at least in my case - if le pas finds any subdirectories, it ignores the whole directory. @scubajeff is this the intended behavior?

I suggest a more intuitive behavior is either:

Is there interest in a patch for one or the other behavior? I've never written in Kotlin, but these behaviors strike me as pretty beginner-friendly...

scubajeff commented 3 years ago

@ohthehugemanatee Ever since I released this app, I have received so many different kinds of requests on how photos should be organized, by years, by tags, by location, by faces, etc. Each and every one of them has it's solid point. But I believe by event is the most simple and effective way. Because when someone starts searching his/her memory for a moment in the past, it's hard to recall exactly when or the exact location or people around, however it would be easy to remember what exactly happened during that period of time, like it's my little boy's birthday, or it's a family trip to Maldive. Organize photos by events or I should say in Album in our case here, requires extra effort, you just can't rely on machine to sort it out for you. But in the long run, it is the best way to find your photos.

ohthehugemanatee commented 3 years ago

TBH i personally just like all my photos in there chronologically. But i hear you, everyone has their way of organizing.

IMO there are two separate technical issues here: how to get photos to sync, and how to organize the display of synced photos.

I suggest:

This makes for maximum flexibility and integration with everything else in the Nextcloud ecosystem. The only problem is, I'm not sure if the Nextcloud API lets you query for metadata in such an open-ended way.

scubajeff commented 3 years ago

This is exactly what I did about 15 years ago. Gallery program in Windows first introduced this feature, I was so fond of it and tagged almost every single one of my photos with it. But then, I decided Linux is the way to go and those tags and the time I spent on them are all wasted. Since then, I made up my mind not to rely on any specific features of a platform. Nextcloud is good and I'm a happy user of it right now, but who knows what will happen 2 years down the road.

ohthehugemanatee commented 3 years ago

ok, so how do you see handling "events" using only native filesystem and EXIF attributes?

scubajeff commented 3 years ago

I think I have made my point clearly, I will only use platform independant ways to manage my collection. Just try to balance between portability and fuctionality.

ohthehugemanatee commented 3 years ago

Yes, I understand your point and you did make it clearly. I'm asking about how you plan to implement so I can offer help and/or realign how I organize my photos to try and match. Apologies if the text isn't carrying my intended, constructive tone.

scubajeff commented 3 years ago

I don't really have a thoughtful plan right now, maybe a search function.