Documentation
¶
Overview ¶
Package service implements business logic for podcast management and downloads.
Package service implements business logic for podcast management and downloads.
Package service implements business logic for podcast management and downloads.
Package service implements business logic for podcast management and downloads.
Package service implements business logic for podcast management and downloads.
Index ¶
- Constants
- func AddOpml(content string) error
- func AddPodcast(url string) (db.Podcast, error)
- func AddPodcastItems(podcast *db.Podcast, newPodcast bool) error
- func AddTag(label, description string) (db.Tag, error)
- func ByTag(tag string, count int) []model.GPodcast
- func CheckMissingFiles() error
- func ClearEpisodeFiles() error
- func CreateBackup() (string, error)
- func CreateNfoFile(podcast *db.Podcast) error
- func DeleteEpisodeFile(podcastItemID string) error
- func DeleteFile(filePath string) error
- func DeletePodcast(id string, deleteFiles bool) error
- func DeletePodcastEpisodes(id string) error
- func DeleteTag(id string) error
- func Download(link, episodeTitle, podcastName, episodePathName string) (string, error)
- func DownloadImage(link, episodeID, podcastName string) (string, error)
- func DownloadMissingEpisodes() error
- func DownloadMissingImages() error
- func DownloadPodcastCoverImage(link, podcastName string) (string, error)
- func DownloadSingleEpisode(podcastItemID string) error
- func ExportOmpl(usePodgrabLink bool, baseURL string) ([]byte, error)
- func FetchURL(url string) (model.PodcastData, []byte, error)
- func FileExists(filePath string) bool
- func FormatFileName(item *db.PodcastItem, formatString string) string
- func GetAllBackupFiles() ([]string, error)
- func GetAllPodcastItemsByIDs(podcastItemIDs []string) (*[]db.PodcastItem, error)
- func GetAllPodcastItemsByPodcastIDs(podcastIDs []string) *[]db.PodcastItem
- func GetAllPodcasts(sorting string) *[]db.Podcast
- func GetFileSize(filePath string) (int64, error)
- func GetFileSizeFromURL(urlString string) (int64, error)
- func GetPodcastByID(id string) *db.Podcast
- func GetPodcastItemByID(id string) *db.PodcastItem
- func GetPodcastLocalImagePath(link, podcastName string) string
- func GetSearchFromGpodder(pod *model.GPodcast) *model.CommonSearchResultModel
- func GetSearchFromItunes(pod *model.ItunesSingleResult) *model.CommonSearchResultModel
- func GetSearchFromPodcastIndex(pod *podcastindex.Podcast) *model.CommonSearchResultModel
- func GetTagsByIDs(ids []string) *[]db.Tag
- func NatualTime(base, value time.Time) string
- func ParseOpml(content string) (model.OpmlModel, error)
- func Query(q string) []*model.CommonSearchResultModel
- func RefreshEpisodes() error
- func RefreshPodcast(podcast *db.Podcast)
- func RefreshPodcastByPodcastID(podcastID string) error
- func SetAllEpisodesToDownload(podcastID string) error
- func SetPodcastItemAsDownloaded(id, location string) error
- func SetPodcastItemAsNotDownloaded(id string, downloadStatus db.DownloadStatus) error
- func SetPodcastItemAsQueuedForDownload(id string) error
- func SetPodcastItemBookmarkStatus(id string, bookmark bool) error
- func SetPodcastItemPlayedStatus(id string, isPlayed bool) error
- func Tags(count int) []model.GPodcastTag
- func TogglePodcastPause(id string, isPaused bool) error
- func Top(count int) []model.GPodcast
- func UnlockMissedJobs()
- func UpdateAllFileSizes()
- func UpdateSettings(downloadOnAdd bool, initialDownloadCount int, autoDownload bool, ...) error
- type ItunesService
- type PodcastIndexService
- type SearchService
Constants ¶
const BASE = "https://gpodder.net"
BASE is the base URL for GPodder API.
const ItunesBase = "https://itunes.apple.com"
ItunesBase is the base URL for iTunes API.
Variables ¶
This section is empty.
Functions ¶
func AddPodcastItems ¶
AddPodcastItems add podcast items.
func ClearEpisodeFiles ¶
func ClearEpisodeFiles() error
ClearEpisodeFiles clears old episode files based on MaxDownloadKeep setting.
func DeleteEpisodeFile ¶
DeleteEpisodeFile delete episode file.
func DeletePodcast ¶
DeletePodcast delete podcast.
func DeletePodcastEpisodes ¶
DeletePodcastEpisodes delete podcast episodes.
func DownloadImage ¶
DownloadImage download image.
func DownloadMissingEpisodes ¶
func DownloadMissingEpisodes() error
DownloadMissingEpisodes download missing episodes.
func DownloadMissingImages ¶
func DownloadMissingImages() error
DownloadMissingImages download missing images.
func DownloadPodcastCoverImage ¶
DownloadPodcastCoverImage download podcast cover image.
func DownloadSingleEpisode ¶
DownloadSingleEpisode download single episode.
func ExportOmpl ¶
ExportOmpl export ompl.
func FormatFileName ¶
func FormatFileName(item *db.PodcastItem, formatString string) string
FormatFileName formats a filename using the format string and podcast item data.
func GetAllBackupFiles ¶
GetAllBackupFiles get all backup files.
func GetAllPodcastItemsByIDs ¶
func GetAllPodcastItemsByIDs(podcastItemIDs []string) (*[]db.PodcastItem, error)
GetAllPodcastItemsByIDs get all podcast items by ids.
func GetAllPodcastItemsByPodcastIDs ¶
func GetAllPodcastItemsByPodcastIDs(podcastIDs []string) *[]db.PodcastItem
GetAllPodcastItemsByPodcastIDs get all podcast items by podcast ids.
func GetAllPodcasts ¶
GetAllPodcasts get all podcasts.
func GetFileSizeFromURL ¶
GetFileSizeFromURL get file size from url.
func GetPodcastItemByID ¶
func GetPodcastItemByID(id string) *db.PodcastItem
GetPodcastItemByID get podcast item by id.
func GetPodcastLocalImagePath ¶
GetPodcastLocalImagePath get podcast local image path.
func GetSearchFromGpodder ¶
func GetSearchFromGpodder(pod *model.GPodcast) *model.CommonSearchResultModel
GetSearchFromGpodder get search from gpodder.
func GetSearchFromItunes ¶
func GetSearchFromItunes(pod *model.ItunesSingleResult) *model.CommonSearchResultModel
GetSearchFromItunes get search from itunes.
func GetSearchFromPodcastIndex ¶
func GetSearchFromPodcastIndex(pod *podcastindex.Podcast) *model.CommonSearchResultModel
GetSearchFromPodcastIndex get search from podcast index.
func RefreshPodcast ¶
RefreshPodcast refreshes a single podcast.
func RefreshPodcastByPodcastID ¶
RefreshPodcastByPodcastID refreshes a single podcast by ID.
func SetAllEpisodesToDownload ¶
SetAllEpisodesToDownload set all episodes to download.
func SetPodcastItemAsDownloaded ¶
SetPodcastItemAsDownloaded set podcast item as downloaded.
func SetPodcastItemAsNotDownloaded ¶
func SetPodcastItemAsNotDownloaded(id string, downloadStatus db.DownloadStatus) error
SetPodcastItemAsNotDownloaded set podcast item as not downloaded.
func SetPodcastItemAsQueuedForDownload ¶
SetPodcastItemAsQueuedForDownload set podcast item as queued for download.
func SetPodcastItemBookmarkStatus ¶
SetPodcastItemBookmarkStatus set podcast item bookmark status.
func SetPodcastItemPlayedStatus ¶
SetPodcastItemPlayedStatus set podcast item played status.
func TogglePodcastPause ¶
TogglePodcastPause toggle podcast pause.
func UpdateSettings ¶
func UpdateSettings( downloadOnAdd bool, initialDownloadCount int, autoDownload bool, fileNameFormat string, passthroughPodcastGUID bool, darkMode bool, downloadEpisodeImages bool, generateNFOFile bool, dontDownloadDeletedFromDisk bool, baseURL string, maxDownloadConcurrency int, maxDownloadKeep int, userAgent string, ) error
UpdateSettings update settings.
Types ¶
type ItunesService ¶
type ItunesService struct {
}
ItunesService represents itunes service data.
func (ItunesService) Query ¶
func (service ItunesService) Query(q string) []*model.CommonSearchResultModel
Query searches for podcasts using the iTunes API.
type PodcastIndexService ¶
type PodcastIndexService struct {
}
PodcastIndexService represents podcast index service data.
func (PodcastIndexService) Query ¶
func (service PodcastIndexService) Query(q string) []*model.CommonSearchResultModel
Query searches for podcasts using the Podcast Index API.
type SearchService ¶
type SearchService interface {
Query(q string) []*model.CommonSearchResultModel
}
SearchService defines the interface for podcast search services.