From b5a78eb5b9ce6adddd21dc42408a0b2090a51ca5 Mon Sep 17 00:00:00 2001 From: Hazel Noack Date: Thu, 9 Oct 2025 13:35:47 +0200 Subject: [PATCH] fixed wrong source type --- internal/plugin/interface.go | 5 +++++ internal/plugin/musify.go | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/plugin/interface.go b/internal/plugin/interface.go index 02f389a..eba2fcb 100644 --- a/internal/plugin/interface.go +++ b/internal/plugin/interface.go @@ -2,6 +2,7 @@ package plugin import ( "errors" + "fmt" "regexp" "gitea.elara.ws/Hazel/music-kraken/internal/common" @@ -101,6 +102,8 @@ func compileSource(source data.Source) (data.Source, error) { func FetchSource(source data.Source) (data.MusicObject, error) { // the fetch function without the post processing of the music objects + fmt.Println("call") + source, err := compileSource(source) if err != nil { return nil, err @@ -111,6 +114,8 @@ func FetchSource(source data.Source) (data.MusicObject, error) { return nil, errors.New("didn't find plugin of the name " + source.SourceType.Name) } + fmt.Println("call2", source) + if source.ObjectType == data.SongSource { song, err := plugin.FetchSong(source) diff --git a/internal/plugin/musify.go b/internal/plugin/musify.go index b261f46..a7efae9 100644 --- a/internal/plugin/musify.go +++ b/internal/plugin/musify.go @@ -2,6 +2,7 @@ package plugin import ( "errors" + "fmt" "regexp" "strings" @@ -113,7 +114,7 @@ func parseAlbumContact(contact *goquery.Selection) (data.Album, error) { if url, urlExists := anchor.Attr("href"); urlExists { album.Sources = append(album.Sources, data.Source{ Url: musifyHost + url, - ObjectType: data.ArtistSource, + ObjectType: data.AlbumSource, }) } @@ -567,6 +568,8 @@ func parseAlbum(doc *goquery.Document) data.Album { } func (m Musify) FetchAlbum(source data.Source) (data.Album, error) { + fmt.Println("meow") + album := data.Album{ Sources: []data.Source{source}, Artists: []data.Artist{},