1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-04 01:42:44 +00:00

AN attempt to get covers to work again

Covers should now work when at least the playbackManager is playing.
Covers based on the currently displayed item on the page does not work
yet.

The CoverPage has been revamped to use 1 model and 1 PathView to animate
the items for cleaner code.
This commit is contained in:
Chris Josten 2021-08-23 01:53:20 +02:00
parent 5ee2869db9
commit 757327ceac
6 changed files with 118 additions and 145 deletions

View file

@ -38,9 +38,7 @@ ApplicationWindow {
readonly property ApiClient apiClient: _apiClient
// Due QTBUG-10822, declarartions such as `property J.Item foo` are not possible.
property var itemData
// Id of the collection currently browsing. For use on the cover.
property string collectionId
property var itemData: pageStack.currentPage.itemData
// Bad way to implement settings, but it'll do for now.
property bool showDebugInfo: true
@ -68,19 +66,17 @@ ApplicationWindow {
}
}
}
cover: CoverBackground {CoverPlaceholder { icon.source: "icon.png"; text: "Sailfin"}}
/*{
//cover: CoverBackground {CoverPlaceholder { icon.source: "icon.png"; text: "Sailfin"}}
cover: {
// Disabled due to buggy Loader behaviour
if ([MediaPlayer.NoMedia, MediaPlayer.InvalidMedia, MediaPlayer.UnknownStatus].indexOf(_playbackManager.mediaStatus) >= 0) {
if (itemData) {
return Qt.resolvedUrl("cover/PosterCover.qml")
} else {
return Qt.resolvedUrl("cover/CoverPage.qml")
}
return Qt.resolvedUrl("cover/CoverPage.qml")
} else if (playbackManager.hasVideo){
return Qt.resolvedUrl("cover/VideoCover.qml")
} else {
return Qt.resolvedUrl("cover/CoverPage.qml")
}
}*/
}
Notification {
id: errorNotification
@ -100,6 +96,17 @@ ApplicationWindow {
autoOpen: true
}
Connections {
target: pageStack
onCurrentPageChanged: {
if ("itemData" in pageStack.currentPage) {
appWindow.itemData = pageStack.currentPage.itemData
} else {
appWindow.itemData = null
}
}
}
// Keep the sytem alive while playing media
KeepAlive {
enabled: playbackManager.playbackState === MediaPlayer.PlayingState