Functions to update local progress

This commit is contained in:
ronaldheft
2022-08-11 20:38:51 -04:00
parent c32c77b963
commit f4e39ec7ca
4 changed files with 39 additions and 0 deletions
@@ -29,4 +29,11 @@ struct PlaybackSession: Decodable, Encodable {
var localLibraryItem: LocalLibraryItem?
var serverConnectionConfigId: String?
var serverAddress: String?
var totalDuration: Double {
var total = 0.0
self.audioTracks.forEach { total += $0.duration }
return total
}
var progress: Double { self.currentTime / self.totalDuration }
}