mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-10-06 01:22:16 +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:
@@ -73,7 +73,6 @@ pub async fn fetch_from_url(url: &str) -> Result<Fetched, FetchError> {
|
||||
_ => String::new(),
|
||||
};
|
||||
media.push(Media::Video {
|
||||
title: None,
|
||||
url: mp4_path.to_string_lossy().into_owned(),
|
||||
thumbnail_url,
|
||||
});
|
||||
@@ -354,7 +353,6 @@ impl Post {
|
||||
match embed {
|
||||
model::Media::Images { images } => {
|
||||
media.extend(images.into_iter().map(|image| Media::Illustration {
|
||||
title: None,
|
||||
url: image.fullsize,
|
||||
thumbnail_url: Some(image.thumb),
|
||||
fallback_url: None,
|
||||
@@ -365,7 +363,6 @@ impl Post {
|
||||
thumbnail,
|
||||
} => {
|
||||
media.push(Media::Video {
|
||||
title: None,
|
||||
url: playlist,
|
||||
thumbnail_url: thumbnail,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user