Fixing #231 (alternative preferred mimetypes)
This commit is contained in:
parent
f4b7741463
commit
302bc1cda6
1 changed files with 10 additions and 10 deletions
|
@ -168,16 +168,16 @@ func createSwitcher(switcher *PartSwitcher, conf *config.AercConfig,
|
||||||
if switcher.selected == -1 && pv.part.MIMEType != "multipart" {
|
if switcher.selected == -1 && pv.part.MIMEType != "multipart" {
|
||||||
switcher.selected = i
|
switcher.selected = i
|
||||||
}
|
}
|
||||||
if selectedPriority == -1 {
|
mime := strings.ToLower(pv.part.MIMEType) +
|
||||||
for idx, m := range conf.Viewer.Alternatives {
|
"/" + strings.ToLower(pv.part.MIMESubType)
|
||||||
if m != pv.part.MIMEType+"/"+pv.part.MIMESubType {
|
for idx, m := range conf.Viewer.Alternatives {
|
||||||
continue
|
if m != mime {
|
||||||
}
|
continue
|
||||||
priority := len(conf.Viewer.Alternatives) - idx
|
}
|
||||||
if priority > selectedPriority {
|
priority := len(conf.Viewer.Alternatives) - idx
|
||||||
selectedPriority = priority
|
if priority > selectedPriority {
|
||||||
switcher.selected = i
|
selectedPriority = priority
|
||||||
}
|
switcher.selected = i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue