mirror of
https://github.com/LemmyNet/lemmy
synced 2024-11-23 13:03:11 +00:00
Removing 2nd match.
This commit is contained in:
parent
2719daffb0
commit
f7c947888f
1 changed files with 37 additions and 38 deletions
|
@ -197,16 +197,16 @@ fn fetch_iframely_and_pictshare_data(
|
||||||
Option<String>,
|
Option<String>,
|
||||||
Option<String>,
|
Option<String>,
|
||||||
) {
|
) {
|
||||||
|
match &url {
|
||||||
|
Some(url) => {
|
||||||
// Fetch iframely data
|
// Fetch iframely data
|
||||||
let (iframely_title, iframely_description, iframely_thumbnail_url, iframely_html) = match &url {
|
let (iframely_title, iframely_description, iframely_thumbnail_url, iframely_html) =
|
||||||
Some(url) => match fetch_iframely(url) {
|
match fetch_iframely(url) {
|
||||||
Ok(res) => (res.title, res.description, res.thumbnail_url, res.html),
|
Ok(res) => (res.title, res.description, res.thumbnail_url, res.html),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("iframely err: {}", e);
|
error!("iframely err: {}", e);
|
||||||
(None, None, None, None)
|
(None, None, None, None)
|
||||||
}
|
}
|
||||||
},
|
|
||||||
None => (None, None, None, None),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fetch pictshare thumbnail
|
// Fetch pictshare thumbnail
|
||||||
|
@ -218,18 +218,14 @@ fn fetch_iframely_and_pictshare_data(
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
None => match url {
|
|
||||||
Some(url) => match fetch_pictshare(&url) {
|
|
||||||
// Try to generate a small thumbnail if iframely is not supported
|
// Try to generate a small thumbnail if iframely is not supported
|
||||||
|
None => match fetch_pictshare(&url) {
|
||||||
Ok(res) => Some(res.url),
|
Ok(res) => Some(res.url),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("pictshare err: {}", e);
|
error!("pictshare err: {}", e);
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None => None,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
(
|
(
|
||||||
|
@ -238,6 +234,9 @@ fn fetch_iframely_and_pictshare_data(
|
||||||
iframely_html,
|
iframely_html,
|
||||||
pictshare_thumbnail,
|
pictshare_thumbnail,
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
None => (None, None, None, None),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn markdown_to_html(text: &str) -> String {
|
pub fn markdown_to_html(text: &str) -> String {
|
||||||
|
|
Loading…
Reference in a new issue