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

[3/3] update openapi spec: update code interacting with generated code

Adjusted C++ code to handle with new and renamed objects, as well as
properties with different types.

As a result of changing types, the QML side had to be updated as well.
I hope I found everything by manually testing.

Additionally, the Qt Quick application has been updated to test the
remote sessions more easily and to make it launch again.
This commit is contained in:
Chris Josten 2025-03-13 02:51:19 +01:00 committed by Chris Josten
parent 9e1a20cd3a
commit 0c72906f88
39 changed files with 366 additions and 317 deletions

View file

@ -56,7 +56,7 @@ Page {
"You can <a href=\"github\">view its source code on GitHub</a>. " +
"Parts of the code of Sailfin are from other libraries. <a href='3rdparty'>View their licenses here</a>.</p>")
.arg(apiClient.version)
.arg(2024)
.arg(2025)
textFormat: Text.StyledText
color: Theme.secondaryHighlightColor
linkColor: Theme.primaryColor

View file

@ -109,13 +109,13 @@ Page {
ItemChildrenShowcase {
text: model.name
onHeaderClicked: appWindow.navigateToItem(model.jellyfinId, model.collectionType, model.type, model.isFolder);
collectionType: model.collectionType || ""
collectionType: model.collectionType || 0
loader: J.LatestMediaLoader {
apiClient: appWindow.apiClient
parentId: jellyfinId
}
Binding on loader {
when: model.collectionType == "livetv"
when: model.collectionType == J.CollectionType.Livetv
value: J.LiveTvChannelsLoader{
apiClient: appWindow.apiClient
}

View file

@ -39,7 +39,7 @@ BaseDetailPage {
id: collectionLoader
apiClient: appWindow.apiClient
parentId: itemData.jellyfinId
sortBy: "SortName"
sortBy: [ J.SortBy.SortName ]
autoReload: itemData.jellyfinId.length > 0 && (pageRoot.status == PageStatus.Active || _collectionModelLoaded)
}
}
@ -107,7 +107,7 @@ BaseDetailPage {
id: itemImage
anchors.fill: parent
source: Utils.itemModelImageUrl(apiClient.baseUrl, model.jellyfinId, model.imageTags.Primary, "Primary", {"maxWidth": width})
blurhash: model.imageBlurHashes.Primary[model.imageTags.Primary]
blurhash: model.imageBlurHashes.Primary !== undefined ? model.imageBlurHashes.Primary[model.imageTags.Primary] : undefined
fallbackColor: Utils.colorFromString(model.name)
fillMode: Image.PreserveAspectCrop
clip: true
@ -152,8 +152,14 @@ BaseDetailPage {
Component {
id: sortPageComponent
Page {
id: sortPage
readonly property var sortMap: {
"SortName": [J.SortBy.SortName],
"PlayCount": [J.SortBy.PlayCount],
"DateCreated": [J.SortBy.DateCreated]
};
ListModel {
id: sortOptions
@ -183,19 +189,19 @@ BaseDetailPage {
MenuItem {
//: Sort order
text: qsTr("Ascending")
onClicked: apply(model.value, "Ascending")
onClicked: apply(model.value, J.SortOrder.Ascending)
}
MenuItem {
//: Sort order
text: qsTr("Descending")
onClicked: apply(model.value, "Descending")
onClicked: apply(model.value, J.SortOrder.Descending)
}
}
onClicked: openMenu()
function apply(field, order) {
collectionModel.loader.sortBy = field;
collectionModel.loader.sortOrder = order;
collectionModel.loader.sortBy = sortMap[field];
collectionModel.loader.sortOrder = [order];
collectionModel.loader.reload()
pageStack.pop()
}

View file

@ -51,7 +51,7 @@ BaseDetailPage {
id: collectionModel
loader: J.UserItemsLoader {
apiClient: appWindow.apiClient
sortBy: itemData.type === "MusicAlbum" ? "ParentIndexNumber,IndexNumber,SortName" : ""
sortBy: itemData.type === J.ItemType.MusicAlbum ? [J.SortBy.ParentIndexNumber, J.SortBy.IndexNumber,J.SortBy.SortName] : []
fields: [J.ItemFields.ItemCounts, J.ItemFields.PrimaryImageAspectRatio]
parentId: itemData.jellyfinId
autoReload: itemData.jellyfinId.length > 0

View file

@ -33,11 +33,11 @@ BaseDetailPage {
id: albumsModel
loader: J.UserItemsLoader {
apiClient: appWindow.apiClient
sortBy: "PremiereDate,ProductionYear,SortName"
sortOrder: "Descending"
sortBy: [J.SortBy.PremiereDate, J.SortBy.ProductionYear, J.SortBy.SortName]
sortOrder: [J.SortOrder.Descending]
fields: [J.ItemFields.ItemCounts, J.ItemFields.PrimaryImageAspectRatio]
includeItemTypes: ["MusicAlbum"]
albumArtistIds: itemData.jellyfinId
includeItemTypes: [J.ItemType.MusicAlbum]
albumArtistIds: [itemData.jellyfinId]
recursive: true
autoReload: itemData.jellyfinId.length > 0
limit: _maxItems
@ -48,10 +48,10 @@ BaseDetailPage {
id: fullAlbumsModelComponent
J.UserItemsLoader {
apiClient: appWindow.apiClient
sortBy: "PremiereDate,ProductionYear,SortName"
sortOrder: "Descending"
sortBy: [J.SortBy.PremiereDate, J.SortBy.ProductionYear, J.SortBy.SortName]
sortOrder: [J.SortOrder.Descending]
fields: [J.ItemFields.ItemCounts, J.ItemFields.PrimaryImageAspectRatio]
includeItemTypes: ["MusicAlbum"]
includeItemTypes: [J.ItemType.MusicAlbum]
albumArtistIds: itemData.jellyfinId
recursive: true
autoReload: false
@ -62,10 +62,10 @@ BaseDetailPage {
id: appearsOnModel
loader: J.UserItemsLoader {
apiClient: appWindow.apiClient
sortBy: "PremiereDate,ProductionYear,SortName"
sortOrder: "Descending"
sortBy: [J.SortBy.PremiereDate, J.SortBy.ProductionYear, J.SortBy.SortName]
sortOrder: [J.SortOrder.Descending]
fields: [J.ItemFields.ItemCounts, J.ItemFields.PrimaryImageAspectRatio]
includeItemTypes: ["MusicAlbum"]
includeItemTypes: [J.ItemType.MusicAlbum]
contributingArtistIds: itemData.jellyfinId
recursive: true
autoReload: itemData.jellyfinId.length > 0
@ -76,10 +76,10 @@ BaseDetailPage {
id: fullAppearsOnModelComponent
J.UserItemsLoader {
apiClient: appWindow.apiClient
sortBy: "PremiereDate,ProductionYear,SortName"
sortOrder: "Descending"
sortBy: [J.SortBy.PremiereDate, J.SortBy.ProductionYear, J.SortBy.SortName]
sortOrder: [J.SortOrder.Descending]
fields: [J.ItemFields.ItemCounts, J.ItemFields.PrimaryImageAspectRatio]
includeItemTypes: ["MusicAlbum"]
includeItemTypes: [J.ItemType.MusicAlbum]
contributingArtistIds: itemData.jellyfinId
recursive: true
autoReload: false

View file

@ -56,7 +56,7 @@ BaseDetailPage {
J.LatestMediaLoader {
apiClient: appWindow.apiClient
parentId: itemData.jellyfinId
includeItemTypes: "Audio"
includeItemTypes: [J.ItemType.Audio]
autoReload: false
}
}
@ -74,9 +74,9 @@ BaseDetailPage {
J.UserItemsLoader {
apiClient: appWindow.apiClient
parentId: itemData.jellyfinId
includeItemTypes: "MusicAlbum"
includeItemTypes: [J.ItemType.MusicAlbum]
recursive: true
sortBy: "SortName"
sortBy: [J.SortBy.SortName]
autoReload: false
}
}
@ -85,9 +85,9 @@ BaseDetailPage {
J.UserItemsLoader {
apiClient: appWindow.apiClient
parentId: itemData.jellyfinId
includeItemTypes: "Playlist"
includeItemTypes: [J.ItemType.Playlist]
recursive: true
sortBy: "SortName"
sortBy: [J.SortBy.SortName]
autoReload: false
}
}
@ -109,7 +109,7 @@ BaseDetailPage {
apiClient: appWindow.apiClient
parentId: itemData.jellyfinId
autoReload: _firstTimeLoaded && itemData.jellyfinId.length > 0
includeItemTypes: "Audio"
includeItemTypes: [J.ItemType.Audio]
limit: 12
}
onHeaderClicked: pageStack.push(Qt.resolvedUrl("CollectionPage.qml"), {
@ -128,9 +128,9 @@ BaseDetailPage {
loader: J.UserItemsLoader {
apiClient: appWindow.apiClient
parentId: itemData.jellyfinId
includeItemTypes: "MusicAlbum"
includeItemTypes: [J.ItemType.MusicAlbum]
autoReload: _firstTimeLoaded && itemData.jellyfinId.length > 0
sortBy: "Random"
sortBy: [J.SortBy.Random]
recursive: true
limit: 12
}
@ -148,9 +148,9 @@ BaseDetailPage {
loader: J.UserItemsLoader {
apiClient: appWindow.apiClient
parentId: itemData.jellyfinId
includeItemTypes: "Playlist"
includeItemTypes: [J.ItemType.Playlist]
autoReload: _firstTimeLoaded && itemData.jellyfinId.length > 0
sortBy: "Random"
sortBy: [J.SortBy.Random]
recursive: true
limit: 12
}