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.go21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/helsinki.at/rhimport/importer.go b/src/helsinki.at/rhimport/importer.go
index 0fc5ecf..95f61f7 100644
--- a/src/helsinki.at/rhimport/importer.go
+++ b/src/helsinki.at/rhimport/importer.go
@@ -125,6 +125,21 @@ func (ctx *ImportContext) getPassword(cached bool) (err error) {
return
}
+func (ctx *ImportContext) getGroupOfCart() (err error) {
+ req := getGroupOfCartRequest{}
+ req.cart = ctx.Cart
+ req.response = make(chan getGroupOfCartResult)
+ ctx.RdDb.getGroupOfCartChan <- req
+
+ res := <-req.response
+ if res.err != nil {
+ err = res.err
+ return
+ }
+ ctx.GroupName = res.group
+ return
+}
+
func (ctx *ImportContext) getShowInfo() (err error) {
req := getShowInfoRequest{}
req.showid = ctx.ShowId
@@ -434,7 +449,7 @@ func ImportFile(ctx *ImportContext) (res *ImportResult, err error) {
return
} else if ctx.GroupName != "" {
res.ResponseCode = 500
- res.ErrorString = "Importing to music pools using the group name is not yet implemented"
+ res.ErrorString = "Importing to music pools is not yet implemented"
// TODO: fetch info from dropboxes (import-params)
// - add_cart(ctx, res) [200 -> OK]
// - add_cut(ctx, res) [200 -> OK]
@@ -443,7 +458,7 @@ func ImportFile(ctx *ImportContext) (res *ImportResult, err error) {
res.ResponseCode = 500
res.ErrorString = "Importing to a Cart which might not exist is not yet implemented"
// TODO: (everything except Cut, GroupName and ShowId must be in context)
- // - ctx.GetGroupOfCart(ctx.Cart)
+ // - ctx.getGroupOfCart(ctx.Cart)
// - remove_cart(ctx, res) [200 || 404 -> OK]
// - add_cart(ctx, res) [200 -> OK]
// - add_cut(ctx, res) [200 -> OK]
@@ -456,7 +471,7 @@ func ImportFile(ctx *ImportContext) (res *ImportResult, err error) {
res.Cut = ctx.Cut
} else {
res.ResponseCode = http.StatusBadRequest
- res.ErrorString = "The request doesn't contain enough Information to be processed"
+ res.ErrorString = "The request doesn't contain enough information to be processed"
}
rhdl.Printf("ImportResult: %+v\n", res)