mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-11 17:38:38 +00:00
cleanup extra code
This commit is contained in:
parent
753cfd8a31
commit
1584cf979c
@ -62,13 +62,6 @@ class SupportedTypesHolder {
|
|||||||
let item = ItemType.appleScriptTitledButton(source: try! String(contentsOf: scriptURL), refreshInterval: interval ?? 1800.0)
|
let item = ItemType.appleScriptTitledButton(source: try! String(contentsOf: scriptURL), refreshInterval: interval ?? 1800.0)
|
||||||
return (item: item, action: .none)
|
return (item: item, action: .none)
|
||||||
},
|
},
|
||||||
"time": { decoder in
|
|
||||||
enum CodingKeys: String, CodingKey { case formatTemplate }
|
|
||||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
|
||||||
let template = try container.decodeIfPresent(String.self, forKey: .formatTemplate)
|
|
||||||
let item = ItemType.timeButton(formatTemplate: template ?? "HH:mm" )
|
|
||||||
return (item: item, action: .none)
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
static let sharedInstance = SupportedTypesHolder()
|
static let sharedInstance = SupportedTypesHolder()
|
||||||
@ -121,7 +114,7 @@ enum ItemType: Decodable {
|
|||||||
let title = try container.decode(String.self, forKey: .title)
|
let title = try container.decode(String.self, forKey: .title)
|
||||||
self = .staticButton(title: title)
|
self = .staticButton(title: title)
|
||||||
case .timeButton:
|
case .timeButton:
|
||||||
let template = try container.decode(String.self, forKey: .formatTemplate)
|
let template = try container.decodeIfPresent(String.self, forKey: .formatTemplate) ?? "HH:mm"
|
||||||
self = .timeButton(formatTemplate: template)
|
self = .timeButton(formatTemplate: template)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,6 @@
|
|||||||
{ "type": "previous" },
|
{ "type": "previous" },
|
||||||
{ "type": "play" },
|
{ "type": "play" },
|
||||||
{ "type": "next" },
|
{ "type": "next" },
|
||||||
{ "type": "volumeUp" },
|
{ "type": "weather", "refreshInterval": 1800 },
|
||||||
{ "type": "volumeUp" },
|
{ "type": "timeButton" },
|
||||||
{ "type": "weather", "refreshInterval": 1800 }
|
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user