Nieuwsopener e.d. weergave gefixt

This commit is contained in:
2020-05-03 16:41:20 +02:00
parent 0507d363f0
commit a86f2e3fbe

View File

@@ -9,6 +9,7 @@ class Track extends Model {
public $artist;
public $duration;
public $ends;
public $isLayout;
public function __construct($data) {
parent::__construct($data);
@@ -22,6 +23,9 @@ class Track extends Model {
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;
}
}
@@ -39,14 +43,4 @@ class Track extends Model {
public function secondsRemaining() {
return ($this->ends) ? ($this->ends->getTimestamp() - time()) : -1;
}
public function display() {
foreach(self::$IDENTS as $ident => $display) {
if(substr($this->itemCode, 0, strlen($ident)) == $ident || substr($this->title, 0, strlen($ident)) == $ident) {
return $display;
}
}
return $this->artist . ($this->artist ? ' - ' : '') . $this->title;
}
}