summaryrefslogtreecommitdiff
path: root/indexers/pikdex/hydrate.go
blob: 967ce997e83c1b7ae6b502ddcae3fd1d529c586d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package pikdex

import (
	"git.ewy.one/pik/model"
	"strings"
)

func (u *pikdex) Mod(src *model.Source, result *model.HydratedSource) error {
	mod := u.mods[strings.TrimSuffix(src.Path, "/")]
	if mod.Path != "" {
		if mod.Aliases != nil {
			result.Aliases = append(result.Aliases, mod.Aliases...)
		}
		if mod.Icon != "" {
			result.Icon = mod.Icon
		}
	}
	return nil
}