Closed hlf20010508 closed 3 months ago
Ok, I've completely migrated download methods in PhotoSize
to download_media
and iter_download
.
The usage is the same as other media
let downloadable = Downloadable::PhotoSize(photo_size);
let mut download = client.iter_download(&downloadable);
I also implemented download for PhotoSize::Progressive
. It's actually the same as PhotoSize::Size
. Now users can use largest()
to get the largest thumb(for photos it's usually progressive) and download it.
And there was a bug in the download()
of PathSize
, that the param path
was shadowed by the variable mut path
. But it's not needed anymore.
The new function DownloadIter::new_from_photo_size
is ugly, since request
is not needed, I have to fake a useless one. If you think it's ok to make request
to Option<tl::functions::upload::GetFile>
, I'll do that.
From a quick look, as long as it gets the job done, then it's fine.
size()
forMedia::Photo
to get the real size of the photo.thumbs()
forMedia::Document
.VecExt
.