Discard recording if time criteria not met

This commit is contained in:
relikd
2020-08-31 12:18:36 +02:00
parent 7b7c5f3d9a
commit ff4218981f
10 changed files with 106 additions and 58 deletions

View File

@@ -36,8 +36,8 @@ extension Recording {
var fallbackTitle: String { get {
isLongTerm ? "Background Recording" : "Unnamed Recording #\(id)"
} }
var duration: Timestamp? { get { stop == nil ? nil : stop! - start } }
var isLongTerm: Bool { (duration ?? 0) > Timestamp.hours(1) }
var duration: Timestamp { get { stop ?? .now() - start } }
var isLongTerm: Bool { duration > Timestamp.hours(1) }
var isShared: Bool { uploadkey?.count ?? 0 > 0}
}