1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00
DanieL 2022-09-29 18:06:28 -03:00
parent 1bb86c36ee
commit 5652b5d982

View file

@ -1,4 +1,5 @@
<?php <?php
//header("Content-Type: application/rss+xml; charset=UTF8"); //header("Content-Type: application/rss+xml; charset=UTF8");
@ -36,11 +37,7 @@ if (!empty($_GET['channelName'])) {
$logo = User::getPhoto($user['id']); $logo = User::getPhoto($user['id']);
} }
if(empty($description)){ $cacheName = "feedCache" . md5(json_encode($_REQUEST));
$description = $title;
}
$cacheName = "feedCache".json_encode($_GET);
$rows = ObjectYPT::getCache($cacheName, 0); $rows = ObjectYPT::getCache($cacheName, 0);
if (empty($rows)) { if (empty($rows)) {
// send $_GET['catName'] to be able to filter by category // send $_GET['catName'] to be able to filter by category
@ -52,9 +49,16 @@ if (empty($rows)) {
$rows = Video::getAllVideos("viewable", $showOnlyLoggedUserVideos); $rows = Video::getAllVideos("viewable", $showOnlyLoggedUserVideos);
} else { } else {
unset($_POST['sort']); unset($_POST['sort']);
$videosArrayId = PlayList::getVideosIdFromPlaylist($_REQUEST['program_id']); $playlists_id = intval($_REQUEST['program_id']);
$pl = new PlayList($playlists_id);
$videosArrayId = PlayList::getVideosIdFromPlaylist($playlists_id);
$rows = Video::getAllVideos("viewable", false, true, $videosArrayId, false, true); $rows = Video::getAllVideos("viewable", false, true, $videosArrayId, false, true);
$rows = PlayList::sortVideos($rows, $videosArrayId); $rows = PlayList::sortVideos($rows, $videosArrayId);
$title = PlayLists::getNameOrSerieTitle($playlists_id);
$link = PlayLists::getLink($playlists_id);
$users_id = $pl->getUsers_id();
$author = User::getEmailDb($users_id);
$description = PlayLists::getDescriptionIfIsSerie($playlists_id);
//var_dump($videosArrayId);foreach ($rows as $value) {var_dump($value['id']);}exit; //var_dump($videosArrayId);foreach ($rows as $value) {var_dump($value['id']);}exit;
} }
$_POST['sort'] = $sort; $_POST['sort'] = $sort;
@ -62,6 +66,27 @@ if (empty($rows)) {
} else { } else {
$rows = object_to_array($rows); $rows = object_to_array($rows);
} }
if (!empty($_REQUEST['program_id'])) {
$playlists_id = intval($_REQUEST['program_id']);
$pl = new PlayList($playlists_id);
$videosArrayId = PlayList::getVideosIdFromPlaylist($playlists_id);
$title = PlayLists::getNameOrSerieTitle($playlists_id);
$link = PlayLists::getLink($playlists_id);
$users_id = $pl->getUsers_id();
$new_author = User::getEmailDb($users_id);
if(!empty($new_author)){
$author = $new_author;
}
$description = PlayLists::getDescriptionIfIsSerie($playlists_id);
//var_dump($videosArrayId);foreach ($rows as $value) {var_dump($value['id']);}exit;
}
if (empty($description)) {
$description = $title;
}
//var_dump($title, $cacheName, $_REQUEST);exit;
if (!empty($_REQUEST['roku'])) { if (!empty($_REQUEST['roku'])) {
include $global['systemRootPath'] . 'feed/roku.json.php'; include $global['systemRootPath'] . 'feed/roku.json.php';
} elseif (empty($_REQUEST['mrss'])) { } elseif (empty($_REQUEST['mrss'])) {