mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-10-05 01:12:06 +00:00
refactor(x-media): drop Media's write-only title field
Every adapter set title (mostly None) on all three Media variants and nothing ever read it: the bot's CachedMedia carries kind/file_id/url, and the one read was misskey's own test. Removing it also drops misskey's DriveFile.name, which existed only to feed it. Fetched::title (the post's own headline, which captions do use) is untouched.
This commit is contained in:
@@ -236,7 +236,6 @@ impl Tweet {
|
||||
for item in json.media_details {
|
||||
match item.media_type.as_str() {
|
||||
"photo" => media.push(Media::Illustration {
|
||||
title: None,
|
||||
url: original_twimg_url(&item.media_url_https),
|
||||
thumbnail_url: None,
|
||||
// The param-less base URL is a reduced-size variant;
|
||||
@@ -244,12 +243,10 @@ impl Tweet {
|
||||
fallback_url: Some(item.media_url_https.clone()),
|
||||
}),
|
||||
"video" => media.push(Media::Video {
|
||||
title: None,
|
||||
url: mp4_variant(&item),
|
||||
thumbnail_url: item.media_url_https,
|
||||
}),
|
||||
"animated_gif" => media.push(Media::Animated {
|
||||
title: None,
|
||||
url: mp4_variant(&item),
|
||||
thumbnail_url: item.media_url_https,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user