fixed anime episode pattern problems
This commit is contained in:
parent
a93c5f2c84
commit
6adf6f276d
@ -13,16 +13,13 @@ var (
|
||||
|
||||
TorrentPath = envvars.String("TORRENT_PATH", "")
|
||||
|
||||
DebugAnimeEpisodePattern = envvars.Object(
|
||||
"DEBUG_ANIME_EPISODE_PATTERN",
|
||||
template.Must(template.New("anime-episode-filepath-pattern").Parse(`{{.Title.UserPreferred}} episode {{.Episode}}`)),
|
||||
template.New("anime-episode-filepath-pattern").Parse,
|
||||
)
|
||||
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\n\n{{.Title.UserPreferred}} episode {{.Episode}}`))
|
||||
TelegramDownloadMessagePattern = template.Must(template.New("telegram-download-message-pattern").Parse(TelegramDownloadMessagePatternStr))
|
||||
TelegramDownloadMessagePattern = template.Must(template.New("TELEGRAM_DOWNLOAD_MESSAGE_PATTERN").Parse(TelegramDownloadMessagePatternStr))
|
||||
|
||||
DownloadAll = envvars.Bool("DOWNLOAD_ALL_ANIMES", false)
|
||||
)
|
||||
|
@ -63,7 +63,9 @@ func ShowDebugInfo(
|
||||
}
|
||||
|
||||
b := new(strings.Builder)
|
||||
DebugAnimeEpisodePattern.Execute(b, animeEp)
|
||||
if err := DebugAnimeEpisodePattern.Execute(b, animeEp); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
header := BoldText.Sprintf("%s (%s)", color.MagentaString(b.String()), epState)
|
||||
fmt.Println(tprint.FormatHeaderTable(header, table))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user