Implement snapshot version history
This commit is contained in:
@@ -324,6 +324,25 @@ public extension SongProject {
|
||||
vocalists[index].assignedSections.removeAll { $0 == sectionID }
|
||||
}
|
||||
|
||||
mutating func createVersion(
|
||||
id: String = UUID().uuidString,
|
||||
label: String,
|
||||
createdAt: Date = Date()
|
||||
) -> SongVersion {
|
||||
let version = SongVersion(
|
||||
id: id,
|
||||
label: label,
|
||||
snapshot: SongProjectSnapshot(project: self),
|
||||
createdAt: createdAt
|
||||
)
|
||||
versions.append(version)
|
||||
return version
|
||||
}
|
||||
|
||||
func version(id versionID: String) -> SongVersion? {
|
||||
versions.first { $0.id == versionID }
|
||||
}
|
||||
|
||||
mutating func appendSection(_ section: SongSection) {
|
||||
var orderedSection = section
|
||||
orderedSection.order = nextSectionOrder
|
||||
|
||||
Reference in New Issue
Block a user