Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

@@ -44,28 +44,44 @@ class _Screenshots
*/
public function move( $offset, $storageConfiguration, $oldConfiguration=NULL )
{
$record = \IPS\Db::i()->select( '*', 'downloads_files_records', array( 'record_type=?', 'ssupload' ), 'record_id', array( $offset, 1 ) )->first();
$record = \IPS\Db::i()->select( '*', 'downloads_files_records', array( 'record_type=?', 'ssupload' ), 'record_id', array( $offset, 1 ) )->first();
$updates = array();
try
{
$file = \IPS\File::get( $oldConfiguration ?: 'downloads_Screenshots', $record['record_location'] )->move( $storageConfiguration );
if ( (string) $file != $record['record_location'] )
{
\IPS\Db::i()->update( 'downloads_files_records', array( 'record_location' => (string) $file ), array( 'record_id=?', $record['record_id'] ) );
$updates['record_location'] = (string) $file;
}
$file = \IPS\File::get( $oldConfiguration ?: 'downloads_Screenshots', $record['record_thumb'] )->move( $storageConfiguration );
if ( (string) $file != $record['record_thumb'] )
{
\IPS\Db::i()->update( 'downloads_files_records', array( 'record_thumb' => (string) $file ), array( 'record_id=?', $record['record_id'] ) );
$updates['record_thumb'] = (string) $file;
}
if( $record['record_no_watermark'] )
{
$file = \IPS\File::get( $oldConfiguration ?: 'downloads_Screenshots', $record['record_no_watermark'] )->move( $storageConfiguration );
if ( (string) $file != $record['record_no_watermark'] )
{
$updates['record_no_watermark'] = (string) $file;
}
}
}
catch( \Exception $e )
{
/* Any issues are logged */
}
if( \count( $updates ) )
{
\IPS\Db::i()->update( 'downloads_files_records', $updates, array( 'record_id=?', $record['record_id'] ) );
}
}
/**
@@ -87,6 +103,11 @@ class _Screenshots
{
\IPS\Db::i()->update( 'downloads_files_records', array( 'record_thumb' => $new ), array( 'record_id=?', $record['record_id'] ) );
}
if ( $record['record_no_watermark'] and $new = \IPS\File::repairUrl( $record['record_no_watermark'] ) )
{
\IPS\Db::i()->update( 'downloads_files_records', array( 'record_no_watermark' => $new ), array( 'record_id=?', $record['record_id'] ) );
}
}
/**
@@ -99,7 +120,8 @@ class _Screenshots
{
try
{
$record = \IPS\Db::i()->select( '*', 'downloads_files_records', array( '( record_location=? OR record_thumb=? ) AND record_type=?', (string) $file, (string) $file, 'ssupload' ) )->first();
$fileName = (string) $file;
$record = \IPS\Db::i()->select( '*', 'downloads_files_records', array( '( record_location=? OR record_thumb=? OR record_no_watermark=? ) AND record_type=?', $fileName, $fileName, $fileName, 'ssupload' ) )->first();
return TRUE;
}
@@ -35,7 +35,7 @@ class _Downloads
return array (
'exclude' => array(),
'lessIsMore' => array( 'idm_wait_period' ),
'neg1IsBest' => array(),
'neg1IsBest' => array( 'idm_max_size' ),
'zeroIsBest' => array( 'idm_throttling' ),
'callback' => array( 'idm_restrictions' => function( $a, $b, $k )
{
@@ -88,6 +88,7 @@ class _Files
public static function parse_mobile_new_file_version( \IPS\Lang $language, \IPS\downloads\File $file )
{
return array(
'title' => $language->addToStack( 'notification__new_file_version_title' ),
'body' => $language->addToStack( 'notification__new_file_version', FALSE, array( 'htmlsprintf' => array(
$file->author()->name,
$file->mapped('title')
@@ -71,7 +71,7 @@ class _RebuildScreenshotWatermarks
* @return int New offset
* @throws \IPS\Task\Queue\OutOfRangeException Indicates offset doesn't exist and thus task is complete
*/
public function run( $data, $offset )
public function run( &$data, $offset )
{
$last = NULL;
$watermark = \IPS\Settings::i()->idm_watermarkpath ? \IPS\Image::create( \IPS\File::get( 'core_Theme', \IPS\Settings::i()->idm_watermarkpath )->contents() ) : NULL;