Fix newfilename calculation
This commit is contained in:
@@ -15,6 +15,10 @@ abstract class Catalog extends Model
|
||||
protected static $includeSubSecTime = FALSE;
|
||||
protected $dates = ['created'];
|
||||
|
||||
protected $casts = [
|
||||
'subsectime' => 'int',
|
||||
];
|
||||
|
||||
/**
|
||||
* People in Multimedia Object
|
||||
*
|
||||
@@ -220,10 +224,10 @@ abstract class Catalog extends Model
|
||||
// If the date created is not set, the file name will be based on the ID of the file.
|
||||
$file = sprintf('%s.%s',(is_null($this->created)
|
||||
? sprintf('UNKNOWN/%07s',$this->file_path_id())
|
||||
: $this->created->format('Y/m/d-His').((! is_null($this->subsectime)) ? sprintf('.%03d',$this->subsectime) : '' ).
|
||||
((! static::$includeSubSecTime OR ! is_null($this->subsectime)) ? '' : sprintf('-%05s',$this->id)).
|
||||
($this->ignore_duplicate ? sprintf('-%06d',$this->id) : '')
|
||||
),$this->type()
|
||||
: $this->created->format('Y/m/d-His').
|
||||
((! is_null($this->subsectime)) ? sprintf('_%03d',$this->subsectime) : '' ).
|
||||
sprintf('-%05s',$this->id))
|
||||
,$this->type()
|
||||
);
|
||||
|
||||
return (($short OR preg_match('/^\//',$file)) ? '' : config($this->type.'.dir').DIRECTORY_SEPARATOR).$file;
|
||||
|
Reference in New Issue
Block a user