Skip to content

Commit 64ed5c7

Browse files
committed
Merge branch 'master' of github.com:MythTV/mythtv
2 parents c895f45 + ad57fb7 commit 64ed5c7

File tree

11 files changed

+201
-58
lines changed

11 files changed

+201
-58
lines changed

mythtv/libs/libmythbase/mythversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/// Update this whenever the plug-in API changes.
1313
/// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
1414
/// libmythui class methods used by plug-ins.
15-
#define MYTH_BINARY_VERSION "0.25.20120211-2"
15+
#define MYTH_BINARY_VERSION "0.25.20120212-1"
1616

1717
/** \brief Increment this whenever the MythTV network protocol changes.
1818
*

mythtv/libs/libmythmetadata/metadatacommon.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ struct PersonInfo
2929
QString url;
3030
};
3131

32+
// What type of grabber script to use
3233
enum MetadataType {
3334
kMetadataVideo = 0,
3435
kMetadataRecording = 1,
3536
kMetadataMusic = 2,
3637
kMetadataGame = 3
3738
};
3839

40+
// Determines the lookup fallback strategy
3941
enum LookupType {
4042
kProbableTelevision = 0,
4143
kProbableGenericTelevision = 1,
@@ -45,6 +47,16 @@ enum LookupType {
4547
kProbableGame = 5
4648
};
4749

50+
// Actual type of content
51+
enum VideoContentType {
52+
kContentMovie = 0,
53+
kContentTelevision = 1,
54+
kContentAdult = 2,
55+
kContentMusicVideo = 3,
56+
kContentHomeMovie = 4,
57+
kContentUnknown = 5
58+
};
59+
4860
enum PeopleType {
4961
kPersonActor = 0,
5062
kPersonAuthor = 1,

mythtv/libs/libmythmetadata/videometadata.cpp

Lines changed: 112 additions & 47 deletions
Large diffs are not rendered by default.

mythtv/libs/libmythmetadata/videometadata.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "parentalcontrols.h"
1111
#include "mythmetaexp.h"
12+
#include "metadatacommon.h"
1213

1314
class MSqlQuery;
1415
class VideoMetadataListManager;
@@ -70,13 +71,15 @@ class META_PUBLIC VideoMetadata
7071
int year = VIDEO_YEAR_DEFAULT,
7172
const QDate &releasedate = QDate(),
7273
const QString &inetref = QString(),
74+
int collectionref = 0,
7375
const QString &homepage = QString(),
7476
const QString &director = QString(),
7577
const QString &studio = QString(),
7678
const QString &plot = QString(),
7779
float userrating = 0.0,
7880
const QString &rating = QString(),
7981
int length = 0,
82+
int playcount = 0,
8083
int season = 0,
8184
int episode = 0,
8285
const QDate &insertdate = QDate(),
@@ -92,7 +95,8 @@ class META_PUBLIC VideoMetadata
9295
const country_list &countries = country_list(),
9396
const cast_list &cast = cast_list(),
9497
const QString &host = "",
95-
bool processed = false);
98+
bool processed = false,
99+
VideoContentType contenttype = kContentUnknown);
96100
~VideoMetadata();
97101
VideoMetadata(MSqlQuery &query);
98102
VideoMetadata(const VideoMetadata &rhs);
@@ -128,6 +132,9 @@ class META_PUBLIC VideoMetadata
128132
const QString &GetInetRef() const;
129133
void SetInetRef(const QString &inetRef);
130134

135+
int GetCollectionRef() const;
136+
void SetCollectionRef(int collectionref);
137+
131138
const QString &GetHomepage() const;
132139
void SetHomepage(const QString &homepage);
133140

@@ -173,9 +180,15 @@ class META_PUBLIC VideoMetadata
173180
bool GetProcessed() const;
174181
void SetProcessed(bool processed);
175182

183+
VideoContentType GetContentType() const;
184+
void SetContentType(VideoContentType contenttype);
185+
176186
const QString &GetPlayCommand() const;
177187
void SetPlayCommand(const QString &playCommand);
178188

189+
unsigned int GetPlayCount() const;
190+
void SetPlayCount(int count);
191+
179192
ParentalLevel::Level GetShowLevel() const;
180193
void SetShowLevel(ParentalLevel::Level showLevel);
181194

mythtv/libs/libmythmetadata/videometadatalistmanager.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ void VideoMetadataListManager::loadAllFromDatabase(metadata_list &items,
127127
query.setForwardOnly(true);
128128
QString BaseMetadataQuery(
129129
"SELECT title, director, studio, plot, rating, year, releasedate,"
130-
"userrating, length, filename, hash, showlevel, "
131-
"coverfile, inetref, homepage, childid, browse, watched, "
130+
"userrating, length, playcount, filename, hash, showlevel, "
131+
"coverfile, inetref, collectionref, homepage, childid, browse, watched, "
132132
"playcommand, category, intid, trailer, screenshot, banner, fanart, "
133-
"subtitle, tagline, season, episode, host, insertdate, processed "
134-
" FROM videometadata ");
133+
"subtitle, tagline, season, episode, host, insertdate, processed, "
134+
"contenttype FROM videometadata ");
135135

136136
if (!sql.isEmpty())
137137
BaseMetadataQuery.append(sql);

mythtv/libs/libmythmetadata/videoscan.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,9 @@ bool VideoScannerThread::updateDB(const FileCheckList &add, const PurgeList &rem
307307
QString(),
308308
VIDEO_YEAR_DEFAULT,
309309
QDate::fromString("0000-00-00","YYYY-MM-DD"),
310-
VIDEO_INETREF_DEFAULT, QString(),
310+
VIDEO_INETREF_DEFAULT, 0, QString(),
311311
VIDEO_DIRECTOR_DEFAULT, QString(), VIDEO_PLOT_DEFAULT,
312-
0.0, VIDEO_RATING_DEFAULT, 0,
312+
0.0, VIDEO_RATING_DEFAULT, 0, 0,
313313
VideoMetadata::FilenameToMeta(p->first, 2).toInt(),
314314
VideoMetadata::FilenameToMeta(p->first, 3).toInt(),
315315
QDate::currentDate(),

mythtv/libs/libmythmetadata/videoutils.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,39 @@ bool isHostMaster(const QString &host)
258258

259259
return isMaster;
260260
}
261+
262+
VideoContentType ContentTypeFromString(const QString &type)
263+
{
264+
VideoContentType ret = kContentUnknown;
265+
266+
if (type == "MOVIE")
267+
ret = kContentMovie;
268+
else if (type == "TELEVISION")
269+
ret = kContentTelevision;
270+
else if (type == "ADULT")
271+
ret = kContentAdult;
272+
else if (type == "MUSICVIDEO")
273+
ret = kContentMusicVideo;
274+
else if (type == "HOMEVIDEO")
275+
ret = kContentHomeMovie;
276+
277+
return ret;
278+
}
279+
280+
QString ContentTypeToString(VideoContentType type)
281+
{
282+
QString ret = "UNKNOWN";
283+
284+
if (type == kContentMovie)
285+
ret = "MOVIE";
286+
else if (type == kContentTelevision)
287+
ret = "TELEVISION";
288+
else if (type == kContentAdult)
289+
ret = "ADULT";
290+
else if (type == kContentMusicVideo)
291+
ret = "MUSICVIDEO";
292+
else if (type == kContentHomeMovie)
293+
ret = "HOMEVIDEO";
294+
295+
return ret;
296+
}

mythtv/libs/libmythmetadata/videoutils.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "parentalcontrols.h"
55
#include "mythmetaexp.h"
6+
#include "metadatacommon.h"
67

78
template <typename T>
89
inline void CheckedSet(T *uiItem, const QString &value)
@@ -56,6 +57,9 @@ META_PUBLIC QString WatchedToState(bool watched);
5657

5758
META_PUBLIC bool isHostMaster(const QString &host);
5859

60+
META_PUBLIC VideoContentType ContentTypeFromString(const QString &type);
61+
META_PUBLIC QString ContentTypeToString(VideoContentType type);
62+
5963
// this needs to be an inline and pull in the storage group and context
6064
// headers since it this used in dbcheck.cpp.
6165
#include <storagegroup.h>

mythtv/libs/libmythservicecontracts/datacontracts/videoMetadataInfo.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace DTC
3737
class SERVICE_PUBLIC VideoMetadataInfo : public QObject
3838
{
3939
Q_OBJECT
40-
Q_CLASSINFO( "version" , "1.10" );
40+
Q_CLASSINFO( "version" , "1.20" );
4141

4242
Q_PROPERTY( int Id READ Id WRITE setId )
4343
Q_PROPERTY( QString Title READ Title WRITE setTitle )
@@ -48,17 +48,20 @@ class SERVICE_PUBLIC VideoMetadataInfo : public QObject
4848
Q_PROPERTY( QString Description READ Description WRITE setDescription )
4949
Q_PROPERTY( QString Certification READ Certification WRITE setCertification )
5050
Q_PROPERTY( QString Inetref READ Inetref WRITE setInetref )
51+
Q_PROPERTY( int Collectionref READ Collectionref WRITE setCollectionref )
5152
Q_PROPERTY( QString HomePage READ HomePage WRITE setHomePage )
5253
Q_PROPERTY( QDateTime ReleaseDate READ ReleaseDate WRITE setReleaseDate )
5354
Q_PROPERTY( QDateTime AddDate READ AddDate WRITE setAddDate )
5455
Q_PROPERTY( float UserRating READ UserRating WRITE setUserRating )
5556
Q_PROPERTY( int Length READ Length WRITE setLength )
57+
Q_PROPERTY( int PlayCount READ PlayCount WRITE setPlayCount )
5658
Q_PROPERTY( int Season READ Season WRITE setSeason )
5759
Q_PROPERTY( int Episode READ Episode WRITE setEpisode )
5860
Q_PROPERTY( int ParentalLevel READ ParentalLevel WRITE setParentalLevel )
5961
Q_PROPERTY( bool Visible READ Visible WRITE setVisible )
6062
Q_PROPERTY( bool Watched READ Watched WRITE setWatched )
6163
Q_PROPERTY( bool Processed READ Processed WRITE setProcessed )
64+
Q_PROPERTY( QString ContentType READ ContentType WRITE setContentType )
6265
Q_PROPERTY( QString FileName READ FileName WRITE setFileName )
6366
Q_PROPERTY( QString Hash READ Hash WRITE setHash )
6467
Q_PROPERTY( QString HostName READ HostName WRITE setHostName )
@@ -79,17 +82,20 @@ class SERVICE_PUBLIC VideoMetadataInfo : public QObject
7982
PROPERTYIMP ( QString , Description )
8083
PROPERTYIMP ( QString , Certification )
8184
PROPERTYIMP ( QString , Inetref )
85+
PROPERTYIMP ( int , Collectionref )
8286
PROPERTYIMP ( QString , HomePage )
8387
PROPERTYIMP ( QDateTime , ReleaseDate )
8488
PROPERTYIMP ( QDateTime , AddDate )
8589
PROPERTYIMP ( float , UserRating )
8690
PROPERTYIMP ( int , Length )
91+
PROPERTYIMP ( int , PlayCount )
8792
PROPERTYIMP ( int , Season )
8893
PROPERTYIMP ( int , Episode )
8994
PROPERTYIMP ( int , ParentalLevel )
9095
PROPERTYIMP ( bool , Visible )
9196
PROPERTYIMP ( bool , Watched )
9297
PROPERTYIMP ( bool , Processed )
98+
PROPERTYIMP ( QString , ContentType )
9399
PROPERTYIMP ( QString , FileName )
94100
PROPERTYIMP ( QString , Hash )
95101
PROPERTYIMP ( QString , HostName )
@@ -118,8 +124,10 @@ class SERVICE_PUBLIC VideoMetadataInfo : public QObject
118124
VideoMetadataInfo(QObject *parent = 0)
119125
: QObject ( parent ),
120126
m_Id ( 0 ),
127+
m_Collectionref ( 0 ),
121128
m_UserRating ( 0 ),
122129
m_Length ( 0 ),
130+
m_PlayCount ( 0 ),
123131
m_Season ( 0 ),
124132
m_Episode ( 0 ),
125133
m_ParentalLevel ( 0 ),

mythtv/programs/mythbackend/services/serviceUtil.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "recordinginfo.h"
2828
#include "recordingtypes.h"
2929
#include "channelutil.h"
30+
#include "videoutils.h"
3031
#include "metadataimagehelper.h"
3132

3233
/////////////////////////////////////////////////////////////////////////////
@@ -280,17 +281,21 @@ void FillVideoMetadataInfo (
280281
pVideoMetadataInfo->setDescription(pMetadata->GetPlot());
281282
pVideoMetadataInfo->setCertification(pMetadata->GetRating());
282283
pVideoMetadataInfo->setInetref(pMetadata->GetInetRef());
284+
pVideoMetadataInfo->setCollectionref(pMetadata->GetCollectionRef());
283285
pVideoMetadataInfo->setHomePage(pMetadata->GetHomepage());
284286
pVideoMetadataInfo->setReleaseDate(QDateTime(pMetadata->GetReleaseDate()));
285287
pVideoMetadataInfo->setAddDate(QDateTime(pMetadata->GetInsertdate()));
286288
pVideoMetadataInfo->setUserRating(pMetadata->GetUserRating());
287289
pVideoMetadataInfo->setLength(pMetadata->GetLength());
290+
pVideoMetadataInfo->setPlayCount(pMetadata->GetPlayCount());
288291
pVideoMetadataInfo->setSeason(pMetadata->GetSeason());
289292
pVideoMetadataInfo->setEpisode(pMetadata->GetEpisode());
290293
pVideoMetadataInfo->setParentalLevel(pMetadata->GetShowLevel());
291294
pVideoMetadataInfo->setVisible(pMetadata->GetBrowse());
292295
pVideoMetadataInfo->setWatched(pMetadata->GetWatched());
293296
pVideoMetadataInfo->setProcessed(pMetadata->GetProcessed());
297+
pVideoMetadataInfo->setContentType(ContentTypeToString(
298+
pMetadata->GetContentType()));
294299
pVideoMetadataInfo->setFileName(pMetadata->GetFilename());
295300
pVideoMetadataInfo->setHash(pMetadata->GetHash());
296301
pVideoMetadataInfo->setHostName(pMetadata->GetHost());

0 commit comments

Comments
 (0)