refactored env vars
This commit is contained in:
parent
0574e3ec2f
commit
740d58bb28
@ -28,7 +28,7 @@ func GetCurrentlyWatchingAnimes() (<-chan *anilist.MediaList, error) {
|
|||||||
return nil, ErrAnimeListNotObtainable.Wrap(err, "access token acquisition failed")
|
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{
|
return anilist.NewApi(token).GetMediaList(context.Background(), anilist.MediaListQuery{
|
||||||
UserName: AnilistUsername,
|
UserName: AnilistUsername,
|
||||||
Type: anilist.MediaTypeAnime,
|
Type: anilist.MediaTypeAnime,
|
||||||
|
@ -17,8 +17,8 @@ var (
|
|||||||
AnilistAccessToken = envvars.String("ANILIST_TOKEN", "")
|
AnilistAccessToken = envvars.String("ANILIST_TOKEN", "")
|
||||||
|
|
||||||
StoragePath = envvars.String("STORAGE_PATH", "")
|
StoragePath = envvars.String("STORAGE_PATH", "")
|
||||||
StorageUser = envvars.String("STORAGE_USER", "")
|
StorageUser = envvars.String("STORAGE_USERNAME", "")
|
||||||
StoragePass = envvars.String("STORAGE_PASS", "")
|
StoragePass = envvars.String("STORAGE_PASSWORD", "")
|
||||||
|
|
||||||
TorrentPath = envvars.String("TORRENT_PATH", "")
|
TorrentPath = envvars.String("TORRENT_PATH", "")
|
||||||
AnimePath = envvars.String("ANIME_PATH", "")
|
AnimePath = envvars.String("ANIME_PATH", "")
|
||||||
@ -35,7 +35,7 @@ var (
|
|||||||
template.New("anime-episode-pattern").Parse,
|
template.New("anime-episode-pattern").Parse,
|
||||||
)
|
)
|
||||||
|
|
||||||
AnimeStatus = envvars.ObjectSlice("ANIME_STATUS", ",", []anilist.MediaListStatus{
|
AnimeStatuses = envvars.ObjectSlice("ANIME_STATUSES", ",", []anilist.MediaListStatus{
|
||||||
anilist.MediaListStatusCurrent,
|
anilist.MediaListStatusCurrent,
|
||||||
anilist.MediaListStatusPlanning,
|
anilist.MediaListStatusPlanning,
|
||||||
}, ParseMediaListStatus)
|
}, ParseMediaListStatus)
|
||||||
|
Loading…
Reference in New Issue
Block a user