Skip to content

Commit 5efd77d

Browse files
author
Robert McNamara
committed
Use ProgramID for Video Files.
More accurately, extend the programinfo constructor for videos to add programid. Load Video ID into programID when creating a ProgramInfo for the player. This will allow the frontend status query to display the video ID, which can then be used as a basis for a metadata query of the backend Video Service API. Bumps the library API, make distclean.
1 parent d8e7a60 commit 5efd77d

File tree

8 files changed

+40
-20
lines changed

8 files changed

+40
-20
lines changed

mythtv/libs/libmyth/programinfo.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,8 @@ ProgramInfo::ProgramInfo(const QString &_pathname,
771771
int _season, int _episode,
772772
const QString &_inetref,
773773
uint _length_in_minutes,
774-
uint _year) :
774+
uint _year,
775+
const QString &_programid) :
775776
positionMapDBReplacement(NULL)
776777
{
777778
clear();
@@ -813,6 +814,7 @@ ProgramInfo::ProgramInfo(const QString &_pathname,
813814
episode = _episode;
814815
inetref = _inetref;
815816
title = _title;
817+
programid = _programid;
816818
}
817819

818820
ProgramInfo::ProgramInfo(const QString &_title, uint _chanid,

mythtv/libs/libmyth/programinfo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ class MPUBLIC ProgramInfo
236236
int season, int episode,
237237
const QString &inetref,
238238
uint length_in_minutes,
239-
uint year);
239+
uint year,
240+
const QString &programid);
240241
/// Constructs a manual record ProgramInfo.
241242
ProgramInfo(const QString &_title, uint _chanid,
242243
const QDateTime &_startts, const QDateTime &_endts);

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.20111101-1"
15+
#define MYTH_BINARY_VERSION "0.25.20111102-1"
1616

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

mythtv/libs/libmythui/mythmainwindow.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,8 @@ bool MythMainWindow::HandleMedia(const QString &handler, const QString &mrl,
18381838
const QString &subtitle,
18391839
const QString &director, int season,
18401840
int episode, const QString &inetref,
1841-
int lenMins, const QString &year)
1841+
int lenMins, const QString &year,
1842+
const QString &id)
18421843
{
18431844
QString lhandler(handler);
18441845
if (lhandler.isEmpty())
@@ -1849,7 +1850,7 @@ bool MythMainWindow::HandleMedia(const QString &handler, const QString &mrl,
18491850
{
18501851
d->mediaPluginMap[lhandler].playFn(mrl, plot, title, subtitle,
18511852
director, season, episode,
1852-
inetref, lenMins, year);
1853+
inetref, lenMins, year, id);
18531854
return true;
18541855
}
18551856

@@ -2290,6 +2291,13 @@ void MythMainWindow::customEvent(QEvent *ce)
22902291
{
22912292
if (me->ExtraDataCount() == 1)
22922293
HandleMedia("Internal", me->ExtraData(0));
2294+
else if (me->ExtraDataCount() == 11)
2295+
HandleMedia("Internal", me->ExtraData(0),
2296+
me->ExtraData(1), me->ExtraData(2),
2297+
me->ExtraData(3), me->ExtraData(4),
2298+
me->ExtraData(5).toInt(), me->ExtraData(6).toInt(),
2299+
me->ExtraData(7), me->ExtraData(8).toInt(),
2300+
me->ExtraData(9), me->ExtraData(10));
22932301
else
22942302
LOG(VB_GENERAL, LOG_ERR, "Failed to handle media");
22952303
}

mythtv/libs/libmythui/mythmainwindow.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class MythMediaDevice;
1818
#define REG_JUMPEX(a, b, c, d, e) GetMythMainWindow()->RegisterJump(a, b, c, d, e)
1919
#define REG_MEDIAPLAYER(a,b,c) GetMythMainWindow()->RegisterMediaPlugin(a, b, c)
2020

21-
typedef int (*MediaPlayCallback)(const QString &, const QString &, const QString &, const QString &, const QString &, int, int, const QString &, int, const QString &);
21+
typedef int (*MediaPlayCallback)(const QString &, const QString &, const QString &, const QString &, const QString &, int, int, const QString &, int, const QString &, const QString &);
2222

2323
class MythMainWindowPrivate;
2424

@@ -75,7 +75,8 @@ class MUI_PUBLIC MythMainWindow : public QWidget
7575
const QString& plot="", const QString& title="",
7676
const QString& subtitle="", const QString& director="",
7777
int season=0, int episode=0, const QString& inetref="",
78-
int lenMins=120, const QString& year="1895");
78+
int lenMins=120, const QString& year="1895",
79+
const QString &id="");
7980
void HandleTVPower(bool poweron);
8081

8182
void JumpTo(const QString &destination, bool pop = true);

