Test version
This commit is contained in:
46
srv/api/common/classes/Track.php.orig
Normal file
46
srv/api/common/classes/Track.php.orig
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Model;
|
||||
|
||||
class Track extends Model {
|
||||
public $start;
|
||||
public $itemCode;
|
||||
public $title;
|
||||
public $artist;
|
||||
public $duration;
|
||||
public $ends;
|
||||
public $isLayout;
|
||||
|
||||
public function __construct($data) {
|
||||
parent::__construct($data);
|
||||
parent::ConvertToDateTime($this->start);
|
||||
parent::ConvertToDateTime($this->ends);
|
||||
}
|
||||
|
||||
private static $IDENTS = ['UURSLUITER' => 'Nieuws', 'V0601 ' => 'Nieuws', 'ANWB' => 'Verkeersinformatie', 'REGIO' => 'Regionieuws', 'WEERBED' => 'Weerbericht', 'CB' => 'Reclame'];
|
||||
|
||||
public function isLayout() {
|
||||
if(strlen($this->itemCode) > 0 && ($this->itemCode[0] == 'V')) {
|
||||
foreach(self::$IDENTS as $ident => $display) {
|
||||
if(substr($this->itemCode, 0, strlen($ident)) == $ident || substr($this->title, 0, strlen($ident)) == $ident) {
|
||||
$this->title = $display;
|
||||
$this->artist = "";
|
||||
$this->itemCode = '_' . $this->itemCode;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function ends($ends = null) {
|
||||
$this->ends = $ends;
|
||||
}
|
||||
|
||||
public function secondsRemaining() {
|
||||
return ($this->ends) ? ($this->ends->getTimestamp() - time()) : -1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user