kensanata / sitelen-mute

a static image gallery creator
https://alexschroeder.ch/software/Sitelen_Mute
GNU General Public License v3.0
75 stars 7 forks source link

FIXME: Need a way to identify existing files when updating #9

Closed 0-ast-0 closed 6 years ago

0-ast-0 commented 6 years ago

There's that comment in there which I was intending to address next.

I had once started doing this with a

use Digest::SHA; ... $data{sha} = $sha->hexdigest();

in the data.json.

Another thing I wanted to put into data.json was an (optional) "first" slide and whether to start a slide show right away. Another thing that might want to be tuned is the slideshow speed (per album).

What do you think?

kensanata commented 6 years ago

Digests sound good to me. I don’t mind adding them to data.json but wondered whether we should keep it in a separate file such as not “pollute” the data.json file. But for simplicity’s sake we might as well start with data.json and then we can still pull them apart later. Then again, perhaps the original mtime of the file would be good enough, no need for digests? I’ll leave it to the person implementing it. Anything is better than what we have right now. :)

As for “first” slide: I don’t know. Would that slide then come twice, once because it is first and once at the right time? Perhaps it makes sense to pick one image for the OpenGraph metadata so it will be used for previews but nothing else?

As for slideshow speed: I never use the slideshow so whatever you need feel free to do it.

0-ast-0 commented 6 years ago

No, the slide would not appear "twice" the slide show "loop" would simply start there, i.e. instead of /#1 it'd start at /#N, the first time around, whatever the Nth slide is. The slide show would start right away and only stop on a click in the middle at which time the side bar with the thumbnails appears.

The thinking behind this is that an album often has an impressive photo but it is not necessarily chronologically first. So it is a teaser when you send the URL to your friends: they see the picture you are most proud of first and maybe will look at the whole album.

Some albums might want fast speed, others slow. Something I think would be nice to tune at creation time.

kensanata commented 6 years ago

Ah, I see. Works for me!

kensanata commented 6 years ago

I hope you're OK with me assigning this issue to you, @0-ast-0?

0-ast-0 commented 6 years ago

Yes, no problem. I think I'll compare filesize, timestamp and Digest::SHA: if two out of three match, it's the same picture and is skipped on update. Maybe I'll have time this weekend.

kensanata commented 6 years ago

Perfect!

0-ast-0 commented 6 years ago

With the last pull request I think you can close this now. It ended up being much more work as file removals and the ZIP file also had to be considered. I'll be using this feature a lot now to upgrade my galleries! BTW, I'd appreciate it if you'd also recognize me as a "contributor".

kensanata commented 6 years ago

Feel free to add your name and contact info wherever it makes sense. "Authors and Copyright" section in README.md, copyright statements in source files, etc.

kensanata commented 6 years ago

Closed by 98a434a.