Skip to content

Commit

Permalink
sailfish: display backdrop instead of poster on film page
Browse files Browse the repository at this point in the history
This simply looks better, since the backdrop has a more suitable aspect
ratio.
  • Loading branch information
HenkKalkwater committed Jan 2, 2024
1 parent a35d802 commit 5e62fe7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion sailfish/qml/pages/itemdetails/FilmPage.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Sailfin: a Jellyfin client written using Qt
Copyright (C) 2020 Chris Josten
Copyright (C) 2020-2024 Chris Josten
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -27,6 +27,8 @@ import "../.."

VideoPage {
subtitle: qsTr("Released: %1 — Run time: %2").arg(itemData.productionYear).arg(Utils.ticksToText(itemData.runTimeTicks))
imageSource: Utils.itemBackdropUrl(apiClient.baseUrl, itemData, 0, {"maxWidth": parent.width})
imageBlurhash: itemData.imageBlurHashes["Backdrop"][itemData.backdropImageTags[0]]

SectionHeader {
text: qsTr("Overview")
Expand Down
11 changes: 8 additions & 3 deletions sailfish/qml/pages/itemdetails/VideoPage.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Sailfin: a Jellyfin client written using Qt
Copyright (C) 2020 Chris Josten
Copyright (C) 2020-2024 Chris Josten
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -30,10 +30,15 @@ import "../.."
* the FilmPage or EpisodePage.
*/
BaseDetailPage {
id: detailPage
property alias subtitle: pageHeader.description
default property alias _data: content.data
property real _playbackProsition: itemData.userData.playbackPositionTicks
readonly property bool _userdataReady: itemLoader.status === J.ItemLoader.Ready && itemData.userData !== null

property string imageSource: Utils.itemImageUrl(apiClient.baseUrl, itemData, "Primary", {"maxWidth": parent.width})
property string imageBlurhash: itemData.imageBlurHashes["Primary"][itemData.imageTags["Primary"]]

SilicaFlickable {
anchors.fill: parent
contentHeight: content.height + Theme.paddingLarge
Expand All @@ -55,9 +60,9 @@ BaseDetailPage {
PlayToolbar {
id: toolbar
width: parent.width
imageSource: Utils.itemImageUrl(apiClient.baseUrl, itemData, "Primary", {"maxWidth": parent.width})
imageSource: detailPage.imageSource
imageAspectRatio: Constants.horizontalVideoAspectRatio
imageBlurhash: itemData.imageBlurHashes["Primary"][itemData.imageTags["Primary"]]
imageBlurhash: detailPage.imageBlurhash
Binding on favourited {
when: _userdataReady
value: itemData.userData.favorite
Expand Down

0 comments on commit 5e62fe7

Please sign in to comment.