Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Feb 6, 2025
1 parent 853f6a5 commit ac87664
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions plugin/Live/Objects/LiveTransmitionHistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -670,18 +670,24 @@ public static function getLatestFromUser($users_id)
return @$rows[0];
}

public static function getLatestFromKey($key)
public static function getLatestFromKey($key, $strict = false)
{
global $global, $_getLatestFromKey;
if (!self::isTableInstalled(static::getTableName())) {
_error_log("Save error, table " . static::getTableName() . " does not exists", AVideoLog::$ERROR);
return false;
}
$parts = Live::getLiveParametersFromKey($key);
$key = $parts['cleanKey'];

$sql = "SELECT * FROM " . static::getTableName() . " WHERE `key` LIKE '{$key}%' ";

if(!$strict){
$parts = Live::getLiveParametersFromKey($key);
$key = $parts['cleanKey'];
$sql .= " `key` LIKE '{$key}%' ";
}else{
$sql .= " `key` = '{$key}' ";
}

$sql .= " ORDER BY modified DESC, id DESC LIMIT 1";

$_getLatestFromKey = $sql;
Expand Down

0 comments on commit ac87664

Please sign in to comment.