Added some more compatibilty

main
Uriel Fanelli 2025-05-03 16:14:06 +02:00
parent 18b30fb55c
commit a0d40589c9
4 changed files with 16 additions and 2 deletions

5
go.mod
View File

@ -2,4 +2,7 @@ module u-pod
go 1.21.0
require github.com/dhowden/tag v0.0.0-20240417053706-3d75831295e8
require (
github.com/dhowden/tag v0.0.0-20240417053706-3d75831295e8
github.com/google/uuid v1.6.0
)

2
go.sum
View File

@ -1,2 +1,4 @@
github.com/dhowden/tag v0.0.0-20240417053706-3d75831295e8 h1:OtSeLS5y0Uy01jaKK4mA/WVIYtpzVm63vLVAPzJXigg=
github.com/dhowden/tag v0.0.0-20240417053706-3d75831295e8/go.mod h1:apkPC/CR3s48O2D7Y++n1XWEpgPNNCjXYga3PPbJe2E=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=

8
pod.go
View File

@ -10,6 +10,7 @@ import (
"time"
"github.com/dhowden/tag"
"github.com/google/uuid"
)
type Episode struct {
@ -25,6 +26,11 @@ var (
rssLock sync.Mutex
)
func generateUUIDFromString(input string) uuid.UUID {
namespace := uuid.NameSpaceDNS // Namespace fisso per consistenza
return uuid.NewSHA1(namespace, []byte(input))
}
func generateRSS() error {
rssLock.Lock()
defer rssLock.Unlock()
@ -57,7 +63,7 @@ func generateRSS() error {
<itunes:image href="%s/covers/%s"/>`, baseURL, ep.Cover)
}
rss += fmt.Sprintf(`<link>%s/audio/%s</link>`, baseURL, filepath.Base(ep.File))
rss += fmt.Sprintf(`<guid>%s/audio/%s</guid>`, baseURL, filepath.Base(ep.File))
rss += fmt.Sprintf(`<guid>%s</guid>`, generateUUIDFromString(ep.Title).String())
rss += fmt.Sprintf(`<language>it-it</language>`)
rss += fmt.Sprintf(`<copyright>© 2025 Uriel Fanelli</copyright>`)
rss += fmt.Sprintf(`<description>%s</description>`, ep.Title)

3
vendor/modules.txt vendored
View File

@ -1,3 +1,6 @@
# github.com/dhowden/tag v0.0.0-20240417053706-3d75831295e8
## explicit; go 1.20
github.com/dhowden/tag
# github.com/google/uuid v1.6.0
## explicit
github.com/google/uuid