summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimport/importer.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/helsinki.at/rhimport/importer.go')
-rw-r--r--src/helsinki.at/rhimport/importer.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/helsinki.at/rhimport/importer.go b/src/helsinki.at/rhimport/importer.go
index afe422f..1404259 100644
--- a/src/helsinki.at/rhimport/importer.go
+++ b/src/helsinki.at/rhimport/importer.go
@@ -106,6 +106,9 @@ func (ctx *ImportContext) SanityCheck() error {
if !ismusic {
return fmt.Errorf("supplied GroupName is not a music pool")
}
+ if ctx.Cart != 0 || ctx.Cut != 0 {
+ return fmt.Errorf("Cart and Cut must not be supplied when importing into a music group")
+ }
return nil
}
if ctx.Cart == 0 {
@@ -193,6 +196,8 @@ func (ctx *ImportContext) getMusicInfo() (err error) {
ctx.AutotrimLevel = res.trim_lvl
ctx.Channels = 2
ctx.UseMetaData = true
+ ctx.Cart = 0
+ ctx.Cut = 0
return
}
@@ -624,7 +629,7 @@ func ImportFile(ctx *ImportContext) (res *ImportResult, err error) {
if err = ctx.getMusicInfo(); err != nil {
return
}
- if err = remove_add_cart_cut(ctx, res); err != nil || res.ResponseCode != http.StatusOK {
+ if err = add_cart_cut(ctx, res); err != nil || res.ResponseCode != http.StatusOK {
return
}
rmCartOnErr = true