Skip to content

Commit

Permalink
https://github.com/WWBN/AVideo/issues/9400
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Sep 13, 2024
1 parent 6c67522 commit 8d082a3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 3 additions & 3 deletions objects/functionsOpenGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function generateMetaTags($videoType, $modifiedDate, $createdDate, $title, $desc
$metaTags[] = "<meta property='og:type' content='{$ogType}' />";
if ($title) {
$title = getSEOTitle(html2plainText($title));
$metaTags[] = "<meta property='og:title' content='{$title}' />";
$metaTags[] = "<meta property='og:title' content='".addcslashes("'", $title)."' />";
$metaTags[] = "<meta name=\"twitter:title\" content=\"{$title}\"/>";
}
if ($description) {
Expand Down Expand Up @@ -342,8 +342,8 @@ function getOpenGraphLiveLink($liveLink_id)
$duration_in_seconds = 0;
$sourceFileURL = $liveLink->getLink();
$pageURL = LiveLinks::getLinkToLiveFromId($liveLink_id);
$pageURLEmbed = LiveLinks::getLinkToLiveFromId($liveLink_id, true);
$imgURL = LiveLinks::getImage($liveLink_id);
$pageURLEmbed = LiveLinks::getLinkToLiveFromId($liveLink_id, true);
$imgURL = LiveLinks::getImageDafaultOrDynamic($liveLink_id);
$imgPath = '';
$extraMetatags = array();
//var_dump(debug_backtrace());
Expand Down
12 changes: 12 additions & 0 deletions plugin/LiveLinks/LiveLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,18 @@ static function getAllActive($future = false, $activeOnly = true, $notStarted =
return $rows;
}

static function getImageDafaultOrDynamic($liveLink_id) {
global $global;
$relative = "videos/LiveLinks/img_{$liveLink_id}.png";
$filename = $global['systemRootPath'] . $relative ;
if(file_exists($filename)){
$imgURL = getURL($relative);
}else{
$imgURL = LiveLinks::getImage($liveLink_id);
}
return $imgURL;
}

static function getImage($id) {
global $global;
return "{$global['webSiteRootURL']}plugin/LiveLinks/getImage.php?id={$id}&format=jpg";
Expand Down

0 comments on commit 8d082a3

Please sign in to comment.