35 lines
747 B
Swift
35 lines
747 B
Swift
import Foundation
|
|
import SwiftData
|
|
|
|
@Model
|
|
public class StoredBook {
|
|
public var bookID: UUID
|
|
public var title: String
|
|
public var author: String?
|
|
public var sourceFileName: String
|
|
public var dateAdded: Date
|
|
public var lastPosition: Int
|
|
public var lastRead: Date?
|
|
public var voiceName: String?
|
|
|
|
public init(
|
|
bookID: UUID = UUID(),
|
|
title: String,
|
|
author: String? = nil,
|
|
sourceFileName: String,
|
|
dateAdded: Date = .now,
|
|
lastPosition: Int = 0,
|
|
lastRead: Date? = nil,
|
|
voiceName: String? = nil
|
|
) {
|
|
self.bookID = bookID
|
|
self.title = title
|
|
self.author = author
|
|
self.sourceFileName = sourceFileName
|
|
self.dateAdded = dateAdded
|
|
self.lastPosition = lastPosition
|
|
self.lastRead = lastRead
|
|
self.voiceName = voiceName
|
|
}
|
|
}
|