Separated the repository initialization into a separate sub-command
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@ -14,6 +14,7 @@ type Repository struct {
|
||||
outputPath string
|
||||
}
|
||||
|
||||
// Repository struct constructor
|
||||
func NewRepository(path string) *Repository {
|
||||
r := new(Repository)
|
||||
r.basePath = path
|
||||
@ -21,13 +22,6 @@ func NewRepository(path string) *Repository {
|
||||
r.archivePath = filepath.Join(path, "archive")
|
||||
r.outputPath = filepath.Join(path, "output")
|
||||
|
||||
// make sure repository base directory exists
|
||||
create_repo_dir(r.basePath)
|
||||
// make sure the folder structure is setup
|
||||
create_repo_dir(r.ingestPath)
|
||||
create_repo_dir(r.archivePath)
|
||||
create_repo_dir(r.archivePath)
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
@ -39,6 +33,16 @@ func (r *Repository) GetOutputPath() string {
|
||||
return r.outputPath
|
||||
}
|
||||
|
||||
// Initializes the video repository by ensuring the directories are available
|
||||
func (r *Repository) Setup() {
|
||||
// make sure repository base directory exists
|
||||
create_repo_dir(r.basePath)
|
||||
// make sure the folder structure is setup
|
||||
create_repo_dir(r.ingestPath)
|
||||
create_repo_dir(r.archivePath)
|
||||
create_repo_dir(r.archivePath)
|
||||
}
|
||||
|
||||
func (r *Repository) SearchIngest() []os.FileInfo {
|
||||
log.Printf("Searching ingest directory for files to transcode...")
|
||||
|
||||
|
Reference in New Issue
Block a user