Skip to content

Commit

Permalink
Remove default appearance (dark/light) when is not specified in json.
Browse files Browse the repository at this point in the history
  • Loading branch information
mczachurski committed Jan 10, 2021
1 parent bff4409 commit 0a692fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions Sources/wallpapper/ImageMetadataGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,18 @@ class ImageMetadataGenerator {

for (index, item) in self.pictureInfos.enumerated() {

if item.isForLight != nil || item.isForDark != nil {
if sequenceInfo.apperance == nil {
sequenceInfo.apperance = Apperance()
}
}

if item.isForLight ?? false {
sequenceInfo.apperance.lightIndex = index
sequenceInfo.apperance?.lightIndex = index
}

if item.isForDark ?? false {
sequenceInfo.apperance.darkIndex = index
sequenceInfo.apperance?.darkIndex = index
}

if let altitude = item.altitude, let azimuth = item.azimuth {
Expand Down
2 changes: 1 addition & 1 deletion Sources/wallpapper/PropertyList/SequenceInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ class SequenceInfo : Codable {

var sequenceItems: [SequenceItem]?
var timeItems: [TimeItem]?
var apperance = Apperance()
var apperance: Apperance?
}

0 comments on commit 0a692fc

Please sign in to comment.