mythtv/programs/mythfrontend/main.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,8 @@ static void WriteDefaults()
10851085
static int internal_play_media(const QString &mrl, const QString &plot,
10861086
const QString &title, const QString &subtitle,
10871087
const QString &director, int season, int episode,
1088-
const QString &inetref, int lenMins, const QString &year)
1088+
const QString &inetref, int lenMins, const QString &year,
1089+
const QString &id)
10891090
{
10901091
int res = -1;
10911092

@@ -1105,7 +1106,8 @@ static int internal_play_media(const QString &mrl, const QString &plot,
11051106

11061107
ProgramInfo *pginfo = new ProgramInfo(
11071108
mrl, plot, title, subtitle, director, season, episode,
1108-
inetref, lenMins, (year.toUInt()) ? year.toUInt() : 1900);
1109+
inetref, lenMins, (year.toUInt()) ? year.toUInt() : 1900,
1110+
id);
11091111

11101112
pginfo->SetProgramInfoType(pginfo->DiscoverProgramInfoType());
11111113

mythtv/programs/mythfrontend/videoplayercommand.cpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,11 @@ class VideoPlayHandleMedia : public VideoPlayProc
8080
VideoPlayHandleMedia(const QString &handler, const QString &mrl,
8181
const QString &plot, const QString &title, const QString &subtitle,
8282
const QString &director, int season, int episode, const QString &inetref,
83-
int length, const QString &year) :
83+
int length, const QString &year, const QString &id) :
8484
m_handler(handler), m_mrl(mrl), m_plot(plot), m_title(title),
8585
m_subtitle(subtitle), m_director(director), m_season(season),
86-
m_episode(episode), m_inetref(inetref), m_length(length), m_year(year)
86+
m_episode(episode), m_inetref(inetref), m_length(length), m_year(year),
87+
m_id(id)
8788
{
8889
}
8990

@@ -92,17 +93,17 @@ class VideoPlayHandleMedia : public VideoPlayProc
9293
const QString &mrl, const QString &plot, const QString &title,
9394
const QString &subtitle, const QString &director,
9495
int season, int episode, const QString &inetref,
95-
int length, const QString &year)
96+
int length, const QString &year, const QString &id)
9697
{
9798
return new VideoPlayHandleMedia(handler, mrl, plot, title, subtitle,
98-
director, season, episode, inetref, length, year);
99+
director, season, episode, inetref, length, year, id);
99100
}
100101

101102
bool Play() const
102103
{
103104
return GetMythMainWindow()->HandleMedia(m_handler, m_mrl,
104105
m_plot, m_title, m_subtitle, m_director, m_season,
105-
m_episode, m_inetref, m_length, m_year);
106+
m_episode, m_inetref, m_length, m_year, m_id);
106107
}
107108

108109
QString GetCommandDisplayName() const
@@ -127,6 +128,7 @@ class VideoPlayHandleMedia : public VideoPlayProc
127128
QString m_inetref;
128129
int m_length;
129130
QString m_year;
131+
QString m_id;
130132
};
131133

132134
////////////////////////////////////////////////////////////////////////
@@ -216,7 +218,8 @@ class VideoPlayerCommandPrivate
216218
item->GetTitle(), item->GetSubtitle(),
217219
item->GetDirector(), item->GetSeason(),
218220
item->GetEpisode(), item->GetInetRef(),
219-
item->GetLength(), QString::number(item->GetYear()));
221+
item->GetLength(), QString::number(item->GetYear()),
222+
QString::number(item->GetID()));
220223
}
221224
else
222225
{
@@ -244,7 +247,8 @@ class VideoPlayerCommandPrivate
244247
item->GetTitle(), item->GetSubtitle(),
245248
item->GetDirector(), item->GetSeason(),
246249
item->GetEpisode(), item->GetInetRef(),
247-
item->GetLength(), QString::number(item->GetYear()));
250+
item->GetLength(), QString::number(item->GetYear()),
251+
QString::number(item->GetID()));
248252
}
249253
else
250254
{
@@ -290,6 +294,7 @@ class VideoPlayerCommandPrivate
290294
QString inetref;
291295
int length = 0;
292296
QString year = QString::number(VIDEO_YEAR_DEFAULT);
297+
QString id;
293298

294299
if (extraData)
295300
{
@@ -302,10 +307,11 @@ class VideoPlayerCommandPrivate
302307
inetref = extraData->GetInetRef();
303308
length = extraData->GetLength();
304309
year = QString::number(extraData->GetYear());
310+
id = QString::number(extraData->GetID());
305311
}
306312

307313
AddPlayer(play_command, filename, plot, title, subtitle, director,
308-
season, episode, inetref, length, year);
314+
season, episode, inetref, length, year, id);
309315
}
310316

311317
void ClearPlayerList()
@@ -338,11 +344,11 @@ class VideoPlayerCommandPrivate
338344
void AddPlayer(const QString &player, const QString &filename,
339345
const QString &plot, const QString &title, const QString &subtitle,
340346
const QString &director, int season, int episode, const QString &inetref,
341-
int length, const QString &year)
347+
int length, const QString &year, const QString &id)
342348
{
343349
m_player_procs.push_back(VideoPlayHandleMedia::Create(player, filename,
344350
plot, title, subtitle, director, season, episode, inetref,
345-
length, year));
351+
length, year, id));
346352
m_player_procs.push_back(VideoPlayMythSystem::Create(player, filename));
347353
}
348354

mythtv/programs/mythpreviewgen/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ int preview_helper(uint chanid, QDateTime starttime,
122122
pginfo = new ProgramInfo(
123123
infile, ""/*plot*/, ""/*title*/, ""/*subtitle*/, ""/*director*/,
124124
0/*season*/, 0/*episode*/, ""/*inetref*/, 120/*length_in_minutes*/,
125-
1895/*year*/);
125+
1895/*year*/, ""/*id*/);
126126
}
127127
else
128128
{

0 commit comments

Comments
 (0)