2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Added ability to fetch song cover from external resource.

This commit is contained in:
23rd
2021-01-11 16:58:25 +03:00
committed by John Preston
parent 3fadf2ee54
commit ad761011d6
4 changed files with 177 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/view/media/history_view_gif.h"
#include "window/window_session_controller.h"
#include "storage/cache/storage_cache_database.h"
#include "storage/storage_cloud_song_cover.h"
#include "boxes/confirm_box.h"
#include "ui/image/image.h"
#include "ui/text/text_utilities.h"
@@ -540,6 +541,13 @@ void DocumentData::setattributes(
songData->duration = data.vduration().v;
songData->title = qs(data.vtitle().value_or_empty());
songData->performer = qs(data.vperformer().value_or_empty());
if (!hasThumbnail()
&& !songData->title.isEmpty()
&& !songData->performer.isEmpty()) {
Storage::CloudSongCover::LoadThumbnailFromExternal(this);
}
}
}, [&](const MTPDdocumentAttributeFilename &data) {
_filename = qs(data.vfile_name());