Skip to content

Commit

Permalink
https://github.com/WWBN/AVideo/issues/9131
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Jun 14, 2024
1 parent 05f1858 commit 530e596
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 1 addition & 3 deletions plugin/Cache/Objects/CacheDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ public static function encodeContent($content)
public static function deleteCacheStartingWith($name, $schedule=true)
{
if($schedule){
$newSchedule = new Cache_schedule_delete(0);
$newSchedule->setName($name);
return $newSchedule->save();
return Cache_schedule_delete::insert($name);
}else{
try {
if(self::$cacheType == self::$CACHE_ON_MEMORY){
Expand Down
10 changes: 10 additions & 0 deletions plugin/Cache/Objects/Cache_schedule_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,15 @@ function getName() {
return $this->name;
}

public static function insert($name) {
$sql = "INSERT IGNORE INTO cache_schedule_delete (name) VALUES (?)";
$res = sqlDAL::writeSql($sql, "s", [$name]);
if ($res) {
return true;
} else {
error_log("ObjectYPT::insert::Error on save: " . $sql . " Error : " . json_encode($res));
return false;
}
}

}

0 comments on commit 530e596

Please sign in to comment.