26 lines
1.1 KiB
Go
26 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"text/template"
|
|
"time"
|
|
|
|
"git.milar.in/milarin/envvars/v2"
|
|
"git.milar.in/nyaanime/logic"
|
|
)
|
|
|
|
var (
|
|
PollRate = envvars.Object("POLL_RATE", 30*time.Minute, time.ParseDuration)
|
|
|
|
TorrentPath = envvars.String("TORRENT_PATH", "")
|
|
|
|
DebugAnimeEpisodePatternStr = envvars.String("DEBUG_ANIME_EPISODE_PATTERN", `{{.Anime.Title.UserPreferred}} episode {{.Episode}}`)
|
|
DebugAnimeEpisodePattern = template.Must(template.New("DEBUG_ANIME_EPISODE_PATTERN").Parse(DebugAnimeEpisodePatternStr))
|
|
|
|
TelegramBotToken = envvars.String("TELEGRAM_API_TOKEN", "")
|
|
TelegramChatID = envvars.Int64("TELEGRAM_CHAT_ID", 0)
|
|
TelegramDownloadMessagePatternStr = logic.EscSeqReplacer.Replace(envvars.String("TELEGRAM_DOWNLOAD_MESSAGE_PATTERN", `Download started{{range .}}\n{{.Anime.Title.UserPreferred}} episode {{.Episode}}{{end}}`))
|
|
TelegramDownloadMessagePattern = template.Must(template.New("TELEGRAM_DOWNLOAD_MESSAGE_PATTERN").Parse(TelegramDownloadMessagePatternStr))
|
|
|
|
DownloadAll = envvars.Bool("DOWNLOAD_ALL_ANIMES", false)
|
|
)
|