From a0d40589c9afcc098171fdf558ac2e9954ce00cd Mon Sep 17 00:00:00 2001 From: Loweel Date: Sat, 3 May 2025 16:14:06 +0200 Subject: [PATCH] Added some more compatibilty --- go.mod | 5 ++++- go.sum | 2 ++ pod.go | 8 +++++++- vendor/modules.txt | 3 +++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index adf2485..267274f 100644 --- a/go.mod +++ b/go.mod @@ -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 +) diff --git a/go.sum b/go.sum index c435635..b845603 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/pod.go b/pod.go index b41268e..a1901c8 100644 --- a/pod.go +++ b/pod.go @@ -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 { `, baseURL, ep.Cover) } rss += fmt.Sprintf(`%s/audio/%s`, baseURL, filepath.Base(ep.File)) - rss += fmt.Sprintf(`%s/audio/%s`, baseURL, filepath.Base(ep.File)) + rss += fmt.Sprintf(`%s`, generateUUIDFromString(ep.Title).String()) rss += fmt.Sprintf(`it-it`) rss += fmt.Sprintf(`© 2025 Uriel Fanelli`) rss += fmt.Sprintf(`%s`, ep.Title) diff --git a/vendor/modules.txt b/vendor/modules.txt index 67fa028..53da95e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -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