1
0
mirror of https://github.com/mxpv/podsync.git synced 2024-05-11 05:55:04 +00:00

Whitelist creator id

This commit is contained in:
Maksym Pavlenko
2017-10-23 18:32:35 -07:00
parent 7c256fd58f
commit e398a4f729

View File

@ -18,7 +18,7 @@ import (
)
const (
campaignId = "278915"
creatorID = "2822191"
identitySessionKey = "identity"
)
@ -125,16 +125,21 @@ func MakeHandlers(feed feed, cfg *config.AppConfig) http.Handler {
// Determine feature level
level := api.DefaultFeatures
amount := 0
for _, item := range user.Included.Items {
pledge, ok := item.(*patreon.Pledge)
if ok {
amount += pledge.Attributes.AmountCents
}
}
if amount >= 100 {
level = api.ExtendedFeatures
if user.Data.Id == creatorID {
level = api.PodcasterFeature
} else {
amount := 0
for _, item := range user.Included.Items {
pledge, ok := item.(*patreon.Pledge)
if ok {
amount += pledge.Attributes.AmountCents
}
}
if amount >= 100 {
level = api.ExtendedFeatures
}
}
identity := &api.Identity{