mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Playlist added in the new media player panel.
This commit is contained in:
@@ -151,6 +151,22 @@ QString documentName(DocumentData *document) {
|
||||
return song->performer + QString::fromUtf8(" \xe2\x80\x93 ") + (song->title.isEmpty() ? qsl("Unknown Track") : song->title);
|
||||
}
|
||||
|
||||
TextWithEntities documentNameWithEntities(DocumentData *document) {
|
||||
TextWithEntities result;
|
||||
auto song = document->song();
|
||||
if (!song || (song->title.isEmpty() && song->performer.isEmpty())) {
|
||||
result.text = document->name.isEmpty() ? qsl("Unknown File") : document->name;
|
||||
result.entities.push_back({ EntityInTextBold, 0, result.text.size() });
|
||||
} else if (song->performer.isEmpty()) {
|
||||
result.text = song->title;
|
||||
result.entities.push_back({ EntityInTextBold, 0, result.text.size() });
|
||||
} else {
|
||||
result.text = song->performer + QString::fromUtf8(" \xe2\x80\x93 ") + (song->title.isEmpty() ? qsl("Unknown Track") : song->title);
|
||||
result.entities.push_back({ EntityInTextBold, 0, song->performer.size() });
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int32 documentColorIndex(DocumentData *document, QString &ext) {
|
||||
int32 colorIndex = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user