Skip to content

Commit

Permalink
Implement nextUp endpoint and UI
Browse files Browse the repository at this point in the history
* [UI] Added: The next up section now actually loads items
  • Loading branch information
HenkKalkwater committed Oct 10, 2020
1 parent d3a7c17 commit d6a1f43
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/include/jellyfinapimodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ class UserItemLatestModel : public ItemModel {
: 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)
Expand Down
1 change: 1 addition & 0 deletions core/src/jellyfinapimodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ void registerModels(const char *URI) {
qmlRegisterType<UserItemModel>(URI, 1, 0, "UserItemModel");
qmlRegisterType<UserItemLatestModel>(URI, 1, 0, "UserItemLatestModel");
qmlRegisterType<UserItemResumeModel>(URI, 1, 0, "UserItemResumeModel");
qmlRegisterType<ShowNextUpModel>(URI, 1, 0, "ShowNextUpModel");
qmlRegisterType<ShowSeasonsModel>(URI, 1, 0, "ShowSeasonsModel");
qmlRegisterType<ShowEpisodesModel>(URI, 1, 0, "ShowEpisodesModel");
}
Expand Down
15 changes: 15 additions & 0 deletions sailfish/qml/pages/MainPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -174,6 +188,7 @@ Page {
_modelsLoaded = true;
mediaLibraryModel.reload()
userResumeModel.reload()
showNextUpModel.reload()
}
}

Expand Down

0 comments on commit d6a1f43

Please sign in to comment.