refactored env vars

This commit is contained in:
Timon Ringwald 2022-08-26 18:30:32 +02:00
parent 0574e3ec2f
commit 740d58bb28
2 changed files with 4 additions and 4 deletions

View File

@ -28,7 +28,7 @@ func GetCurrentlyWatchingAnimes() (<-chan *anilist.MediaList, error) {
return nil, ErrAnimeListNotObtainable.Wrap(err, "access token acquisition failed")
}
media := channel.Map(channel.Of(AnimeStatus...), func(status anilist.MediaListStatus) <-chan *anilist.MediaList {
media := channel.Map(channel.Of(AnimeStatuses...), func(status anilist.MediaListStatus) <-chan *anilist.MediaList {
return anilist.NewApi(token).GetMediaList(context.Background(), anilist.MediaListQuery{
UserName: AnilistUsername,
Type: anilist.MediaTypeAnime,

View File

@ -17,8 +17,8 @@ var (
AnilistAccessToken = envvars.String("ANILIST_TOKEN", "")
StoragePath = envvars.String("STORAGE_PATH", "")
StorageUser = envvars.String("STORAGE_USER", "")
StoragePass = envvars.String("STORAGE_PASS", "")
StorageUser = envvars.String("STORAGE_USERNAME", "")
StoragePass = envvars.String("STORAGE_PASSWORD", "")
TorrentPath = envvars.String("TORRENT_PATH", "")
AnimePath = envvars.String("ANIME_PATH", "")
@ -35,7 +35,7 @@ var (
template.New("anime-episode-pattern").Parse,
)
AnimeStatus = envvars.ObjectSlice("ANIME_STATUS", ",", []anilist.MediaListStatus{
AnimeStatuses = envvars.ObjectSlice("ANIME_STATUSES", ",", []anilist.MediaListStatus{
anilist.MediaListStatusCurrent,
anilist.MediaListStatusPlanning,
}, ParseMediaListStatus)