From 2edc3a3a445ed1fdda3f5425a245205d485e74f9 Mon Sep 17 00:00:00 2001 From: Hazel Noack Date: Wed, 8 Oct 2025 11:54:27 +0200 Subject: [PATCH] basic album fetching --- internal/plugin/musify.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/internal/plugin/musify.go b/internal/plugin/musify.go index 2531b67..a5c140a 100644 --- a/internal/plugin/musify.go +++ b/internal/plugin/musify.go @@ -85,6 +85,42 @@ func parseArtistContact(contact *goquery.Selection) data.Artist { func parseAlbumContact(contact *goquery.Selection) data.Album { album := data.Album{} + /* +
+ + +
+ Ghost Bath + +
+ +
+ Ghost Bath - 2013 + Ghost Bath + Треков: 4 + 9,04 +
+
+
+ */ + + anchor := contact.Find("a") + if anchor.Length() > 0 { + if url, urlExists := anchor.Attr("href"); urlExists { + album.Sources = append(album.Sources, data.Source{ + Url: musifyHost + url, + ObjectType: data.ArtistSource, + }) + } + + if titleDate, titleExists := anchor.Attr("title"); titleExists { + delimiter := " - " + + splitAttr := strings.Split(strings.TrimSpace(titleDate), delimiter) + album.Name = strings.Join(splitAttr[:len(splitAttr)-1], delimiter) + } + } + return album }