Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions depecher/qml/pages/items/delegates/VideoDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ Column{
asynchronous: true
property int maxWidth: JsUtils.getWidth() - Theme.itemSizeExtraSmall - Theme.paddingMedium - 2*Theme.horizontalPageMargin
property int maxHeight: JsUtils.getHeight()/2
width: photo_aspect >= 1 ? maxWidth : maxHeight * photo_aspect
height: photo_aspect >= 1 ? maxWidth/photo_aspect : maxHeight
width: media_preview ? (photo_aspect >= 1 ? maxWidth : maxHeight * photo_aspect) : Theme.itemSizeExtraLarge
height: media_preview ? (photo_aspect >= 1 ? maxWidth/photo_aspect : maxHeight) : Theme.itemSizeExtraLarge
fillMode: Image.PreserveAspectFit
source: "image://depecherDb/" + media_preview
source: media_preview ? ("image://depecherDb/" + media_preview) : ""

MouseArea{
anchors.fill: parent
Expand Down
8 changes: 4 additions & 4 deletions depecher/rpm/depecher.spec
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ rm -rf %{buildroot}
# << install pre
%qmake5_install

desktop-file-install --delete-original \
--dir %{buildroot}%{_datadir}/applications \
%{buildroot}%{_datadir}/applications/*.desktop

# >> install post
%post
systemctl-user stop org.blacksailer.depecher.service || true
Expand All @@ -86,10 +90,6 @@ systemctl-user daemon-reload

# << install post

desktop-file-install --delete-original \
--dir %{buildroot}%{_datadir}/applications \
%{buildroot}%{_datadir}/applications/*.desktop

%preun
# >> preun
systemctl-user stop org.blacksailer.depecher.service || true
Expand Down
9 changes: 7 additions & 2 deletions tdlibjson_wrapper/tdlibQt/models/MessagingModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,11 @@ QVariant MessagingModel::data(const QModelIndex &index, int role) const
if (m_messages[rowIndex]->content_->get_id() == messageVideo::ID) {
auto contentVideoPtr = static_cast<messageVideo *>
(m_messages[rowIndex]->content_.data());
return (float)contentVideoPtr->video_->thumbnail_->width_ / (float)
contentVideoPtr->video_->thumbnail_->height_;
auto thumbnail = contentVideoPtr->video_->thumbnail_;
if (thumbnail)
return (float)thumbnail->width_ / (float)thumbnail->height_;
else
return 0.1;
}
if (m_messages[rowIndex]->content_->get_id() == messageAnimation::ID) {
auto contentAnimationPtr = static_cast<messageAnimation *>
Expand Down Expand Up @@ -479,6 +482,8 @@ QVariant MessagingModel::data(const QModelIndex &index, int role) const
}
if (m_messages[rowIndex]->content_->get_id() == messageVideo::ID) {
auto contentVideoPtr = static_cast<messageVideo *>(m_messages[rowIndex]->content_.data());
if (!contentVideoPtr->video_->thumbnail_)
return QVariant();
if (contentVideoPtr->video_->thumbnail_->photo_->local_->is_downloading_completed_)
return QString::fromStdString(contentVideoPtr->video_->thumbnail_->photo_->local_->path_);
else {
Expand Down