diff --git a/core/include/jellyfinapimodel.h b/core/include/jellyfinapimodel.h index 6257ff3..1541524 100644 --- a/core/include/jellyfinapimodel.h +++ b/core/include/jellyfinapimodel.h @@ -292,6 +292,12 @@ public: : 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 { public: explicit ShowSeasonsModel (QObject *parent = nullptr) diff --git a/core/src/jellyfinapimodel.cpp b/core/src/jellyfinapimodel.cpp index 6e1ae05..e93c2d8 100644 --- a/core/src/jellyfinapimodel.cpp +++ b/core/src/jellyfinapimodel.cpp @@ -249,6 +249,7 @@ void registerModels(const char *URI) { qmlRegisterType(URI, 1, 0, "UserItemModel"); qmlRegisterType(URI, 1, 0, "UserItemLatestModel"); qmlRegisterType(URI, 1, 0, "UserItemResumeModel"); + qmlRegisterType(URI, 1, 0, "ShowNextUpModel"); qmlRegisterType(URI, 1, 0, "ShowSeasonsModel"); qmlRegisterType(URI, 1, 0, "ShowEpisodesModel"); } diff --git a/sailfish/qml/pages/MainPage.qml b/sailfish/qml/pages/MainPage.qml index 21fef97..c99ddcc 100644 --- a/sailfish/qml/pages/MainPage.qml +++ b/sailfish/qml/pages/MainPage.qml @@ -87,6 +87,20 @@ Page { MoreSection { text: qsTr("Next up") 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 { @@ -174,6 +188,7 @@ Page { _modelsLoaded = true; mediaLibraryModel.reload() userResumeModel.reload() + showNextUpModel.reload() } }