summaryrefslogtreecommitdiff
path: root/Jel/Views
diff options
context:
space:
mode:
Diffstat (limited to 'Jel/Views')
-rw-r--r--Jel/Views/Dashboard/Library/LibraryIconView.swift10
-rw-r--r--Jel/Views/Dashboard/Library/LibraryView.swift2
-rw-r--r--Jel/Views/Utility/AsyncImageView.swift7
3 files changed, 13 insertions, 6 deletions
diff --git a/Jel/Views/Dashboard/Library/LibraryIconView.swift b/Jel/Views/Dashboard/Library/LibraryIconView.swift
index c4dbde0..0131ff7 100644
--- a/Jel/Views/Dashboard/Library/LibraryIconView.swift
+++ b/Jel/Views/Dashboard/Library/LibraryIconView.swift
@@ -22,6 +22,10 @@ struct LibraryIconView: View {
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)
@@ -29,6 +33,6 @@ struct LibraryIconView: View {
}
}
-#Preview {
- LibraryIconView(library: BaseItemDto())
-}
+//#Preview {
+// LibraryIconView(library: BaseItemDto())
+//}
diff --git a/Jel/Views/Dashboard/Library/LibraryView.swift b/Jel/Views/Dashboard/Library/LibraryView.swift
index 39ca6ba..63bfd64 100644
--- a/Jel/Views/Dashboard/Library/LibraryView.swift
+++ b/Jel/Views/Dashboard/Library/LibraryView.swift
@@ -16,7 +16,7 @@ struct LibraryView: View {
@State var libraries: [BaseItemDto] = []
var body: some View {
ScrollView(.horizontal, showsIndicators: false) {
- LazyHStack {
+ HStack {
ForEach(libraries) {library in
if library.collectionType == "movies" || library.collectionType == "tvshows" {
LibraryIconView(library: library)
diff --git a/Jel/Views/Utility/AsyncImageView.swift b/Jel/Views/Utility/AsyncImageView.swift
index bed5687..5b9f99c 100644
--- a/Jel/Views/Utility/AsyncImageView.swift
+++ b/Jel/Views/Utility/AsyncImageView.swift
@@ -6,7 +6,6 @@
//
import SwiftUI
-import BlurHashKit
import JellyfinKit
struct AsyncImageView: View {
@@ -22,12 +21,16 @@ struct AsyncImageView: View {
var body: some View {
VStack {
if loading {
- BlurHashView(blurHash: blurhash)
+ Image(uiImage: uiImage)
+ .resizable()
} else {
Image(uiImage: uiImage)
+ .resizable()
}
}
.onAppear {
+ uiImage = UIImage(blurHash: blurhash, size: CGSize(width: 16, height: 16)) ?? UIImage()
+
Task {
let request = Paths.getItemImage(itemID: imageId, imageType: imageType)
do {