mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-29 00:12:12 +00:00
refactor(x-media): read Fetched::site_id instead of the site_name alias
site_name() only returned the public site_id field; the five callers (the /debug report, the caption-format lookup on both fetch paths, the per-site override in urls.rs) read the field now.
This commit is contained in:
@@ -627,7 +627,7 @@ pub(crate) async fn execute_command(
|
||||
.get(message.chat.id.0)
|
||||
.await
|
||||
.message_format
|
||||
.get(fetched.site_name())
|
||||
.get(fetched.site_id)
|
||||
.cloned()
|
||||
.unwrap_or_default();
|
||||
let caption = preview_caption(
|
||||
@@ -639,7 +639,7 @@ pub(crate) async fn execute_command(
|
||||
);
|
||||
let report = debug_report(
|
||||
url,
|
||||
fetched.site_name(),
|
||||
fetched.site_id,
|
||||
&fetched.source_url,
|
||||
&fetched.title,
|
||||
&fetched.content,
|
||||
|
||||
@@ -715,7 +715,7 @@ async fn url_media_inner(
|
||||
// Per-site caption format override (empty -> built-in caption).
|
||||
let format = chat_data
|
||||
.message_format
|
||||
.get(fetched.site_name())
|
||||
.get(fetched.site_id)
|
||||
.cloned()
|
||||
.unwrap_or_default();
|
||||
let caption = fetched.caption_with(&format);
|
||||
@@ -864,7 +864,7 @@ async fn refetch(
|
||||
let chat_data = ctx.chat_store.get(chat_id).await;
|
||||
let format = chat_data
|
||||
.message_format
|
||||
.get(fetched.site_name())
|
||||
.get(fetched.site_id)
|
||||
.cloned()
|
||||
.unwrap_or_default();
|
||||
let caption = fetched.caption_with(&format);
|
||||
|
||||
Reference in New Issue
Block a user