From 841d95d21c473455701b71f765f0d01fe6041f52 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Wed, 17 Apr 2024 18:48:53 +0200 Subject: [PATCH] Fix handling of AutoSubgroups in readDescriptionFile. We used to test AutoSubgroups before upgrading the description, which would break handling of the (obsolete) AllowSubgroups field. Thanks to David Saulpic. --- group/description.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/group/description.go b/group/description.go index 0d5a080..bfc3fec 100644 --- a/group/description.go +++ b/group/description.go @@ -441,6 +441,15 @@ func readDescription(name string, allowSubgroups bool) (*Description, error) { if err != nil { return nil, err } + err = upgradeDescription(&desc) + if err != nil { + return nil, err + } + + desc.FileName = fileName + desc.fileSize = fi.Size() + desc.modTime = fi.ModTime() + if isSubgroup { if !desc.AutoSubgroups { return nil, os.ErrNotExist @@ -450,15 +459,6 @@ func readDescription(name string, allowSubgroups bool) (*Description, error) { desc.Description = "" } - desc.FileName = fileName - desc.fileSize = fi.Size() - desc.modTime = fi.ModTime() - - err = upgradeDescription(&desc) - if err != nil { - return nil, err - } - return &desc, nil }