mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-05 18:22:46 +00:00
Add music library page
This commit is contained in:
parent
0c0b91dc4b
commit
dc9c3ea1b8
11 changed files with 284 additions and 102 deletions
|
@ -184,6 +184,16 @@ bool setRequestStartIndex(Loader::GetNextUpParams ¶ms, int offset) {
|
|||
return true;
|
||||
}
|
||||
|
||||
template<>
|
||||
void setRequestLimit(Loader::GetAlbumArtistsParams ¶ms, int limit) {
|
||||
params.setLimit(limit);
|
||||
}
|
||||
template<>
|
||||
bool setRequestStartIndex(Loader::GetAlbumArtistsParams ¶ms, int offset) {
|
||||
params.setStartIndex(offset);
|
||||
return true;
|
||||
}
|
||||
|
||||
template<>
|
||||
QList<DTO::UserDto> extractRecords(const QList<DTO::UserDto> &result) {
|
||||
return result;
|
||||
|
|
|
@ -77,6 +77,7 @@ void JellyfinPlugin::registerTypes(const char *uri) {
|
|||
qmlRegisterType<ViewModel::ShowEpisodesLoader>(uri, 1, 0, "ShowEpisodesLoader");
|
||||
qmlRegisterType<ViewModel::NextUpLoader>(uri, 1, 0, "NextUpLoader");
|
||||
qmlRegisterType<ViewModel::PublicUsersLoader>(uri, 1, 0, "PublicUsersLoader");
|
||||
qmlRegisterType<ViewModel::AlbumArtistLoader>(uri, 1, 0, "AlbumArtistLoader");
|
||||
|
||||
// Enumerations
|
||||
qmlRegisterUncreatableType<Jellyfin::DTO::GeneralCommandTypeClass>(uri, 1, 0, "GeneralCommandType", "Is an enum");
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
#include "JellyfinQt/viewmodel/itemmodel.h"
|
||||
|
||||
#include "JellyfinQt/loader/http/artists.h"
|
||||
#include "JellyfinQt/loader/http/items.h"
|
||||
#include "JellyfinQt/loader/http/userlibrary.h"
|
||||
#include "JellyfinQt/loader/http/userviews.h"
|
||||
|
@ -57,6 +58,9 @@ ShowEpisodesLoader::ShowEpisodesLoader(QObject *parent)
|
|||
NextUpLoader::NextUpLoader(QObject *parent)
|
||||
: NextUpLoaderBase(new Jellyfin::Loader::HTTP::GetNextUpLoader(), parent) {}
|
||||
|
||||
AlbumArtistLoader::AlbumArtistLoader(QObject *parent)
|
||||
: AlbumArtistLoaderBase(new Jellyfin::Loader::HTTP::GetAlbumArtistsLoader(), parent) {}
|
||||
|
||||
ItemModel::ItemModel(QObject *parent)
|
||||
: ApiModel<Model::Item>(parent) {
|
||||
connect(this, &QAbstractItemModel::rowsInserted, this, &ItemModel::onInsertItems);
|
||||
|
@ -128,7 +132,7 @@ QSharedPointer<Model::Item> ItemModel::itemAt(int index) {
|
|||
|
||||
void ItemModel::onInsertItems(const QModelIndex &parent, int start, int end) {
|
||||
if (parent.isValid()) return;
|
||||
qDebug() << "Connecting " << (end - start + 1) << "items!";
|
||||
//qDebug() << "Connecting " << (end - start + 1) << "items!";
|
||||
for (int i = start; i <= end; i++) {
|
||||
connect(itemAt(i).data(), &Model::Item::userDataChanged, this, &ItemModel::onUserDataUpdated);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue