downloader/envvars.go

26 lines
1.0 KiB
Go
Raw Normal View History

2022-08-25 09:04:22 +02:00
package main
import (
2023-01-15 20:59:54 +01:00
"text/template"
2022-08-25 09:04:22 +02:00
"time"
2022-08-25 10:26:57 +02:00
"git.milar.in/milarin/envvars/v2"
2023-01-15 20:59:54 +01:00
"git.milar.in/nyaanime/logic"
2022-08-25 09:04:22 +02:00
)
var (
PollRate = envvars.Object("POLL_RATE", 30*time.Minute, time.ParseDuration)
2022-08-25 09:04:22 +02:00
TorrentPath = envvars.String("TORRENT_PATH", "")
2023-01-16 00:44:30 +01:00
DebugAnimeEpisodePatternStr = envvars.String("DEBUG_ANIME_EPISODE_PATTERN", `{{.Anime.Title.UserPreferred}} episode {{.Episode}}`)
DebugAnimeEpisodePattern = template.Must(template.New("DEBUG_ANIME_EPISODE_PATTERN").Parse(DebugAnimeEpisodePatternStr))
2022-08-25 23:25:48 +02:00
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\n\n{{.Title.UserPreferred}} episode {{.Episode}}`))
2023-01-16 00:44:30 +01:00
TelegramDownloadMessagePattern = template.Must(template.New("TELEGRAM_DOWNLOAD_MESSAGE_PATTERN").Parse(TelegramDownloadMessagePatternStr))
2023-01-15 20:59:54 +01:00
2022-08-25 23:25:48 +02:00
DownloadAll = envvars.Bool("DOWNLOAD_ALL_ANIMES", false)
2022-08-25 09:04:22 +02:00
)