1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-05 18:22: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,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 :)")
}