fetching name

This commit is contained in:
Hazel Noack
2025-10-08 11:39:57 +02:00
parent 4a54048feb
commit 82b64fe642
5 changed files with 152 additions and 33 deletions

View File

@@ -25,7 +25,7 @@ type Plugin interface {
}
var namePlugins = map[string]Plugin{}
var nameSourceType = map[string]data.SourceType{}
var NameSourceType = map[string]data.SourceType{}
func RegisterPlugin(plugin Plugin) error {
name := plugin.Name()
@@ -34,7 +34,7 @@ func RegisterPlugin(plugin Plugin) error {
return errors.New("plugin " + name + " is already registered")
}
nameSourceType[name] = data.SourceType{
NameSourceType[name] = data.SourceType{
Name: name,
Regex: plugin.Regex(),
RegexArtist: plugin.RegexArtist(),
@@ -57,7 +57,7 @@ func compileSourceType(source data.Source) (data.Source, error) {
return source, nil
}
for _, st := range nameSourceType {
for _, st := range NameSourceType {
if m := st.Regex.FindString(source.Url); m != "" {
source.Url = m
source.SourceType = &st