summaryrefslogtreecommitdiff
path: root/Jel/Models/JellyfinKitExtensions.swift
diff options
context:
space:
mode:
authorShav Kinderlehrer <[email protected]>2023-12-24 20:01:52 -0500
committerShav Kinderlehrer <[email protected]>2023-12-24 20:01:52 -0500
commit69bed7745833add72cfe1b1516a61f62460b1765 (patch)
tree373d6a63cfa3d79b5fce59091822bfe7748bcab9 /Jel/Models/JellyfinKitExtensions.swift
parent9da269a6ab44869e41a8b005836c3479424ae538 (diff)
downloadjel-69bed7745833add72cfe1b1516a61f62460b1765.tar.gz
jel-69bed7745833add72cfe1b1516a61f62460b1765.zip
Implement movieDetailView
Diffstat (limited to 'Jel/Models/JellyfinKitExtensions.swift')
-rw-r--r--Jel/Models/JellyfinKitExtensions.swift28
1 files changed, 28 insertions, 0 deletions
diff --git a/Jel/Models/JellyfinKitExtensions.swift b/Jel/Models/JellyfinKitExtensions.swift
new file mode 100644
index 0000000..197731c
--- /dev/null
+++ b/Jel/Models/JellyfinKitExtensions.swift
@@ -0,0 +1,28 @@
+//
+// JellyfinKitExtensions.swift
+// Jel
+//
+// Created by zerocool on 12/24/23.
+//
+
+import Foundation
+import JellyfinKit
+
+extension BaseItemDto {
+ func getRuntime() -> String? {
+ let formatter: DateComponentsFormatter = {
+ let localFormatter = DateComponentsFormatter()
+ localFormatter.unitsStyle = .brief
+ localFormatter.allowedUnits = [.hour, .minute]
+
+ return localFormatter
+ }()
+
+ if let runTimeTicks = self.runTimeTicks {
+ let text = formatter.string(from: Double(runTimeTicks / 10_000_000))
+ return text
+ }
+
+ return nil
+ }
+}