|
@@ -686,7 +686,7 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
|
|
|
$thumb = $item['art'];
|
|
$thumb = $item['art'];
|
|
|
$key = $item['ratingKey'] . "-np";
|
|
$key = $item['ratingKey'] . "-np";
|
|
|
$elapsed = $item['viewOffset'];
|
|
$elapsed = $item['viewOffset'];
|
|
|
- $duration = $item['duration'];
|
|
|
|
|
|
|
+ $duration = ($item['duration']) ? $item['duration'] : $item->Media['duration'];
|
|
|
$watched = (!empty($elapsed) ? floor(($elapsed / $duration) * 100) : 0);
|
|
$watched = (!empty($elapsed) ? floor(($elapsed / $duration) * 100) : 0);
|
|
|
$transcoded = floor($item->TranscodeSession['progress']- $watched);
|
|
$transcoded = floor($item->TranscodeSession['progress']- $watched);
|
|
|
$stream = $item->Media->Part->Stream['decision'];
|
|
$stream = $item->Media->Part->Stream['decision'];
|
|
@@ -717,7 +717,7 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
|
|
|
$thumb = $item['art'];
|
|
$thumb = $item['art'];
|
|
|
$key = $item['ratingKey'] . "-np";
|
|
$key = $item['ratingKey'] . "-np";
|
|
|
$elapsed = $item['viewOffset'];
|
|
$elapsed = $item['viewOffset'];
|
|
|
- $duration = $item['duration'];
|
|
|
|
|
|
|
+ $duration = ($item['duration']) ? $item['duration'] : $item->Media['duration'];
|
|
|
$watched = (!empty($elapsed) ? floor(($elapsed / $duration) * 100) : 0);
|
|
$watched = (!empty($elapsed) ? floor(($elapsed / $duration) * 100) : 0);
|
|
|
$transcoded = floor($item->TranscodeSession['progress']- $watched);
|
|
$transcoded = floor($item->TranscodeSession['progress']- $watched);
|
|
|
$stream = $item->Media->Part->Stream['decision'];
|
|
$stream = $item->Media->Part->Stream['decision'];
|
|
@@ -753,7 +753,7 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
|
|
|
$useImage = (isset($item['live']) ? "images/livetv.png" : null);
|
|
$useImage = (isset($item['live']) ? "images/livetv.png" : null);
|
|
|
$extraInfo = isset($item['extraType']) ? "Trailer" : (isset($item['live']) ? "Live TV" : ":)");
|
|
$extraInfo = isset($item['extraType']) ? "Trailer" : (isset($item['live']) ? "Live TV" : ":)");
|
|
|
$elapsed = $item['viewOffset'];
|
|
$elapsed = $item['viewOffset'];
|
|
|
- $duration = $item['duration'];
|
|
|
|
|
|
|
+ $duration = ($item['duration']) ? $item['duration'] : $item->Media['duration'];
|
|
|
$watched = (!empty($elapsed) ? floor(($elapsed / $duration) * 100) : 0);
|
|
$watched = (!empty($elapsed) ? floor(($elapsed / $duration) * 100) : 0);
|
|
|
$transcoded = floor($item->TranscodeSession['progress']- $watched);
|
|
$transcoded = floor($item->TranscodeSession['progress']- $watched);
|
|
|
$stream = $item->Media->Part->Stream['decision'];
|
|
$stream = $item->Media->Part->Stream['decision'];
|
|
@@ -789,7 +789,7 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
|
|
|
$thumb = $item['art'];
|
|
$thumb = $item['art'];
|
|
|
$key = $item['ratingKey'] . "-np";
|
|
$key = $item['ratingKey'] . "-np";
|
|
|
$elapsed = $item['viewOffset'];
|
|
$elapsed = $item['viewOffset'];
|
|
|
- $duration = $item['duration'];
|
|
|
|
|
|
|
+ $duration = ($item['duration']) ? $item['duration'] : $item->Media['duration'];
|
|
|
$watched = (!empty($elapsed) ? floor(($elapsed / $duration) * 100) : 0);
|
|
$watched = (!empty($elapsed) ? floor(($elapsed / $duration) * 100) : 0);
|
|
|
$transcoded = floor($item->TranscodeSession['progress']- $watched);
|
|
$transcoded = floor($item->TranscodeSession['progress']- $watched);
|
|
|
$stream = $item->Media->Part->Stream['decision'];
|
|
$stream = $item->Media->Part->Stream['decision'];
|
|
@@ -822,7 +822,7 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
|
|
|
$thumb = $item['art'];
|
|
$thumb = $item['art'];
|
|
|
$key = $item['ratingKey'] . "-np";
|
|
$key = $item['ratingKey'] . "-np";
|
|
|
$elapsed = $item['viewOffset'];
|
|
$elapsed = $item['viewOffset'];
|
|
|
- $duration = $item['duration'];
|
|
|
|
|
|
|
+ $duration = ($item['duration']) ? $item['duration'] : $item->Media['duration'];
|
|
|
$watched = (!empty($elapsed) ? floor(($elapsed / $duration) * 100) : 0);
|
|
$watched = (!empty($elapsed) ? floor(($elapsed / $duration) * 100) : 0);
|
|
|
$transcoded = floor($item->TranscodeSession['progress']- $watched);
|
|
$transcoded = floor($item->TranscodeSession['progress']- $watched);
|
|
|
$stream = $item->Media->Part->Stream['decision'];
|
|
$stream = $item->Media->Part->Stream['decision'];
|
|
@@ -2909,7 +2909,7 @@ function getHeadphonesCalendar($url, $key, $list){
|
|
|
$i++;
|
|
$i++;
|
|
|
$albumName = addslashes($child['AlbumTitle']);
|
|
$albumName = addslashes($child['AlbumTitle']);
|
|
|
$albumArtist = htmlentities($child['ArtistName'], ENT_QUOTES);
|
|
$albumArtist = htmlentities($child['ArtistName'], ENT_QUOTES);
|
|
|
- $albumDate = $child['ReleaseDate'];
|
|
|
|
|
|
|
+ $albumDate = (strlen($child['ReleaseDate']) > 4) ? $child['ReleaseDate'] : $child['ReleaseDate']."-01-01";
|
|
|
$albumID = $child['AlbumID'];
|
|
$albumID = $child['AlbumID'];
|
|
|
$albumDate = strtotime($albumDate);
|
|
$albumDate = strtotime($albumDate);
|
|
|
$albumDate = date("Y-m-d", $albumDate);
|
|
$albumDate = date("Y-m-d", $albumDate);
|