From 1548701ed3116282cba4613440d1317bb527e52a Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Wed, 31 Aug 2022 22:50:42 -0400 Subject: [PATCH] Added ingest file cleanup --- adept.go | 2 +- transcoder/repository.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/adept.go b/adept.go index 9a35a51..6ea06a0 100644 --- a/adept.go +++ b/adept.go @@ -19,6 +19,6 @@ func main() { // transcode file // TODO - t.Transcode(i.Name()) // clean up source file - // TODO - r.CleanupFile(i.Name()) + r.CleanupFile(i.Name()) } } diff --git a/transcoder/repository.go b/transcoder/repository.go index 9c816db..aefe0f4 100644 --- a/transcoder/repository.go +++ b/transcoder/repository.go @@ -76,6 +76,14 @@ func (r *Repository) ArchiveFile(inFile string) { } } +func (r *Repository) CleanupFile(inFile string) { + // create ingest path + ingestPath := filepath.Join(r.basePath, "ingest", inFile) + + // remove the file + os.Remove(ingestPath) +} + func create_repo_dir(path string) { _, err := os.Stat(path) if os.IsNotExist(err) {