1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-05 10:12:46 +00:00

Implemented series and final for touches alpha release

This commit is contained in:
Chris Josten 2020-09-26 02:51:37 +02:00
parent 020c968f9c
commit 14a99c3342
30 changed files with 1213 additions and 114 deletions

View file

@ -1,6 +1,8 @@
import QtQuick 2.6
import Sailfish.Silica 1.0
import ".."
/**
* Delegate for displaying an item in the library.
*/
@ -9,11 +11,12 @@ BackgroundItem {
property alias poster: posterImage.source
property alias title: titleText.text
property bool landscape: false
width: Screen.width / 3
height: landscape ? width / 4 * 3 : width / 2 * 3
width: Constants.libraryDelegateWidth
height: landscape ? Constants.libraryDelegateHeight : Constants.libraryDelegatePosterHeight
RemoteImage {
id: posterImage
clip: true
anchors {
left: parent.left
top: parent.top
@ -23,11 +26,11 @@ BackgroundItem {
fillMode: Image.PreserveAspectCrop
}
Rectangle {
/*Rectangle {
anchors.fill: posterImage
color: Theme.rgba(Theme.highlightBackgroundColor, Theme.highlightBackgroundOpacity)
visible: root.highlighted
}
}*/
Rectangle {
anchors {

View file

@ -10,17 +10,34 @@ Item {
property alias text: label.text
property alias textAlignment: label.horizontalAlignment
property bool busy: false
property bool clickable: true
property int depth: 0
readonly property color _color: enabled ? highlighted ? Theme.highlightColor : Theme.primaryColor : Theme.secondaryColor
readonly property color _color: {
if (!clickable) {
Theme.primaryColor
} else if (enabled) {
if (highlighted) {
Theme.highlightColor
} else {
Theme.primaryColor
}
} else {
Theme.secondaryColor
}
}
default property alias content: container.data
signal headerClicked()
implicitHeight: backgroundItem.height + container.height
width: parent.width
BackgroundItem {
id: backgroundItem
enabled: parent.enabled && parent.clickable
width: parent.width
height: Theme.itemSizeMedium
onClicked: root.headerClicked()
Rectangle {
anchors.fill: parent
@ -51,7 +68,7 @@ Item {
verticalCenter: parent.verticalCenter
rightMargin: Theme.horizontalPageMargin
}
visible: root.enabled && !root.busy
visible: root.enabled && root.clickable && !root.busy
source: "image://theme/icon-m-right?" + _color
}

View file

@ -4,7 +4,7 @@ import Sailfish.Silica 1.0
/**
* An image for "remote" images (loaded over e.g. http), with a spinner and a fallback image
*/
Image {
HighlightImage {
property string fallbackImage
property bool usingFallbackImage
@ -23,7 +23,7 @@ Image {
visible: parent.status == Image.Error || parent.status == Image.Null
}
Image {
HighlightImage {
id: fallbackImageItem
anchors.centerIn: parent
visible: parent.status == Image.Error || parent.status == Image.Null

View file

@ -1,5 +1,35 @@
import QtQuick 2.0
import QtQuick 2.6
import Sailfish.Silica 1.0
import nl.netsoj.chris.Jellyfin 1.0
Item {
import ".."
import "../../Utils.js" as Utils
Column {
property var itemData
spacing: Theme.paddingMedium
PlayToolbar {
onPlayPressed: pageStack.push(Qt.resolvedUrl("../../pages/VideoPage.qml"),
{"itemId": itemId, "itemData": itemData, "audioTrack": trackSelector.audioTrack,
"subtitleTrack": trackSelector.subtitleTrack })
}
VideoTrackSelector {
id: trackSelector
width: parent.width
tracks: itemData.MediaStreams
}
PlainLabel {
id: tinyDetails
text: qsTr("Released: %1 — Run time: %2").arg(itemData.ProductionYear).arg(Utils.ticksToText(itemData.RunTimeTicks))
}
PlainLabel {
id: overviewText
text: itemData.Overview
font.pixelSize: Theme.fontSizeSmall
color: Theme.secondaryHighlightColor
}
}

View file

@ -20,10 +20,6 @@ Column {
tracks: itemData.MediaStreams
}
PlainLabel {
text: "sub: %1 dub: %2".arg(trackSelector.subtitleTrack).arg(trackSelector.audioTrack)
}
PlainLabel {
id: tinyDetails
text: qsTr("Released: %1 — Run time: %2").arg(itemData.ProductionYear).arg(Utils.ticksToText(itemData.RunTimeTicks))
@ -35,7 +31,4 @@ Column {
font.pixelSize: Theme.fontSizeSmall
color: Theme.secondaryHighlightColor
}
}

View file

@ -20,4 +20,5 @@ Row {
icon.source: "image://theme/icon-l-play"
onPressed: playPressed()
}
}

View file

@ -1,5 +1,80 @@
import QtQuick 2.0
import QtQuick 2.6
import Sailfish.Silica 1.0
import nl.netsoj.chris.Jellyfin 1.0
Item {
import "../../Utils.js" as Utils
import "../.."
import ".."
Column {
property var itemData
ShowEpisodesModel {
id: episodeModel
apiClient: ApiClient
show: itemData.SeriesId
seasonId: itemData.Id
fields: ["Overview"]
}
ColumnView {
model: episodeModel
itemHeight: Constants.libraryDelegateHeight
delegate: BackgroundItem {
height: Constants.libraryDelegateHeight
RemoteImage {
id: episodeImage
anchors {
top: parent.top
left: parent.left
leftMargin: Theme.horizontalPageMargin
bottom: parent.bottom
}
width: Constants.libraryDelegateWidth
height: Constants.libraryDelegateHeight
source: Utils.itemModelImageUrl(ApiClient.baseUrl, model.id, model.imageTags["Primary"], "Primary", {"maxHeight": height})
fillMode: Image.PreserveAspectCrop
clip: true
}
Label {
id: episodeTitle
anchors {
left: episodeImage.right
leftMargin: Theme.paddingLarge
top: parent.top
right: parent.right
rightMargin: Theme.horizontalPageMargin
}
text: model.name
truncationMode: TruncationMode.Fade
horizontalAlignment: Text.AlignLeft
}
Label {
id: episodeOverview
anchors {
left: episodeImage.right
leftMargin: Theme.paddingLarge
right: parent.right
rightMargin: Theme.horizontalPageMargin
top: episodeTitle.bottom
bottom: parent.bottom
}
color: highlighted ? Theme.secondaryHighlightColor: Theme.secondaryColor
font.pixelSize: Theme.fontSizeExtraSmall
//: No overview/summary text of an episode available
text: model.overview || qsTr("No overview available")
wrapMode: Text.WordWrap
elide: Text.ElideRight
}
onClicked: pageStack.push(Qt.resolvedUrl("../../pages/DetailPage.qml"), {"itemId": model.id})
}
}
onItemDataChanged: {
console.log(JSON.stringify(itemData))
episodeModel.show = itemData.SeriesId
episodeModel.seasonId = itemData.Id
episodeModel.reload()
}
}

View file

@ -1,5 +1,49 @@
import QtQuick 2.0
import QtQuick 2.6
import Sailfish.Silica 1.0
import nl.netsoj.chris.Jellyfin 1.0
Item {
import "../"
import "../../Utils.js" as Utils
Column {
property var itemData
PlainLabel {
id: overviewText
text: itemData.Overview
font.pixelSize: Theme.fontSizeSmall
color: Theme.secondaryHighlightColor
}
SectionHeader {
//: Seasons of a (TV) show
text: qsTr("Seasons")
}
ShowSeasonsModel {
id: showSeasonsModel
apiClient: ApiClient
show: itemData.Id
}
SilicaListView {
model: showSeasonsModel
clip: true
width: parent.width
height: Screen.width / 2
orientation: ListView.Horizontal
spacing: Theme.paddingLarge
leftMargin: Theme.horizontalPageMargin
rightMargin: Theme.horizontalPageMargin
delegate: LibraryItemDelegate {
poster: Utils.itemModelImageUrl(ApiClient.baseUrl, model.id, model.imageTags["Primary"], "Primary", {"maxHeight": height})
title: model.name
onClicked: pageStack.push(Qt.resolvedUrl("../../pages/DetailPage.qml"), {"itemId": model.id})
}
}
onItemDataChanged: {
showSeasonsModel.show = itemData.Id
showSeasonsModel.reload()
}
}

View file

@ -2,7 +2,9 @@ import QtQuick 2.6
import Sailfish.Silica 1.0
ViewPlaceholder {
property var itemData
enabled: true
text: qsTr("Item type unsupported")
text: qsTr("Item type (%1) unsupported").arg(itemData.Type)
hintText: qsTr("This is still an alpha version :)")
}