Commit 841d95d2 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

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.
parent 19dfccc3
...@@ -441,6 +441,15 @@ func readDescription(name string, allowSubgroups bool) (*Description, error) { ...@@ -441,6 +441,15 @@ func readDescription(name string, allowSubgroups bool) (*Description, error) {
if err != nil { if err != nil {
return nil, err 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 isSubgroup {
if !desc.AutoSubgroups { if !desc.AutoSubgroups {
return nil, os.ErrNotExist return nil, os.ErrNotExist
...@@ -450,15 +459,6 @@ func readDescription(name string, allowSubgroups bool) (*Description, error) { ...@@ -450,15 +459,6 @@ func readDescription(name string, allowSubgroups bool) (*Description, error) {
desc.Description = "" 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 return &desc, nil
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment