Skip to content

Commit baa5fa0

Browse files
authored
Merge pull request #68 from compufox/minute-support
fixed minutes not being utilized in time info calculation
2 parents 44e8ece + ed0b9ea commit baa5fa0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/WallpapperLib/DynamicWallpaperGenerator/ImageMetadataGenerator.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ public class ImageMetadataGenerator {
9898
let timeItem = TimeItem()
9999
timeItem.imageIndex = self.getImageIndex(fileName: item.fileName)
100100
let hour = Calendar.current.component(.hour, from: time)
101-
timeItem.time = Double(hour) / 24.0
101+
let min = Calendar.current.component(.minute, from: time)
102+
timeItem.time = (Double(hour) / 24.0) + (Double(min) / 60.0 / 24.0)
102103

103104
if sequenceInfo.timeItems == nil {
104105
sequenceInfo.timeItems = []

0 commit comments

Comments
 (0)