Jellyfin Qt
QML Library for interacting with the Jellyfin multimedia server
Toggle main menu visibility
Loading...
Searching...
No Matches
item.h
Go to the documentation of this file.
1
/*
2
* Sailfin: a Jellyfin client written using Qt
3
* Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
9
*
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
*/
19
20
#ifndef JELLYFIN_MODEL_ITEM
21
#define JELLYFIN_MODEL_ITEM
22
23
#include <functional>
24
#include <map>
25
26
#include <QObject>
27
#include <QList>
28
29
#include "
../dto/baseitemdto.h
"
30
#include "
../support/loader.h
"
31
#include "
../apiclient.h
"
32
33
namespace
Jellyfin
{
34
namespace
Model
{
35
36
class
Item
:
public
QObject,
public
DTO::BaseItemDto
{
37
Q_OBJECT
38
public
:
39
using
UserDataChangedCallback
= std::function<void(
DTO::UserItemDataDto
)>;
40
using
BaseItemDto::userData
;
45
49
Item
(
ApiClient
*apiClient =
nullptr
, QObject *parent =
nullptr
);
50
56
Item
(
const
DTO::BaseItemDto
&data,
ApiClient
*apiClient =
nullptr
, QObject *parent =
nullptr
);
57
//virtual ~Item();
58
68
bool
sameAs
(
const
DTO::BaseItemDto
&other);
69
70
void
setApiClient
(
ApiClient
*apiClient);
71
72
signals:
73
void
userDataChanged
(
const
DTO::UserItemDataDto
&newUserData);
74
private
:
75
ApiClient
*m_apiClient =
nullptr
;
76
void
updateUserData(
const
QString &itemId,
const
DTO::UserItemDataDto
&
userData
);
77
78
};
79
80
}
81
}
82
83
#endif
// JELLYFIN_MODEL_ITEM
apiclient.h
baseitemdto.h
Jellyfin::ApiClient
An Api client for Jellyfin. Handles requests and authentication.
Definition
apiclient.h:90
Jellyfin::DTO::BaseItemDto
Definition
baseitemdto.h:74
Jellyfin::DTO::BaseItemDto::userData
QSharedPointer< UserItemDataDto > userData() const
Definition
baseitemdto.cpp:2030
Jellyfin::DTO::UserItemDataDto
Definition
useritemdatadto.h:49
Jellyfin::Model::Item::setApiClient
void setApiClient(ApiClient *apiClient)
Definition
item.cpp:58
Jellyfin::Model::Item::sameAs
bool sameAs(const DTO::BaseItemDto &other)
sameAs Returns true if this item represents the same item as other
Definition
item.cpp:54
Jellyfin::Model::Item::userData
QSharedPointer< UserItemDataDto > userData() const
Definition
baseitemdto.cpp:2030
Jellyfin::Model::Item::Item
Item(ApiClient *apiClient=nullptr, QObject *parent=nullptr)
Constructor that creates an empty item.
Definition
item.cpp:26
Jellyfin::Model::Item::UserDataChangedCallback
std::function< void(DTO::UserItemDataDto)> UserDataChangedCallback
Definition
item.h:39
Jellyfin::Model::Item::userDataChanged
void userDataChanged(const DTO::UserItemDataDto &newUserData)
Jellyfin::Model
Definition
controllablesession.h:18
Jellyfin
loader.h
core
include
JellyfinQt
model
item.h
Generated by
1.17.0