Version 5.0.0 beta 7

This commit is contained in:
Neo committed 2025-12-19 17:18:38 -08:00
1 parent fa2a720105
commit 54d5dcd0a0
156 files changed
+4337 -2995

No files matched your search

@@ -1259,27 +1259,12 @@ class view extends Controller
}
catch ( Exception $e ) { }
}
/**
* We only need to generate a new thumbnail if we are using watermarking.
* If we are not, then we can simply use the previous thumbnail, if this existed previously, rather than generating a new one every time we upload a new version, which is unnecessary extra processing as well as disk usage.
* If we are, then it is impossible to know if the watermark has since changed, so we need to go ahead and do it anyway.
*/
$existing = NULL;
if ( $watermarked !== TRUE )
{
try
{
$existing = Db::i()->select( '*', 'downloads_files_records', array( "record_location=? AND record_file_id=?", (string) $file, $this->file->id ), NULL, NULL, NULL, NULL, Db::SELECT_FROM_WRITE_SERVER )->first();
}
catch( UnderflowException $e ) {}
}
Db::i()->insert( 'downloads_files_records', array(
'record_file_id' => $this->file->id,
'record_type' => 'ssupload',
'record_location' => (string) $file,
'record_thumb' => ( $watermarked OR !$existing ) ? (string) $file->thumbnail( 'downloads_Screenshots' ) : $existing['record_thumb'],
'record_thumb' => (string) $file->thumbnail( 'downloads_Screenshots' ),
'record_realname' => $file->originalFilename,
'record_size' => $file->filesize(),
'record_time' => time(),