service

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2026 License: GPL-3.0 Imports: 28 Imported by: 0

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

View Source
const BASE = "https://gpodder.net"

BASE is the base URL for GPodder API.

View Source
const ItunesBase = "https://itunes.apple.com"

ItunesBase is the base URL for iTunes API.

Variables

This section is empty.

Functions

func AddOpml

func AddOpml(content string) error

AddOpml add opml.

func AddPodcast

func AddPodcast(url string) (db.Podcast, error)

AddPodcast add podcast.

func AddPodcastItems

func AddPodcastItems(podcast *db.Podcast, newPodcast bool) error

AddPodcastItems add podcast items.

func AddTag

func AddTag(label, description string) (db.Tag, error)

AddTag add tag.

func ByTag

func ByTag(tag string, count int) []model.GPodcast

ByTag by tag.

func CheckMissingFiles

func CheckMissingFiles() error

CheckMissingFiles check missing files.

func ClearEpisodeFiles

func ClearEpisodeFiles() error

ClearEpisodeFiles clears old episode files based on MaxDownloadKeep setting.

func CreateBackup

func CreateBackup() (string, error)

CreateBackup create backup.

func CreateNfoFile

func CreateNfoFile(podcast *db.Podcast) error

CreateNfoFile create nfo file.

func DeleteEpisodeFile

func DeleteEpisodeFile(podcastItemID string) error

DeleteEpisodeFile delete episode file.

func DeleteFile

func DeleteFile(filePath string) error

DeleteFile delete file.

func DeletePodcast

func DeletePodcast(id string, deleteFiles bool) error

DeletePodcast delete podcast.

func DeletePodcastEpisodes

func DeletePodcastEpisodes(id string) error

DeletePodcastEpisodes delete podcast episodes.

func DeleteTag

func DeleteTag(id string) error

DeleteTag delete tag.

func Download

func Download(link, episodeTitle, podcastName, episodePathName string) (string, error)

Download download.

func DownloadImage

func DownloadImage(link, episodeID, podcastName string) (string, error)

DownloadImage download image.

func DownloadMissingEpisodes

func DownloadMissingEpisodes() error

DownloadMissingEpisodes download missing episodes.

func DownloadMissingImages

func DownloadMissingImages() error

DownloadMissingImages download missing images.

func DownloadPodcastCoverImage

func DownloadPodcastCoverImage(link, podcastName string) (string, error)

DownloadPodcastCoverImage download podcast cover image.

func DownloadSingleEpisode

func DownloadSingleEpisode(podcastItemID string) error

DownloadSingleEpisode download single episode.

func ExportOmpl

func ExportOmpl(usePodgrabLink bool, baseURL string) ([]byte, error)

ExportOmpl export ompl.

func FetchURL

func FetchURL(url string) (model.PodcastData, []byte, error)

FetchURL is

func FileExists

func FileExists(filePath string) bool

FileExists file exists.

func FormatFileName

func FormatFileName(item *db.PodcastItem, formatString string) string

FormatFileName formats a filename using the format string and podcast item data.

func GetAllBackupFiles

func GetAllBackupFiles() ([]string, error)

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

func GetAllPodcasts(sorting string) *[]db.Podcast

GetAllPodcasts get all podcasts.

func GetFileSize

func GetFileSize(filePath string) (int64, error)

GetFileSize get file size.

func GetFileSizeFromURL

func GetFileSizeFromURL(urlString string) (int64, error)

GetFileSizeFromURL get file size from url.

func GetPodcastByID

func GetPodcastByID(id string) *db.Podcast

GetPodcastByID get podcast by id.

func GetPodcastItemByID

func GetPodcastItemByID(id string) *db.PodcastItem

GetPodcastItemByID get podcast item by id.

func GetPodcastLocalImagePath

func GetPodcastLocalImagePath(link, podcastName string) string

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 GetTagsByIDs

func GetTagsByIDs(ids []string) *[]db.Tag

GetTagsByIDs get tags by ids.

func NatualTime

func NatualTime(base, value time.Time) string

NatualTime natual time.

func ParseOpml

func ParseOpml(content string) (model.OpmlModel, error)

ParseOpml parse opml.

func Query

Query query.

func RefreshEpisodes

func RefreshEpisodes() error

RefreshEpisodes refresh episodes.

func RefreshPodcast

func RefreshPodcast(podcast *db.Podcast)

RefreshPodcast refreshes a single podcast.

func RefreshPodcastByPodcastID

func RefreshPodcastByPodcastID(podcastID string) error

RefreshPodcastByPodcastID refreshes a single podcast by ID.

func SetAllEpisodesToDownload

func SetAllEpisodesToDownload(podcastID string) error

SetAllEpisodesToDownload set all episodes to download.

func SetPodcastItemAsDownloaded

func SetPodcastItemAsDownloaded(id, location string) error

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

func SetPodcastItemAsQueuedForDownload(id string) error

SetPodcastItemAsQueuedForDownload set podcast item as queued for download.

func SetPodcastItemBookmarkStatus

func SetPodcastItemBookmarkStatus(id string, bookmark bool) error

SetPodcastItemBookmarkStatus set podcast item bookmark status.

func SetPodcastItemPlayedStatus

func SetPodcastItemPlayedStatus(id string, isPlayed bool) error

SetPodcastItemPlayedStatus set podcast item played status.

func Tags

func Tags(count int) []model.GPodcastTag

Tags tags.

func TogglePodcastPause

func TogglePodcastPause(id string, isPaused bool) error

TogglePodcastPause toggle podcast pause.

func Top

func Top(count int) []model.GPodcast

Top top.

func UnlockMissedJobs

func UnlockMissedJobs()

UnlockMissedJobs unlock missed jobs.

func UpdateAllFileSizes

func UpdateAllFileSizes()

UpdateAllFileSizes update all file sizes.

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL