mvysny / photocloud-frame-slideshow

Android Digital Photo Frame
https://www.android-photo-frame.eu
14 stars 1 forks source link

Randomize Starting Photo #87

Open theQuicker1 opened 6 years ago

theQuicker1 commented 6 years ago

Low-priority Problem: Slideshow always starts with the same few photos at first.

Possible Solution: While discovering photos in root filters, if there are photos in the cache, display cache photos randomly while waiting for discovery to finish.

Possible side effect: once discovery finishes, the same photos that were in the cache are called up again.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/56408947-randomize-starting-photo?utm_campaign=plugin&utm_content=tracker%2F53303527&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F53303527&utm_medium=issues&utm_source=github).
ghost commented 5 years ago

I second this, but for me this is not low prio. I have years and years of photos that I would like to be shown. The way the application is currently working I will never get to see some photos but some others will be shown again and agiain.

Please fix.

mvysny commented 5 years ago

What kind of storage?

ghost commented 5 years ago

I use an ASUS router with a SMB server + UPNP and DNLA. Currently the DLNA service is used since the setup was so simple.

The folder view I am using gives a root folder with some few photos and then a large set of directories. Sometimes (but only occasionally) with a depth of 2-3 dirs.

However, I think I might have misunderstood how things work. I always get to see one of three/four photos when daydream or slideshow starts. After that I cannot really tell, but it looks like it's random enough (which should probably be enough).

According to my recent understanding the algorithm uses the cached photos only for a short while (while retrieving a new list from the server).

Is this correct ?

mvysny commented 5 years ago

Currently PhotoCloud uses only the urn:schemas-upnp-org:service:ContentDirectory:1 service which provides photos in hierarchical way (as a filesystem). I don't know whether UPNP/DLNA provides some kind of media server that would index all photos and provide (random) stream of photos to the clients such as PhotoCloud; I tried to find out but the UPNP/DLNA specification is huge and crazy. Really. And also probably not open-source or available for free. Or maybe it is, who knows. I could invest my time into this DLNA crap, but nobody would pay for it, so why bother. Yes, PhotoCloud earns nothing (~60 eur monthly after taxes, that's like 3 hours of working time per month tops, and that includes coding, answering forums, design, protocol study, everything).

And hence PhotoCloud's UPNP/DLNA connector (being hierarchical) suffers from the inherent issue of all hierarchical sources: photos closest to the root are shown soonest. The problem is that we start the photo discovery from root; if we discover photos we have two options: either show the photo right away, or delay and try to discover more photos. The first option causes the few photos in your root dir to be shown immediately; the second option causes very long initial delay of not showing anything.

You can read more about this in detail at #50

So, PhotoCloud will with high probability show initially the photos from the root. However, as the photo discovery progresses and the pool of photos is populated, the randomization algorithm becomes way better.

Also, every photo is shown exactly once. So a photo located in root may be shown immediately, but it is only shown again after all other photos have been shown.

ghost commented 5 years ago

Ok, seems reasonable.

In your opinion, which is the best service to use?

Could I easily share a folder that my server populates with links to random photos. Would it be updates reliably or would I risk race conditions with photos gone missing all of a sudden?

mvysny commented 5 years ago

In your opinion, which is the best service to use?

There are photo services that can index the photos and provide a search/query API which offers fully randomized list of photos. Typically those are cloud providers: Box, Flickr, Google Drive, Instagram, Local Gallery, Mega.

Services that do not support search/query API: DLNA, Dropbox, One, OwnCloud, Samba, SSH/SFTP.

Could I easily share a folder that my server populates with links to random photos. Would it be updates reliably or would I risk race conditions with photos gone missing all of a sudden?

Sure - PhotoCloud should gracefully handle and skip any suddenly missing photos.

mvysny commented 5 years ago

However, the idea of showing photos from cache until the FS image discovery creates a big enough pool of random photos is quite appealing. Let me think about this for a bit, whether the idea is compatible with PhotoCloud internals or not.