Skip to content

Commit 53dc862

Browse files
tiger-seojaylinski
authored andcommitted
Support catchup-id attribute in programme element
1 parent 9906971 commit 53dc862

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

spec/XmlTv/XmlTvSpec.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function it_generates_an_xml_file()
3535
$channel->addUrl(new Tv\Elements\Url('http://foo.bar/'));
3636

3737
$programme = new Tv\Programme('test', '1', '2');
38+
$programme->catchupId = 'plugin://plugin.video.test/?catchup-id=foo';
3839
$programme->addTitle(new Tv\Elements\Title('title'));
3940
$programme->addSubTitle(new Tv\Elements\SubTitle('subtitle'));
4041
$programme->addDescription(new Tv\Elements\Desc('desc'));

spec/epg.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<icon src="http://foo.bar/img.png" width="200" height="200"/>
77
<url>http://foo.bar/</url>
88
</channel>
9-
<programme start="1" stop="2" channel="test">
9+
<programme channel="test" start="1" stop="2" catchup-id="plugin://plugin.video.test/?catchup-id=foo">
1010
<title>title</title>
1111
<sub-title>subtitle</sub-title>
1212
<desc>desc</desc>

src/Tv/Programme.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131

3232
class Programme implements XmlSerializable
3333
{
34+
/**
35+
* @var string
36+
*/
37+
public $channel;
38+
3439
/**
3540
* @var string
3641
*/
@@ -62,14 +67,15 @@ class Programme implements XmlSerializable
6267
public $videoplus;
6368

6469
/**
65-
* @var string
70+
* @var string Legal values are `0` or `1`.
6671
*/
67-
public $channel;
72+
public $clumpidx;
6873

6974
/**
70-
* @var string Legal values are `0` or `1`.
75+
* @var string A programme specific identifier for catchup URLs. Not part of the XMLTV specification.
76+
* @see https://github.com/kodi-pvr/pvr.iptvsimple/tree/7.0.0-Matrix#supported-m3u-and-xmltv-elements
7177
*/
72-
public $clumpidx;
78+
public $catchupId;
7379

7480
/**
7581
* @var Title[]
@@ -202,6 +208,7 @@ class Programme implements XmlSerializable
202208
* @param string $showview
203209
* @param string $videoplus
204210
* @param string $clumpidx
211+
* @param string $catchupId
205212
*/
206213
public function __construct(
207214
string $channel,
@@ -505,14 +512,15 @@ public function getReview(): array
505512
public function xmlSerialize(): XmlElement
506513
{
507514
return (new XmlElement('programme'))
515+
->withAttribute('channel', $this->channel)
508516
->withAttribute('start', $this->start)
509517
->withAttribute('stop', $this->stop)
510518
->withAttribute('pdc-start', $this->pdcStart)
511519
->withAttribute('vps-start', $this->vpsStart)
512520
->withAttribute('showview', $this->showview)
513521
->withAttribute('videoplus', $this->videoplus)
514-
->withAttribute('channel', $this->channel)
515522
->withAttribute('clumpidx', $this->clumpidx)
523+
->withAttribute('catchup-id', $this->catchupId)
516524
->withChildren($this->getTitle())
517525
->withChildren($this->getSubTitle())
518526
->withChildren($this->getDescription())

0 commit comments

Comments
 (0)