Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Mar 20, 2024
1 parent 6bbcef2 commit 6388091
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 24 deletions.
14 changes: 13 additions & 1 deletion objects/video.php
Original file line number Diff line number Diff line change
Expand Up @@ -5651,7 +5651,19 @@ public static function getVideoTypeFromId($videos_id)
if (empty($video['filename'])) {
return false;
}
return self::getVideoType($video['filename']);

$cacheSuffix = "getVideoTypeFromId";
$videoCache = new VideoCacheHandler($video['filename']);
$cache = $videoCache->getCache($cacheSuffix, 0);
if(!empty($cache)){
return _json_decode($cache);
}

$response = self::getVideoType($video['filename']);
$videoCache->setCache($response);

return $response;

}

public static function getVideoType($filename)
Expand Down
41 changes: 18 additions & 23 deletions plugin/AVideoPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public static function loadPluginIfEnabled($name)
if (!isset($_loadPluginIfEnabled)) {
$_loadPluginIfEnabled = array();
}

/**
* @var array $global
*/
Expand Down Expand Up @@ -520,10 +520,10 @@ public static function setObjectData($name, $object)
public static function setParameter($name, $parameterName, $parameterValue = null)
{
$obj = AVideoPlugin::getObjectData($name);
if (!isset($parameterValue)) {
if(!isset($parameterValue)){
unset($obj->{$parameterName});
return false;
} else {
}else{
$obj->{$parameterName} = $parameterValue;
return true;
}
Expand Down Expand Up @@ -666,18 +666,13 @@ public static function getNetflixActionButton($videos_id)
$plugins = Plugin::getAllEnabled();
$str = "";
foreach ($plugins as $value) {
$timeLog6Limit = 0.3;
$timeLog6 = "getNetflixActionButton {$videos_id} {$value['dirName']}";
TimeLogStart($timeLog6);
self::YPTstart();
$p = static::loadPlugin($value['dirName']);
TimeLogEnd($timeLog6, __LINE__, $timeLog6Limit);

if (is_object($p)) {
$str .= $p->getNetflixActionButton($videos_id);
}
TimeLogEnd($timeLog6, __LINE__, $timeLog6Limit);
self::YPTend("{$value['dirName']}::" . __FUNCTION__, 0.1);
TimeLogEnd($timeLog6, __LINE__, $timeLog6Limit);
self::YPTend("{$value['dirName']}::" . __FUNCTION__, 0.2);
}
return $str;
}
Expand All @@ -700,7 +695,7 @@ public static function getGalleryActionButton($videos_id)

public static function isEnabled($uuid)
{
if (!class_exists('Plugin')) {
if(!class_exists('Plugin')){
return false;
}
return !empty(Plugin::getEnabled($uuid));
Expand Down Expand Up @@ -779,7 +774,7 @@ public static function getStart()
//echo $value['dirName'].PHP_EOL;
//_error_log('AVideoPlugin::getStart: '.$value['dirName']);
$p->getStart();
} //var_dump("----- nada ",$_REQUEST['live_index'], __LINE__, "-----");exit;
}//var_dump("----- nada ",$_REQUEST['live_index'], __LINE__, "-----");exit;
//self::YPTend("{$value['dirName']}::".__FUNCTION__);
}
}
Expand Down Expand Up @@ -1872,10 +1867,10 @@ public static function getVideoTags($videos_id)
if (isset($_getVideoTags[$videos_id])) {
$array = $_getVideoTags[$videos_id];
} else {

$cacheSuffix = 'getVideoTags';
$cacheSuffix = 'getVideoTags';
$videoCache = new VideoCacheHandler('', $videos_id);
$array = $videoCache->getCache($cacheSuffix, rand(86400, 864000));
$array = $videoCache->getCache($cacheSuffix,rand(86400, 864000));

//$name = "getVideoTags{$videos_id}";
//$array = ObjectYPT::getCache($name, 86400);
Expand All @@ -1896,7 +1891,7 @@ public static function getVideoTags($videos_id)
TimeLogEnd($TimeLog, __LINE__, $tolerance);
}
TimeLogEnd("AVideoPlugin::getVideoTags($videos_id)", __LINE__, $tolerance * 2);

$videoCache->setCache($array);
//ObjectYPT::setCache($name, $array);
$_getVideoTags[$videos_id] = $array;
Expand Down Expand Up @@ -2874,18 +2869,18 @@ public static function onVideoSetRrating($video_id, $oldValue, $newValue)
]
* @return $file
*/
public static function modifyURL($file, $videos_id = 0)
public static function modifyURL($file, $videos_id=0)
{
global $global;
if (empty($global)) {
$global = [];
}
$plugins = Plugin::getAllEnabled();
if (empty($videos_id)) {
if(empty($videos_id)){
$videos_id = 0;
if (!empty($file['filename'])) {
if(!empty($file['filename'])){
$videos_id = getVideos_IdFromFilename($file['filename']);
} else {
}else{
$videos_id = getVideos_id();
}
}
Expand Down Expand Up @@ -3057,8 +3052,8 @@ public static function fixName($name)
}
return $name;
}


public static function executeEveryMinute()
{
$plugins = Plugin::getAllEnabled();
Expand Down Expand Up @@ -3098,7 +3093,7 @@ public static function executeEveryDay()
self::YPTend("{$value['dirName']}::" . __FUNCTION__);
}
}

public static function executeEveryMonth()
{
$plugins = Plugin::getAllEnabled();
Expand Down

0 comments on commit 6388091

Please sign in to comment.