Added some more compatibilty
parent
18b30fb55c
commit
a0d40589c9
5
go.mod
5
go.mod
|
@ -2,4 +2,7 @@ module u-pod
|
||||||
|
|
||||||
go 1.21.0
|
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
2
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 h1:OtSeLS5y0Uy01jaKK4mA/WVIYtpzVm63vLVAPzJXigg=
|
||||||
github.com/dhowden/tag v0.0.0-20240417053706-3d75831295e8/go.mod h1:apkPC/CR3s48O2D7Y++n1XWEpgPNNCjXYga3PPbJe2E=
|
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
8
pod.go
|
@ -10,6 +10,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/dhowden/tag"
|
"github.com/dhowden/tag"
|
||||||
|
"github.com/google/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Episode struct {
|
type Episode struct {
|
||||||
|
@ -25,6 +26,11 @@ var (
|
||||||
rssLock sync.Mutex
|
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 {
|
func generateRSS() error {
|
||||||
rssLock.Lock()
|
rssLock.Lock()
|
||||||
defer rssLock.Unlock()
|
defer rssLock.Unlock()
|
||||||
|
@ -57,7 +63,7 @@ func generateRSS() error {
|
||||||
<itunes:image href="%s/covers/%s"/>`, baseURL, ep.Cover)
|
<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(`<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(`<language>it-it</language>`)
|
||||||
rss += fmt.Sprintf(`<copyright>© 2025 Uriel Fanelli</copyright>`)
|
rss += fmt.Sprintf(`<copyright>© 2025 Uriel Fanelli</copyright>`)
|
||||||
rss += fmt.Sprintf(`<description>%s</description>`, ep.Title)
|
rss += fmt.Sprintf(`<description>%s</description>`, ep.Title)
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
# github.com/dhowden/tag v0.0.0-20240417053706-3d75831295e8
|
# github.com/dhowden/tag v0.0.0-20240417053706-3d75831295e8
|
||||||
## explicit; go 1.20
|
## explicit; go 1.20
|
||||||
github.com/dhowden/tag
|
github.com/dhowden/tag
|
||||||
|
# github.com/google/uuid v1.6.0
|
||||||
|
## explicit
|
||||||
|
github.com/google/uuid
|
||||||
|
|
Loading…
Reference in New Issue