Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ the address is defined in config file`,
bootstrap.InitOfflineDownloadTools()
bootstrap.LoadStorages()
bootstrap.InitTaskManager()
fs.StartChunkUploadReaper()
if !flags.Debug && !flags.Dev {
gin.SetMode(gin.ReleaseMode)
}
Expand Down
9 changes: 9 additions & 0 deletions drivers/local/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ type Local struct {
useFFmpeg bool
}

const maxLocalUploadChunkSizeMB int64 = 4096

func (d *Local) Config() driver.Config {
return config
}
Expand All @@ -71,6 +73,13 @@ func (d *Local) Init(ctx context.Context) error {
}
d.Addition.RootFolderPath = abs
}
if d.UploadChunkSizeMB < 0 || d.UploadChunkSizeMB > maxLocalUploadChunkSizeMB {
return fmt.Errorf(
"invalid upload_chunk_size_mb value: %d, must be between 0 and %d",
d.UploadChunkSizeMB,
maxLocalUploadChunkSizeMB,
)
}

d.useFFmpeg = d.UseFFmpeg

Expand Down
19 changes: 10 additions & 9 deletions drivers/local/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ import (

type Addition struct {
driver.RootPath
Thumbnail bool `json:"thumbnail" required:"true" help:"enable thumbnail"`
UseFFmpeg bool `json:"use_ffmpeg" required:"true" help:"use ffmpeg to generate thumbnail"`
ThumbCacheFolder string `json:"thumb_cache_folder"`
ThumbConcurrency string `json:"thumb_concurrency" default:"16" required:"false" help:"Number of concurrent thumbnail generation goroutines. This controls how many thumbnails can be generated in parallel."`
ThumbPixel string `json:"thumb_pixel" default:"320" required:"false" help:"Specifies the target width for image thumbnails in pixels. The height of the thumbnail will be calculated automatically to maintain the original aspect ratio of the image."`
VideoThumbPos string `json:"video_thumb_pos" default:"20%" required:"false" help:"The position of the video thumbnail. If the value is a number (integer ot floating point), it represents the time in seconds. If the value ends with '%', it represents the percentage of the video duration."`
ShowHidden bool `json:"show_hidden" default:"true" required:"false" help:"show hidden directories and files"`
MkdirPerm string `json:"mkdir_perm" default:"777"`
RecycleBinPath string `json:"recycle_bin_path" default:"delete permanently" help:"path to recycle bin, delete permanently if empty or keep 'delete permanently'"`
UploadChunkSizeMB int64 `json:"upload_chunk_size_mb" type:"number" default:"0" required:"false" help:"chunk size in MB for web uploads, range 0-4096, 0 disables chunk upload"`
Thumbnail bool `json:"thumbnail" required:"true" help:"enable thumbnail"`
UseFFmpeg bool `json:"use_ffmpeg" required:"true" help:"use ffmpeg to generate thumbnail"`
ThumbCacheFolder string `json:"thumb_cache_folder"`
ThumbConcurrency string `json:"thumb_concurrency" default:"16" required:"false" help:"Number of concurrent thumbnail generation goroutines. This controls how many thumbnails can be generated in parallel."`
ThumbPixel string `json:"thumb_pixel" default:"320" required:"false" help:"Specifies the target width for image thumbnails in pixels. The height of the thumbnail will be calculated automatically to maintain the original aspect ratio of the image."`
VideoThumbPos string `json:"video_thumb_pos" default:"20%" required:"false" help:"The position of the video thumbnail. If the value is a number (integer ot floating point), it represents the time in seconds. If the value ends with '%', it represents the percentage of the video duration."`
ShowHidden bool `json:"show_hidden" default:"true" required:"false" help:"show hidden directories and files"`
MkdirPerm string `json:"mkdir_perm" default:"777"`
RecycleBinPath string `json:"recycle_bin_path" default:"delete permanently" help:"path to recycle bin, delete permanently if empty or keep 'delete permanently'"`
}

var config = driver.Config{
Expand Down
Loading