Add fallback blur hash (causes crashes if blank)

This commit is contained in:
Aiden Vigue 2021-07-31 12:59:41 -04:00
parent 5fbe2a4a3d
commit 25e271fe88
No known key found for this signature in database
GPG Key ID: B9A09843AB079D5B
2 changed files with 3 additions and 1 deletions

View File

@ -112,6 +112,8 @@ class DeviceProfileBuilder {
subtitleProfiles.append(SubtitleProfile(format: "subrip", method: .embed)) subtitleProfiles.append(SubtitleProfile(format: "subrip", method: .embed))
subtitleProfiles.append(SubtitleProfile(format: "sub", method: .embed)) subtitleProfiles.append(SubtitleProfile(format: "sub", method: .embed))
subtitleProfiles.append(SubtitleProfile(format: "pgssub", method: .embed)) subtitleProfiles.append(SubtitleProfile(format: "pgssub", method: .embed))
//These need to be filtered. Most subrips are embedded. I hate subtitles.
subtitleProfiles.append(SubtitleProfile(format: "subrip", method: .external)) subtitleProfiles.append(SubtitleProfile(format: "subrip", method: .external))
subtitleProfiles.append(SubtitleProfile(format: "sub", method: .external)) subtitleProfiles.append(SubtitleProfile(format: "sub", method: .external))
subtitleProfiles.append(SubtitleProfile(format: "ass", method: .external)) subtitleProfiles.append(SubtitleProfile(format: "ass", method: .external))

View File

@ -26,7 +26,7 @@ struct ImageView: View {
var body: some View { var body: some View {
LazyImage(source: source) LazyImage(source: source)
.placeholder { .placeholder {
Image(uiImage: UIImage(blurHash: blurhash, size: CGSize(width: 8, height: 8))!) Image(uiImage: UIImage(blurHash: blurhash, size: CGSize(width: 8, height: 8)) ?? UIImage(blurHash: "001fC^", size: CGSize(width:8,height:8))!)
.resizable() .resizable()
} }
.failure { .failure {