1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-11-22 01:05:17 +00:00

Implement nextUp endpoint and UI

* [UI] Added: The next up section now actually loads items
This commit is contained in:
Chris Josten 2020-10-10 16:26:08 +02:00
parent d3a7c17586
commit d6a1f431b4
3 changed files with 22 additions and 0 deletions

View file

@ -292,6 +292,12 @@ public:
: ItemModel ("/Users/{{user}}/Items/Latest", false, false, parent) {} : ItemModel ("/Users/{{user}}/Items/Latest", false, false, parent) {}
}; };
class ShowNextUpModel : public ItemModel {
public:
explicit ShowNextUpModel (QObject *parent = nullptr)
: ItemModel("/Shows/NextUp", true, true, parent) {}
};
class ShowSeasonsModel : public ItemModel { class ShowSeasonsModel : public ItemModel {
public: public:
explicit ShowSeasonsModel (QObject *parent = nullptr) explicit ShowSeasonsModel (QObject *parent = nullptr)

View file

@ -249,6 +249,7 @@ void registerModels(const char *URI) {
qmlRegisterType<UserItemModel>(URI, 1, 0, "UserItemModel"); qmlRegisterType<UserItemModel>(URI, 1, 0, "UserItemModel");
qmlRegisterType<UserItemLatestModel>(URI, 1, 0, "UserItemLatestModel"); qmlRegisterType<UserItemLatestModel>(URI, 1, 0, "UserItemLatestModel");
qmlRegisterType<UserItemResumeModel>(URI, 1, 0, "UserItemResumeModel"); qmlRegisterType<UserItemResumeModel>(URI, 1, 0, "UserItemResumeModel");
qmlRegisterType<ShowNextUpModel>(URI, 1, 0, "ShowNextUpModel");
qmlRegisterType<ShowSeasonsModel>(URI, 1, 0, "ShowSeasonsModel"); qmlRegisterType<ShowSeasonsModel>(URI, 1, 0, "ShowSeasonsModel");
qmlRegisterType<ShowEpisodesModel>(URI, 1, 0, "ShowEpisodesModel"); qmlRegisterType<ShowEpisodesModel>(URI, 1, 0, "ShowEpisodesModel");
} }

View file

@ -87,6 +87,20 @@ Page {
MoreSection { MoreSection {
text: qsTr("Next up") text: qsTr("Next up")
clickable: false clickable: false
busy: showNextUpModel.status == ApiModel.Loading
Loader {
width: parent.width
sourceComponent: carrouselView
property alias itemModel: showNextUpModel
property string collectionType: "series"
ShowNextUpModel {
id: showNextUpModel
apiClient: ApiClient
limit: 12
}
}
} }
UserViewModel { UserViewModel {
@ -174,6 +188,7 @@ Page {
_modelsLoaded = true; _modelsLoaded = true;
mediaLibraryModel.reload() mediaLibraryModel.reload()
userResumeModel.reload() userResumeModel.reload()
showNextUpModel.reload()
} }
} }