diff --git a/scanner/scanner.go b/scanner/scanner.go index 1477acc..e6dbc7d 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -244,6 +244,13 @@ func decoded(in string) string { // ## begin handlers func (s *Scanner) handleFolder(it *item) error { + if s.trTxOpen { + // a transaction still being open when we handle a folder can + // happen if there is a folder that contains /both/ tracks and + // sub folders + s.trTx.Commit() + s.trTxOpen = false + } folder := &model.Album{} defer func() { // folder's id will come from early return