Prefer media embed except for imgur.com
This commit is contained in:
parent
11bdc23bdf
commit
00cb83559c
|
@ -69,6 +69,10 @@ struct RedditLinkData: Codable {
|
|||
func renderURLAsHTML() -> String? {
|
||||
guard let url = url else { return nil }
|
||||
|
||||
if !url.hasPrefix("https://imgur.com"), let mediaEmbedContent = mediaEmbed?.content {
|
||||
return mediaEmbedContent
|
||||
}
|
||||
|
||||
if isVideo ?? false {
|
||||
guard let fallbackURL = media?.video?.fallbackURL else {
|
||||
return nil
|
||||
|
@ -93,10 +97,6 @@ struct RedditLinkData: Codable {
|
|||
return html
|
||||
}
|
||||
|
||||
if let mediaEmbedContent = mediaEmbed?.content {
|
||||
return mediaEmbedContent
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue