summaryrefslogtreecommitdiff
path: root/src/rhimportd
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-07-13 21:50:05 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-07-13 21:50:05 (GMT)
commit8816d31e40ad06f2c634574cf6afbbef11ddbb95 (patch)
tree023f7f976d1df343c04321c48af0018a3701842e /src/rhimportd
parentb828b53ef47cbe22c5e1f8bbe7aaeff51850ea76 (diff)
added normalization step
Diffstat (limited to 'src/rhimportd')
-rw-r--r--src/rhimportd/ctrlTelnet.go10
-rw-r--r--src/rhimportd/ctrlWatchDir.go5
-rw-r--r--src/rhimportd/ctrlWebSimple.go5
3 files changed, 19 insertions, 1 deletions
diff --git a/src/rhimportd/ctrlTelnet.go b/src/rhimportd/ctrlTelnet.go
index fa0ce65..4177128 100644
--- a/src/rhimportd/ctrlTelnet.go
+++ b/src/rhimportd/ctrlTelnet.go
@@ -59,7 +59,8 @@ func telnetHelp(c *telgo.Client, args []string, conf *rhimport.Config, db *rddb.
c.Sayln(" Password string password to use for rdxport interface")
c.Sayln(" SourceUri string uri to the file to import")
c.Sayln(" SourceFilePolicy enum one of: auto, keep, delete, delete-with-dir")
- c.Sayln(" FetchConverter string fetch converter to use (one of null, ffmpeg)")
+ c.Sayln(" FetchConverter string fetch converter to use")
+ c.Sayln(" (one of: null, ffmpeg, bs1770, ffmpeg-bs1770)")
c.Sayln(" ShowId uint the RHRD show id to import to")
c.Sayln(" ClearShowCarts bool clear all show-carts before importing?")
c.Sayln(" GroupName string name of music-pool group to import to")
@@ -294,6 +295,13 @@ func telnetRun(c *telgo.Client, args []string, conf *rhimport.Config, db *rddb.D
}
c.Sayln("")
+ c.Sayln("normalizing file '%s'", ctx.SourceFile)
+ if err := rhimport.NormalizeFile(ctx); err != nil {
+ c.Sayln("normalize file error: %s", err)
+ return false
+ }
+
+ c.Sayln("")
c.Sayln("importing file '%s'", ctx.SourceFile)
if res, err := rhimport.ImportFile(ctx); err != nil {
c.Sayln("")
diff --git a/src/rhimportd/ctrlWatchDir.go b/src/rhimportd/ctrlWatchDir.go
index 6985a74..7b185c0 100644
--- a/src/rhimportd/ctrlWatchDir.go
+++ b/src/rhimportd/ctrlWatchDir.go
@@ -149,6 +149,11 @@ func watchDirHandler(conf *rhimport.Config, db *rddb.DBChan, ctx *rhimport.Conte
return
}
+ if err = rhimport.NormalizeFile(ctx); err != nil {
+ watchDirErrorResponse(filename, http.StatusInternalServerError, err.Error(), "")
+ return
+ }
+
if res, err = rhimport.ImportFile(ctx); err != nil {
watchDirErrorResponse(filename, http.StatusInternalServerError, err.Error(), res.SourceFile)
return
diff --git a/src/rhimportd/ctrlWebSimple.go b/src/rhimportd/ctrlWebSimple.go
index 05bbb4d..e690571 100644
--- a/src/rhimportd/ctrlWebSimple.go
+++ b/src/rhimportd/ctrlWebSimple.go
@@ -147,6 +147,11 @@ func webSimpleHandler(conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport
return
}
+ if err = rhimport.NormalizeFile(ctx); err != nil {
+ webSimpleErrorResponse(w, http.StatusInternalServerError, err.Error())
+ return
+ }
+
if res, err = rhimport.ImportFile(ctx); err != nil {
webSimpleErrorResponse(w, http.StatusInternalServerError, err.Error())
return