diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-07-08 16:50:30 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-07-08 16:50:30 (GMT) |
commit | 003d2444a73f05f8ef52174298affa190264f003 (patch) | |
tree | c7a27ac944f4478b222763a3ec51905fabd753a6 | |
parent | 0081fe77852f60185a725ad13f0df5f207d47b65 (diff) |
fixe cut/cart title update if groupname is unknown
-rw-r--r-- | rddb/rddb.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rddb/rddb.go b/rddb/rddb.go index 6c59578..45555f8 100644 --- a/rddb/rddb.go +++ b/rddb/rddb.go @@ -650,6 +650,15 @@ func (db *DB) updateCutCartTitle(cart, cut uint, groupName, sourceFile string) ( ext := strings.TrimLeft(filepath.Ext(filename), ".") filename = strings.TrimRight(strings.TrimSuffix(filename, ext), ".") + if groupName == "" { + res := db.getGroupOfCart(cart) + if res.err != nil { + result.err = res.err + return + } + groupName = res.group + } + groupDefaultTitle := "" result.err = db.getGroupDefaultTitleStmt.QueryRow(groupName).Scan(&groupDefaultTitle) if result.err != nil { |