Compare commits

..

5 Commits

Author SHA1 Message Date
b1c0733f8f fix(deps): update module github.com/puerkitobio/goquery to v1.10.3
Some checks failed
renovate/artifacts Artifact file update failure
2025-04-11 21:00:48 +00:00
ngn
a01a4febf5
Merge remote-tracking branch 'refs/remotes/origin/custom' into custom
All checks were successful
Build and publish the docker image / build (push) Successful in 1m45s
2025-04-09 19:27:15 +03:00
ngn
1c8cd6ed32
remove lyrics header patch from upstream repo
https://github.com/rramiachraf/dumb/pull/90

Signed-off-by: ngn <ngn@ngn.tf>
2025-04-09 19:26:23 +03:00
ngn
d40dce624b Merge pull request 'chore(deps): update golang docker tag to v1.24.2' (#7) from renovate/golang-1.x into custom
All checks were successful
Build and publish the docker image / build (push) Successful in 1m5s
Reviewed-on: #7
2025-04-05 23:50:30 +03:00
6db6680a16 chore(deps): update golang docker tag to v1.24.2 2025-04-01 21:00:43 +00:00
4 changed files with 11 additions and 2 deletions

View File

@ -1,4 +1,4 @@
FROM golang:1.23.6 AS build
FROM golang:1.24.2 AS build
WORKDIR /code
RUN go install github.com/a-h/templ/cmd/templ@latest

View File

@ -58,6 +58,8 @@ type customPerformance struct {
func (s *Song) parseLyrics(doc *goquery.Document) error {
var htmlError error
doc.Find("[class^=LyricsHeader]").Remove()
doc.Find("[data-lyrics-container='true']").Each(func(i int, ss *goquery.Selection) {
h, err := ss.Html()
if err != nil {

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.23
toolchain go1.23.4
require (
github.com/PuerkitoBio/goquery v1.10.2
github.com/PuerkitoBio/goquery v1.10.3
github.com/a-h/templ v0.3.819
github.com/allegro/bigcache/v3 v3.1.0
github.com/gorilla/handlers v1.5.2

View File

@ -4,6 +4,7 @@ import (
"net/http"
"net/http/httptest"
"os"
"strings"
"testing"
"github.com/PuerkitoBio/goquery"
@ -25,6 +26,7 @@ func TestLyrics(t *testing.T) {
func testLyrics(t *testing.T, url string) {
title := "The Silver Seas"
artist := "Catch Yer Own Train"
firstLyricLine := "[Verse 1]"
r, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
@ -46,6 +48,7 @@ func testLyrics(t *testing.T, url string) {
docArtist := doc.Find("#metadata-info h1").Text()
docTitle := doc.Find("#metadata-info h2").Text()
docLyrics := doc.Find("#lyrics").Text()
if docTitle != title {
t.Fatalf("expected %q, got %q\n", title, docTitle)
@ -54,4 +57,8 @@ func testLyrics(t *testing.T, url string) {
if docArtist != artist {
t.Fatalf("expected %q, got %q\n", artist, docArtist)
}
if !strings.HasPrefix(docLyrics, firstLyricLine) {
t.Fatalf("expected lyrics to start with %q, got %q\n", firstLyricLine, docLyrics)
}
}