Add:iOS support offline episode chapters #675

This commit is contained in:
advplyr
2023-06-18 15:34:56 -05:00
parent 1da03cdd65
commit ae37861f7d
5 changed files with 16 additions and 1 deletions
+6
View File
@@ -50,6 +50,12 @@ extension KeyedDecodingContainer {
return Int(stringValue) ?? 0
}
}
// This will be called when any @Persisted List<> is decoded
func decode<T: Decodable>(_ type: Persisted<List<T>>.Type, forKey key: Key) throws -> Persisted<List<T>> {
// Use decode if present, falling back to an empty list
try decodeIfPresent(type, forKey: key) ?? Persisted<List<T>>(wrappedValue: List<T>())
}
}
extension CAPPluginCall {