rlxone / Equinox

🌇 🌃 Create dynamic wallpapers for macOS.
https://equinoxmac.com
MIT License
1.24k stars 36 forks source link

Time - Times collide with other images (automatic even spacing between n number of images?) #19

Closed Macintosh-Fan closed 1 year ago

Macintosh-Fan commented 2 years ago

When I add 96 images using the Time option, it adds them all just fine, but the times in different images conflict, meaning the images in the sequence are: 12 AM, 1 AM, 2 AM, ..., 11 PM, 12 AM, 1 AM, etc..

Add an option to automatically separate the times for the images, such as every 15 mins in my case (96 images).

Macintosh-Fan commented 2 years ago

I inspected the code a bit, and it might be changing the following or doing something with it? At /EquinoxCore/EquinoxCore/Cores/MetadataCore.swift:202: let percentage = Double(hour) / 24

Macintosh-Fan commented 2 years ago

After a bunch of searching and modifying, this is what I found: At /Equinox/Equinox/Stories/Wallpaper/WallpaperGalleryDataController.swift:102: let time = calendar.date(byAdding: .hour, value: count, to: startTime)

For each image in the sequence, the timestamp is incremented by an hour, and it should be replaced with a specific increment depending on the amount of supplied images.

rlxone commented 2 years ago

Hi @Macintosh-Fan. Yes, it makes sense. The only thing i want to cover is that this will only apply for the first batch of images, otherwise the logic starts to be a bit complicated when appending new images (we need to detect if the user enters custom time or not)

Macintosh-Fan commented 2 years ago

It could just be a matter of doing some math calculation after all the images have been loaded, but there is floating-point accuracy too...

rlxone commented 2 years ago

yes, it's not a problem at all. I was thinking whether I want to recalculate the time for all images when appending new one via drag n drop or not.

rlxone commented 2 years ago

@Macintosh-Fan, i'll include it in upcoming version.

rlxone commented 1 year ago

Fixed in 2.0. App store build in review. https://github.com/rlxone/Equinox/releases/tag/v2.0