refactoring-1
introduced pipelines and abstracted download process.go in Downloader interface
This commit is contained in:
26
server/internal/downloaders/downloader.go
Normal file
26
server/internal/downloaders/downloader.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package downloaders
|
||||
|
||||
import (
|
||||
"github.com/marcopiovanello/yt-dlp-web-ui/v3/server/common"
|
||||
"github.com/marcopiovanello/yt-dlp-web-ui/v3/server/internal"
|
||||
)
|
||||
|
||||
type Downloader interface {
|
||||
Start() error
|
||||
Stop() error
|
||||
Status() *internal.ProcessSnapshot
|
||||
|
||||
SetOutput(output internal.DownloadOutput)
|
||||
SetProgress(progress internal.DownloadProgress)
|
||||
SetMetadata(fetcher func(url string) (*common.DownloadMetadata, error))
|
||||
SetPending(p bool)
|
||||
|
||||
IsCompleted() bool
|
||||
|
||||
UpdateSavedFilePath(path string)
|
||||
|
||||
RestoreFromSnapshot(*internal.ProcessSnapshot) error
|
||||
|
||||
GetId() string
|
||||
GetUrl() string
|
||||
}
|
||||
Reference in New Issue
Block a user