mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-29 07:04:31 +02:00
Fixed metatdata
This commit is contained in:
parent
736af85855
commit
6c65c8a33e
9 changed files with 51 additions and 16 deletions
20
ios/App/Shared/util/Extensions.swift
Normal file
20
ios/App/Shared/util/Extensions.swift
Normal file
|
@ -0,0 +1,20 @@
|
|||
//
|
||||
// Extensions.swift
|
||||
// App
|
||||
//
|
||||
// Created by Rasmus Krämer on 14.04.22.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension String: Error {}
|
||||
|
||||
extension Encodable {
|
||||
func asDictionary() throws -> [String: Any] {
|
||||
let data = try JSONEncoder().encode(self)
|
||||
guard let dictionary = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [String: Any] else {
|
||||
throw NSError()
|
||||
}
|
||||
return dictionary
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue