mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-10-05 01:12:06 +00:00
refactor(send): media_from reads the thumbnail off the item itself
All three callers passed item.thumbnail_url() as the fourth argument — a parameter that could never vary without defeating its own purpose, and only the video arm ever reads it. The function takes the item already; it asks the item. Three call sites lose an argument.
This commit is contained in:
@@ -189,7 +189,7 @@ fn media_from_file(
|
||||
path: std::path::PathBuf,
|
||||
caption: Option<&str>,
|
||||
) -> Result<InputMedia, String> {
|
||||
media_from(item, InputFile::file(path), caption, item.thumbnail_url())
|
||||
media_from(item, InputFile::file(path), caption)
|
||||
}
|
||||
|
||||
/// Builds the media group item from a (smaller) URL.
|
||||
@@ -198,7 +198,7 @@ fn media_from_url(
|
||||
url: &str,
|
||||
caption: Option<&str>,
|
||||
) -> Result<InputMedia, String> {
|
||||
media_from(item, input_file_for(url)?, caption, item.thumbnail_url())
|
||||
media_from(item, input_file_for(url)?, caption)
|
||||
}
|
||||
|
||||
/// One item prepared for the upload fallback: the ready-to-send media plus
|
||||
|
||||
Reference in New Issue
Block a user