diff options
author | Shav Kinderlehrer <[email protected]> | 2023-12-23 00:53:44 -0500 |
---|---|---|
committer | Shav Kinderlehrer <[email protected]> | 2023-12-23 00:53:44 -0500 |
commit | 885615d1dd029138700c36bb8b23d211cf713811 (patch) | |
tree | d358d87926a8b5b73db87e9b87f3c46dfb35a435 /Jel/Views/Dashboard/Library | |
parent | 73c40b5aa0142ed89082214f790df539174e4dac (diff) | |
download | jel-885615d1dd029138700c36bb8b23d211cf713811.tar.gz jel-885615d1dd029138700c36bb8b23d211cf713811.zip |
Refactor LibraryIconView
Diffstat (limited to 'Jel/Views/Dashboard/Library')
-rw-r--r-- | Jel/Views/Dashboard/Library/LibraryIconView.swift | 38 | ||||
-rw-r--r-- | Jel/Views/Dashboard/Library/LibraryView.swift | 44 |
2 files changed, 0 insertions, 82 deletions
diff --git a/Jel/Views/Dashboard/Library/LibraryIconView.swift b/Jel/Views/Dashboard/Library/LibraryIconView.swift deleted file mode 100644 index 0131ff7..0000000 --- a/Jel/Views/Dashboard/Library/LibraryIconView.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// LibraryIconView.swift -// Jel -// -// Created by zerocool on 12/15/23. -// - -import SwiftUI -import JellyfinKit -import BlurHashKit - -struct LibraryIconView: View { - @EnvironmentObject var jellyfinClient: JellyfinClientController - - @State var library: BaseItemDto - @State var loadingImage: Bool = true - - @State var loadedImageBinaryData: Data? - - var body: some View { - VStack { - AsyncImageView(imageId: library.id ?? "", - blurhash: library.imageBlurHashes?.primary?[library.imageTags?["Primary"] ?? ""] ?? "", - imageType: "Primary") - .aspectRatio(contentMode: .fill) - .frame(width: 255, height: 150) - .clipShape(RoundedRectangle(cornerRadius: 5)) - - - Text(library.name ?? "Unknown") - .font(.subheadline) - } - } -} - -//#Preview { -// LibraryIconView(library: BaseItemDto()) -//} diff --git a/Jel/Views/Dashboard/Library/LibraryView.swift b/Jel/Views/Dashboard/Library/LibraryView.swift deleted file mode 100644 index 63bfd64..0000000 --- a/Jel/Views/Dashboard/Library/LibraryView.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// LibraryView.swift -// Jel -// -// Created by zerocool on 12/15/23. -// - -import SwiftUI -import JellyfinKit - -struct LibraryView: View { - @EnvironmentObject var jellyfinClient: JellyfinClientController - - @StateObject var authState: AuthStateController = AuthStateController.shared - - @State var libraries: [BaseItemDto] = [] - var body: some View { - ScrollView(.horizontal, showsIndicators: false) { - HStack { - ForEach(libraries) {library in - if library.collectionType == "movies" || library.collectionType == "tvshows" { - LibraryIconView(library: library) - } - } - } - } - .onAppear { - Task { - do { - let request = Paths.getUserViews(userID: authState.userId ?? "") - if let results = try await jellyfinClient.send(request).value.items { - libraries = results - } - } catch { - print(error) - } - } - } - } -} - -//#Preview { -// LibraryView() -//} |