diff options
author | Christian Pointner <equinox@helsinki.at> | 2015-12-19 20:07:52 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2015-12-19 20:07:52 (GMT) |
commit | e56c01825d1c6366b743d7e4e3e10d6189c01c7a (patch) | |
tree | efbaa179ae11885bab5dd2c812fc16fdafcc4f50 /importer.go | |
parent | d1ea14e9be0891f7e19bdf5090a70aad9caa45ba (diff) |
tested music pool import, cleaned up help output for telnet interface
Diffstat (limited to 'importer.go')
-rw-r--r-- | importer.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/importer.go b/importer.go index afe422f..1404259 100644 --- a/importer.go +++ b/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 |