Move wordlist and increase file limit
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package file
|
package file
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"ResendIt/internal/util"
|
||||||
"archive/zip"
|
"archive/zip"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"errors"
|
"errors"
|
||||||
@@ -50,22 +51,10 @@ func randIndex(n int) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func cuteZipName(fileCount int) string {
|
func cuteZipName(fileCount int) string {
|
||||||
adjectives := []string{
|
adjective := util.RandomAdjective()
|
||||||
"Cool", "Super", "Hot", "Spicy", "Sneaky", "Sleepy", "Tiny", "Mega", "Cosmic", "Silly",
|
verb := util.RandomVerb()
|
||||||
"Cursed", "Blessed", "Wiggly", "Giga", "Chonky", "Shiny", "Angry", "Happy", "Soft", "Turbo",
|
thing := util.RandomThing()
|
||||||
}
|
return fmt.Sprintf("%d%s%s%s.zip", fileCount, adjective, verb, thing)
|
||||||
things := []string{
|
|
||||||
"Potato", "Griefers", "Raccoons", "Pigeons", "Wizards", "Ninjas", "Pickles", "Dragons", "Goblins", "Burgers",
|
|
||||||
"Pancakes", "Hamsters", "Bananas", "Comets", "Robots", "Cats", "Kiwis", "Frogs", "Cupcakes", "Sprites",
|
|
||||||
}
|
|
||||||
verbs := []string{
|
|
||||||
"Zoom", "Bonk", "Yeet", "Vibe", "Hack", "Spark", "Bounce", "Nibble", "Smuggle", "Cook",
|
|
||||||
}
|
|
||||||
|
|
||||||
a := adjectives[randIndex(len(adjectives))]
|
|
||||||
v := verbs[randIndex(len(verbs))]
|
|
||||||
t := things[randIndex(len(things))]
|
|
||||||
return fmt.Sprintf("%d%s%s%s.zip", fileCount, a, v, t)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// UploadBundle zips multiple uploaded files into a single .zip stored on disk and tracked as one FileRecord.
|
// UploadBundle zips multiple uploaded files into a single .zip stored on disk and tracked as one FileRecord.
|
||||||
@@ -73,8 +62,8 @@ func (s *Service) UploadBundle(files []*multipart.FileHeader, deleteAfterDownloa
|
|||||||
if len(files) == 0 {
|
if len(files) == 0 {
|
||||||
return nil, errors.New("no files")
|
return nil, errors.New("no files")
|
||||||
}
|
}
|
||||||
if len(files) > 10 {
|
if len(files) > 50 {
|
||||||
return nil, errors.New("too many files (max 10)")
|
return nil, errors.New("too many files (max 50)")
|
||||||
}
|
}
|
||||||
|
|
||||||
folderID := uuid.NewString()
|
folderID := uuid.NewString()
|
||||||
|
|||||||
47
internal/util/worldlist.go
Normal file
47
internal/util/worldlist.go
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
package util
|
||||||
|
|
||||||
|
import "math/rand"
|
||||||
|
|
||||||
|
var Adjectives = []string{
|
||||||
|
"Cool", "Super", "Hot", "Spicy", "Sneaky", "Sleepy", "Tiny", "Mega", "Cosmic", "Silly",
|
||||||
|
"Cursed", "Blessed", "Wiggly", "Giga", "Chonky", "Shiny", "Angry", "Happy", "Soft", "Turbo",
|
||||||
|
"Zany", "Snappy", "Fluffy", "Cranky", "Glitchy", "Bubbly", "Frosty", "Electric", "Jolly", "Mystic",
|
||||||
|
"Weird", "Chunky", "Psycho", "Cheesy", "Smelly", "Slippery", "Fiery", "Wacky", "Vivid", "Hyper",
|
||||||
|
"Soggy", "Grumpy", "Luminous", "Spooky", "Funky", "Twisted", "Nifty", "Prickly", "Velvet", "Epic",
|
||||||
|
"Glorious", "Majestic", "Quirky", "Radiant", "Sneaky", "Bouncy", "Mysterious", "Noodle", "Raging", "Zesty",
|
||||||
|
"Shimmering", "Fabled", "Plush", "Snazzy", "Stormy", "Gleaming", "Vibrant", "Odd", "Tasty", "Whimsical",
|
||||||
|
"Feral", "Clever", "Jumpy", "Dizzy", "Wicked", "Chilly", "Hasty", "Bizarre", "Snug", "Cheerful",
|
||||||
|
}
|
||||||
|
|
||||||
|
var Things = []string{
|
||||||
|
"Potato", "Griefers", "Raccoons", "Pigeons", "Wizards", "Ninjas", "Pickles", "Dragons", "Goblins", "Burgers",
|
||||||
|
"Pancakes", "Hamsters", "Bananas", "Comets", "Robots", "Cats", "Kiwis", "Frogs", "Cupcakes", "Sprites",
|
||||||
|
"Monsters", "Aliens", "Slimes", "Tacos", "Unicorns", "Ghosts", "Snails", "Vampires", "Donuts", "Owls",
|
||||||
|
"Zombies", "Mermaids", "Beavers", "Octopuses", "Chickens", "Penguins", "Mushrooms", "Felines", "Llamas", "Waffles",
|
||||||
|
"Baboons", "Dragettes", "Pixies", "Sharks", "Elephants", "Squirrels", "Gnomes", "Wombats", "Cacti", "Puppets",
|
||||||
|
"Koalas", "Moose", "Yeti", "Bats", "Crabs", "Otters", "Trolls", "Geckos", "Parrots", "Snakes",
|
||||||
|
"Sloths", "Clowns", "Jellyfish", "Froggies", "Dragoneers", "Nuggets", "Sprites", "Critters", "Knights", "Squids",
|
||||||
|
"Tigers", "Foxes", "Penguinos", "Burglebugs", "Clouds", "Fireflies", "Shrooms", "Mice", "Wizards", "Berries",
|
||||||
|
}
|
||||||
|
|
||||||
|
var Verbs = []string{
|
||||||
|
"Zoom", "Bonk", "Yeet", "Vibe", "Hack", "Spark", "Bounce", "Nibble", "Smuggle", "Cook",
|
||||||
|
"Flick", "Slap", "Whack", "Zap", "Blast", "Slam", "Twist", "Flip", "Slide", "Crash",
|
||||||
|
"Pop", "Fling", "Snatch", "Boing", "Sizzle", "Clap", "Roar", "Sniff", "Swoop", "Blink",
|
||||||
|
"Dodge", "Smash", "Roll", "Twirl", "Snore", "Drip", "Slurp", "Chomp", "Shuffle", "Juggle",
|
||||||
|
"Bounce", "Whirl", "Gush", "Spit", "Frolic", "Honk", "Wiggle", "Crackle", "Pounce", "Sprinkle",
|
||||||
|
"Slam", "Zoomerang", "Flop", "Squish", "Boop", "Whiz", "Flipflop", "Snip", "Glide", "Zapzap",
|
||||||
|
"Bop", "Wobble", "Fumble", "Twinkle", "Splash", "Dribble", "Clobber", "Whackadoo", "Bounceback", "Snizzle",
|
||||||
|
}
|
||||||
|
|
||||||
|
func RandomAdjective() string {
|
||||||
|
return Adjectives[rand.Intn(len(Adjectives))]
|
||||||
|
}
|
||||||
|
|
||||||
|
func RandomThing() string {
|
||||||
|
return Things[rand.Intn(len(Things))]
|
||||||
|
}
|
||||||
|
|
||||||
|
func RandomVerb() string {
|
||||||
|
return Verbs[rand.Intn(len(Verbs))]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user