Patches cleanup

This commit is contained in:
Eduard Urbach 2018-03-08 19:09:35 +01:00
parent d6d623e151
commit 93e848b2aa
5 changed files with 1 additions and 350 deletions

View File

@ -1,26 +0,0 @@
package main
import (
"fmt"
"github.com/animenotifier/arn"
)
func main() {
defer arn.Node.Close()
for anime := range arn.StreamAnime() {
if anime.Episodes() != nil {
continue
}
fmt.Println(anime)
episodes := &arn.AnimeEpisodes{
AnimeID: anime.ID,
Items: []*arn.AnimeEpisode{},
}
arn.DB.Set("AnimeEpisodes", anime.ID, episodes)
}
}

View File

@ -1,23 +0,0 @@
package main
import (
"fmt"
"github.com/animenotifier/arn"
"github.com/fatih/color"
)
func main() {
defer arn.Node.Close()
for user := range arn.StreamUsers() {
obj := user.Notifications()
if obj == nil {
fmt.Println(user.Nick)
arn.NewUserNotifications(user.ID).Save()
}
}
color.Green("Finished.")
}

View File

@ -1,23 +0,0 @@
package main
import (
"github.com/animenotifier/arn"
)
// Character ...
type Character struct {
ID string `json:"id"`
Name string `json:"name"`
Image string `json:"image"`
Description string `json:"description"`
Attributes []*arn.CharacterAttribute `json:"attributes"`
}
func main() {
defer arn.Node.Close()
// Overwrite existing type
arn.DB.RegisterTypes((*Character)(nil))
// characters := arn.AllCharacters()
}

View File

@ -1,275 +0,0 @@
package main
func main() {}
// import (
// "time"
// "github.com/aerogo/nano"
// "github.com/animenotifier/arn"
// "github.com/fatih/color"
// )
// func main() {
// arn.DB.SetScanPriority("high")
// aeroDB := nano.New(5000).Namespace("arn", arn.DBTypes...)
// defer aeroDB.Close()
// for typeName := range arn.DB.Types() {
// count := 0
// switch typeName {
// case "Anime":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.Anime) {
// aeroDB.Set(typeName, obj.ID, obj)
// count++
// }
// case "AnimeEpisodes":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.AnimeEpisodes) {
// aeroDB.Set(typeName, obj.AnimeID, obj)
// count++
// }
// case "AnimeList":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.AnimeList) {
// aeroDB.Set(typeName, obj.UserID, obj)
// count++
// }
// case "AnimeCharacters":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.AnimeCharacters) {
// aeroDB.Set(typeName, obj.AnimeID, obj)
// count++
// }
// case "AnimeRelations":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.AnimeRelations) {
// aeroDB.Set(typeName, obj.AnimeID, obj)
// count++
// }
// case "Character":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.Character) {
// aeroDB.Set(typeName, obj.ID, obj)
// count++
// }
// case "Purchase":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.Purchase) {
// aeroDB.Set(typeName, obj.ID, obj)
// count++
// }
// case "PushSubscriptions":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.PushSubscriptions) {
// aeroDB.Set(typeName, obj.UserID, obj)
// count++
// }
// case "User":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.User) {
// aeroDB.Set(typeName, obj.ID, obj)
// count++
// }
// case "Post":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.Post) {
// aeroDB.Set(typeName, obj.ID, obj)
// count++
// }
// case "Thread":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.Thread) {
// aeroDB.Set(typeName, obj.ID, obj)
// count++
// }
// case "Analytics":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.Analytics) {
// aeroDB.Set(typeName, obj.UserID, obj)
// count++
// }
// case "SoundTrack":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.SoundTrack) {
// aeroDB.Set(typeName, obj.ID, obj)
// count++
// }
// case "Item":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.Item) {
// aeroDB.Set(typeName, obj.ID, obj)
// count++
// }
// case "Inventory":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.Inventory) {
// aeroDB.Set(typeName, obj.UserID, obj)
// count++
// }
// case "Settings":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.Settings) {
// aeroDB.Set(typeName, obj.UserID, obj)
// count++
// }
// case "UserFollows":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.UserFollows) {
// aeroDB.Set(typeName, obj.UserID, obj)
// count++
// }
// case "PayPalPayment":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.PayPalPayment) {
// aeroDB.Set(typeName, obj.ID, obj)
// count++
// }
// case "AniListToAnime":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.AniListToAnime) {
// aeroDB.Set(typeName, obj.ServiceID, obj)
// count++
// }
// case "MyAnimeListToAnime":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.MyAnimeListToAnime) {
// aeroDB.Set(typeName, obj.ServiceID, obj)
// count++
// }
// case "SearchIndex":
// anime, _ := arn.DB.Get(typeName, "Anime")
// aeroDB.Set(typeName, "Anime", anime)
// users, _ := arn.DB.Get(typeName, "User")
// aeroDB.Set(typeName, "User", users)
// posts, _ := arn.DB.Get(typeName, "Post")
// aeroDB.Set(typeName, "Post", posts)
// threads, _ := arn.DB.Get(typeName, "Thread")
// aeroDB.Set(typeName, "Thread", threads)
// count += 4
// case "DraftIndex":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.DraftIndex) {
// aeroDB.Set(typeName, obj.UserID, obj)
// count++
// }
// case "EmailToUser":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.EmailToUser) {
// if obj.Email == "" {
// continue
// }
// aeroDB.Set(typeName, obj.Email, obj)
// count++
// }
// case "FacebookToUser":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.FacebookToUser) {
// if obj.ID == "" {
// continue
// }
// aeroDB.Set(typeName, obj.ID, obj)
// count++
// }
// case "GoogleToUser":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.GoogleToUser) {
// if obj.ID == "" {
// continue
// }
// aeroDB.Set(typeName, obj.ID, obj)
// count++
// }
// case "TwitterToUser":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.TwitterToUser) {
// if obj.ID == "" {
// continue
// }
// aeroDB.Set(typeName, obj.ID, obj)
// count++
// }
// case "NickToUser":
// channel, _ := arn.DB.All(typeName)
// for obj := range channel.(chan *arn.NickToUser) {
// if obj.Nick == "" {
// continue
// }
// aeroDB.Set(typeName, obj.Nick, obj)
// count++
// }
// default:
// color.Yellow("Skipping %s", typeName)
// continue
// }
// color.Green("Export %d %s", count, typeName)
// }
// time.Sleep(1 * time.Second)
// }

View File

@ -10,9 +10,7 @@ func main() {
for user := range arn.StreamUsers() {
settings := user.Settings()
if user.IsPro() {
settings.Theme = "dark"
} else {
if !user.IsPro() {
settings.Theme = "light"
}