From b3318e44191ceec64472dfae4686c10215fe3a43 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Mon, 22 Nov 2021 18:58:13 +0900 Subject: [PATCH] Cleanup --- go.mod | 4 +- go.sum | 9 ++- main_test.go | 2 +- server/middleware/UserInfo.go | 2 +- utils/routetests/All.go | 113 +++++----------------------------- 5 files changed, 23 insertions(+), 107 deletions(-) diff --git a/go.mod b/go.mod index bfa572fe..c66ae650 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/aerogo/crawler v0.2.5 github.com/aerogo/flow v0.1.5 github.com/aerogo/graphql v0.4.4 - github.com/aerogo/http v1.1.3 + github.com/aerogo/http v1.1.5 github.com/aerogo/log v0.2.6 github.com/aerogo/manifest v0.1.5 github.com/aerogo/markdown v0.1.9 @@ -30,7 +30,7 @@ require ( github.com/akyoto/imageserver v0.3.7 github.com/akyoto/stringutils v0.3.1 github.com/akyoto/webpush-go v0.1.2 - github.com/animenotifier/anilist v0.2.6 + github.com/animenotifier/anilist v0.2.8 github.com/animenotifier/japanese v0.2.5 github.com/animenotifier/kitsu v0.2.4 github.com/animenotifier/mal v0.2.5 diff --git a/go.sum b/go.sum index 4b0b377c..30246c32 100644 --- a/go.sum +++ b/go.sum @@ -73,9 +73,9 @@ github.com/aerogo/http v1.0.6/go.mod h1:LwJ7b+LjrHj60FhYQ586K3/O7aNGxkE2dy/exEkQ github.com/aerogo/http v1.0.9/go.mod h1:qVlq+QszT9mFVL92hmMs71fqzA1DILTjNSucEWUdFmk= github.com/aerogo/http v1.0.10/go.mod h1:rG/KkSLgpcjuB9I8k+OWbQI9YbahHIridyva0AQdH70= github.com/aerogo/http v1.0.12/go.mod h1:nUN1X1Kyh7tj5hi0ufaqLhENHA0iF3nCoGZDSGabEog= -github.com/aerogo/http v1.1.0/go.mod h1:5VMFMcmM5djh6c7L/v++HUjFvVz+7ER2t2NfXRrzohk= -github.com/aerogo/http v1.1.3 h1:cvwOYL+zNEfNHvJcX6A6OgUwQ4KROlu8ypuQEQc1HtU= github.com/aerogo/http v1.1.3/go.mod h1:h+m3WxevpaifyVpRAMV58qt8ScXSZhU1a5DdvBkRwwE= +github.com/aerogo/http v1.1.5 h1:j0p68HiCtJp6CssxxxSUhX9uOPBomJMIKO4VKMRHQ0c= +github.com/aerogo/http v1.1.5/go.mod h1:h+m3WxevpaifyVpRAMV58qt8ScXSZhU1a5DdvBkRwwE= github.com/aerogo/linter-performance v1.0.6/go.mod h1:E5myVvu3+U1NmdW3c+A6xs9Me/U/Ey4Khz35uJdB5Yc= github.com/aerogo/log v0.2.6 h1:QqIDsncjgfLC5mbMuLBWPN9mA+Eq2oYO/7xYa1N464w= github.com/aerogo/log v0.2.6/go.mod h1:IxEs1Csy6P8CByjSfKiZ15VwPHUssj8cbNcmc4l1LVI= @@ -139,7 +139,6 @@ github.com/akyoto/stringutils v0.2.0/go.mod h1:EigXf5ZaULP6f5CNjqIIo0fjDHbRe8P4B github.com/akyoto/stringutils v0.2.3/go.mod h1:nyO78pc92gciYObsOGWasnQN/s18JEQusXtN/7iC2AM= github.com/akyoto/stringutils v0.2.4/go.mod h1:nyO78pc92gciYObsOGWasnQN/s18JEQusXtN/7iC2AM= github.com/akyoto/stringutils v0.2.6/go.mod h1:OPVSI2QOvOGJ8GZoVdsS5BrAUb/l9zf63QgMvLPYOjQ= -github.com/akyoto/stringutils v0.3.0/go.mod h1:v+Lr6tJxVd/Q1InaxsqaSXO+vSkG7MYMNc9Y9ul6Mkc= github.com/akyoto/stringutils v0.3.1 h1:C+VGuXfud9SSo54QRfdQO+rgQiHmLS5f4nJ4yUOM+8I= github.com/akyoto/stringutils v0.3.1/go.mod h1:I1F9f8FF7gnAQyYp4PVAl+GJ2WBnaN6kNoYjidCV5Qk= github.com/akyoto/tty v0.1.3/go.mod h1:+VlbvviCaiwhS4oGpO+iBtC0lYG1ilIs3ZhUnT1Ppgo= @@ -152,8 +151,8 @@ github.com/akyoto/webpush-go v0.1.2/go.mod h1:IxZu6lYe/IQ+jNFEcZjwp6cWyU/KsnARuL github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= -github.com/animenotifier/anilist v0.2.6 h1:L1M7fcgy+gAShscnHucz+Jn3nM1hOQKWZxuyhLatBBo= -github.com/animenotifier/anilist v0.2.6/go.mod h1:fzOQXacU6rHnVoLFZaercp26BwNZDWkB6MocbNst5mY= +github.com/animenotifier/anilist v0.2.8 h1:slqsM2c6QL6AqRfUEyJP1Ha2Y7zArDG1+3KygoVKsz0= +github.com/animenotifier/anilist v0.2.8/go.mod h1:qCP/teRFZffvMnRndkVu00V3roDgnA0Fk/aJ1ernP6A= github.com/animenotifier/japanese v0.2.5 h1:3crv70AzmrTiJCI6SG9rUeFS2T3FXdxKwvRjjUa/74g= github.com/animenotifier/japanese v0.2.5/go.mod h1:Xmhi5U+JbRuqmHzFB1zTMfA3SM35hKmzC0Z2J2q8SH0= github.com/animenotifier/kitsu v0.2.4 h1:YFVUR0EPSbSljjgEWtf4Hz72cCFgGyxOpjPc+64EsWA= diff --git a/main_test.go b/main_test.go index 92c00a88..bc7a0d46 100644 --- a/main_test.go +++ b/main_test.go @@ -93,8 +93,8 @@ func TestQuotes(t *testing.T) { app.BindMiddleware() for quote := range arn.StreamQuotes() { - fetch(t, app, quote.Link()) assert.NotNil(t, quote.Creator()) + fetch(t, app, quote.Link()) } } diff --git a/server/middleware/UserInfo.go b/server/middleware/UserInfo.go index 3cfbe545..6ca29616 100644 --- a/server/middleware/UserInfo.go +++ b/server/middleware/UserInfo.go @@ -114,7 +114,7 @@ func updateUserLocation(user *arn.User, newIP string) { user.Location.ZipCode = newLocation.ZipCode // Make South Korea easier to read - if user.Location.CountryName == "Korea, Republic of" { + if user.Location.CountryName == "Korea, Republic of" || user.Location.CountryName == "Korea (Republic of)" { user.Location.CountryName = "South Korea" } diff --git a/utils/routetests/All.go b/utils/routetests/All.go index f6728e59..70b502e9 100644 --- a/utils/routetests/All.go +++ b/utils/routetests/All.go @@ -6,55 +6,55 @@ var routeTests = map[string][]string{ "/+Akyoto", }, - // "/user/:nick/characters/liked": []string{ - // "/+Akyoto/characters/liked", - // }, + "/user/:nick/characters/liked": { + "/+Akyoto/characters/liked", + }, - // "/user/:nick/forum/threads": []string{ + // "/user/:nick/forum/threads": { // "/+Akyoto/forum/threads", // }, - // "/user/:nick/forum/posts": []string{ + // "/user/:nick/forum/posts": { // "/+Akyoto/forum/posts", // }, - // "/user/:nick/soundtracks/added": []string{ + // "/user/:nick/soundtracks/added": { // "/+Akyoto/soundtracks/added", // }, - // "/user/:nick/soundtracks/added/from/:index": []string{ + // "/user/:nick/soundtracks/added/from/:index": { // "/+Akyoto/soundtracks/added/from/3", // }, - // "/user/:nick/soundtracks/liked": []string{ + // "/user/:nick/soundtracks/liked": { // "/+Akyoto/soundtracks/liked", // }, - // "/user/:nick/soundtracks/liked/from/:index": []string{ + // "/user/:nick/soundtracks/liked/from/:index": { // "/+Akyoto/soundtracks/liked/from/3", // }, - // "/user/:nick/quotes/added": []string{ + // "/user/:nick/quotes/added": { // "/+Scott/quotes/added", // }, - // "/user/:nick/quotes/added/from/:index": []string{ + // "/user/:nick/quotes/added/from/:index": { // "/+Scott/quotes/added/from/3", // }, - // "/user/:nick/quotes/liked": []string{ + // "/user/:nick/quotes/liked": { // "/+Scott/quotes/liked", // }, - // "/user/:nick/quotes/liked/from/:index": []string{ + // "/user/:nick/quotes/liked/from/:index": { // "/+Scott/quotes/liked/from/3", // }, - // "/user/:nick/followers": []string{ + // "/user/:nick/followers": { // "/+Akyoto/followers", // }, - // "/user/:nick/stats": []string{ + // "/user/:nick/stats": { // "/+Akyoto/stats", // }, @@ -247,14 +247,6 @@ var routeTests = map[string][]string{ "/episode/oFlqThKWga", }, - // "/kitsu/character/:id": []string{ - // "/kitsu/character/6556", - // }, - - // "/mal/character/:id": []string{ - // "/mal/character/498", - // }, - "/compare/animelist/:nick-1/:nick-2": { "/compare/animelist/Akyoto/Scott", }, @@ -396,81 +388,6 @@ var routeTests = map[string][]string{ "/_/search/dragon": { "/_/search/dragon", }, - - // Disable these tests because they require authorization - "/auth/google": nil, - "/auth/google/callback": nil, - "/auth/facebook": nil, - "/auth/facebook/callback": nil, - "/auth/twitter": nil, - "/auth/twitter/callback": nil, - "/dashboard": nil, - "/import": nil, - "/import/anilist/animelist": nil, - "/import/anilist/animelist/finish": nil, - "/import/myanimelist/animelist": nil, - "/import/myanimelist/animelist/finish": nil, - "/import/kitsu/animelist": nil, - "/import/kitsu/animelist/finish": nil, - "/animelist/watching": nil, - "/animelist/completed": nil, - "/animelist/planned": nil, - "/animelist/hold": nil, - "/animelist/dropped": nil, - "/notifications": nil, - "/user/:nick/notifications": nil, - "/user/:nick/edit": nil, - "/user/:nick/log": nil, - "/user/:nick/log/from/:index": nil, - "/editor/soundtracks/file": nil, - "/editor/soundtracks/links": nil, - "/editor/soundtracks/lyrics/missing": nil, - "/editor/soundtracks/lyrics/unaligned": nil, - "/editor/soundtracks/tags": nil, - "/api/test/notification": nil, - "/api/paypal/payment/create": nil, - "/api/emailtouser/:id": nil, - "/api/pushsubscriptions/:id/get/:item": nil, - "/api/pushsubscriptions/:id/get/:item/:property": nil, - "/api/count/notifications/unseen": nil, - "/api/mark/notifications/seen": nil, - "/api/sse/events": nil, - "/editor/kitsu/new/anime": nil, - "/paypal/success": nil, - "/paypal/cancel": nil, - "/anime/:id/edit": nil, - "/anime/:id/edit/images": nil, - "/anime/:id/edit/characters": nil, - "/anime/:id/edit/relations": nil, - "/anime/:id/edit/episodes": nil, - "/anime/:id/edit/history": nil, - "/new/thread": nil, - "/thread/:id/edit": nil, - "/post/:id/edit": nil, - "/company/:id/edit": nil, - "/admin/purchases": nil, - "/admin/registrations": nil, - "/admin/payments": nil, - "/editor/anilist": nil, - "/editor/shoboi": nil, - "/dark-flame-master": nil, - "/groups/joined": nil, - "/user": nil, - "/settings": nil, - "/settings/accounts": nil, - "/settings/notifications": nil, - "/settings/info": nil, - "/settings/style": nil, - "/settings/extras": nil, - "/shop": nil, - "/shop/history": nil, - "/support": nil, - "/charge": nil, - "/log": nil, - "/log/from/:index": nil, - "/inventory": nil, - "/extension/embed": nil, - "/welcome": nil, } // All returns which specific routes to test for a given generic route.