19#ifndef JELLYFIN_VIEWMODEL_USERDATA_H
20#define JELLYFIN_VIEWMODEL_USERDATA_H
24#include <QSharedPointer>
34 explicit UserData(QObject* parent =
nullptr);
35 explicit UserData(QSharedPointer<DTO::UserItemDataDto> data, QObject* parent =
nullptr);
37 void setData(QSharedPointer<DTO::UserItemDataDto> data);
50 double rating()
const {
return m_data->rating().value_or(0); }
54 int playCount()
const {
return m_data->playCount(); }
55 bool favorite()
const {
return m_data->isFavorite(); }
56 bool likes()
const {
return m_data->likes().value_or(
false); }
58 bool played()
const {
return m_data->played(); }
59 QString
key()
const {
return m_data->key(); }
74 QSharedPointer<DTO::UserItemDataDto> m_data;
void setData(QSharedPointer< DTO::UserItemDataDto > data)
Definition userdata.cpp:37
qint64 playbackPositionTicks
Definition userdata.h:42
void playedPercentageChanged(double newPlayedPercentage)
double playedPercentage() const
Definition userdata.h:51
void lastPlayedDateChanged(QDateTime newLastPlayedDate)
bool played
Definition userdata.h:47
QString key
Definition userdata.h:48
int playCount() const
Definition userdata.h:54
QString key() const
Definition userdata.h:59
int unplayedItemCount
Definition userdata.h:41
double rating
Definition userdata.h:39
int unplayedItemCount() const
Definition userdata.h:52
void likesChanged(bool newLikes)
void keyChanged(QString newKey)
bool favorite() const
Definition userdata.h:55
void favoriteChanged(bool newFavorite)
void playbackPositionTicksChanged(qint64 newPlaybackPositionTicks)
void unplayedItemCountChanged(int newUnplayedItemCount)
double playedPercentage
Definition userdata.h:40
QDateTime lastPlayedDate
Definition userdata.h:46
bool m_likes
Definition userdata.h:45
void ratingChanged(double newRating)
qint64 playbackPositionTicks() const
Definition userdata.h:53
QDateTime lastPlayedDate() const
Definition userdata.h:57
int playCount
Definition userdata.h:43
bool likes() const
Definition userdata.h:56
bool played() const
Definition userdata.h:58
void playedChanged(bool newPLayed)
bool favorite
Definition userdata.h:44
void playCountChanged(int newPlayCount)
UserItemDataDto UserData
Definition apiclient.h:58