1
0
mirror of https://github.com/mxpv/podsync.git synced 2024-05-11 05:55:04 +00:00
Files
mxpv-podsync/web/pkg/builders/common.go
2017-08-05 18:35:52 -07:00

36 lines
703 B
Go

package builders
import (
"fmt"
itunes "github.com/mxpv/podcast"
"github.com/mxpv/podsync/web/pkg/storage"
)
const (
podsyncGenerator = "Podsync generator"
defaultCategory = "TV & Film"
)
type linkType int
const (
_ = iota
linkTypeChannel linkType = iota
linkTypePlaylist
linkTypeUser
linkTypeGroup
)
func makeEnclosure(feed *storage.Feed, id string, lengthInBytes int64) (string, itunes.EnclosureType, int64) {
ext := "mp4"
contentType := itunes.MP4
if feed.Format == storage.AudioFormat {
ext = "mp3"
contentType = itunes.MP3
}
url := fmt.Sprintf("http://podsync.net/download/%s/%s.%s", feed.HashId, id, ext)
return url, contentType, lengthInBytes
}