From 5bcca61d595a7f5d44301895d367e5804ec1c766 Mon Sep 17 00:00:00 2001 From: Bram Date: Mon, 23 Mar 2026 17:17:57 +0100 Subject: [PATCH] Move wordlist and increase file limit --- internal/file/zip.go | 25 ++++++-------------- internal/util/worldlist.go | 47 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 internal/util/worldlist.go diff --git a/internal/file/zip.go b/internal/file/zip.go index 545fde4..51b6e80 100644 --- a/internal/file/zip.go +++ b/internal/file/zip.go @@ -1,6 +1,7 @@ package file import ( + "ResendIt/internal/util" "archive/zip" "crypto/rand" "errors" @@ -50,22 +51,10 @@ func randIndex(n int) int { } func cuteZipName(fileCount int) string { - adjectives := []string{ - "Cool", "Super", "Hot", "Spicy", "Sneaky", "Sleepy", "Tiny", "Mega", "Cosmic", "Silly", - "Cursed", "Blessed", "Wiggly", "Giga", "Chonky", "Shiny", "Angry", "Happy", "Soft", "Turbo", - } - 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) + adjective := util.RandomAdjective() + verb := util.RandomVerb() + thing := util.RandomThing() + return fmt.Sprintf("%d%s%s%s.zip", fileCount, adjective, verb, thing) } // 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 { return nil, errors.New("no files") } - if len(files) > 10 { - return nil, errors.New("too many files (max 10)") + if len(files) > 50 { + return nil, errors.New("too many files (max 50)") } folderID := uuid.NewString() diff --git a/internal/util/worldlist.go b/internal/util/worldlist.go new file mode 100644 index 0000000..e683ec4 --- /dev/null +++ b/internal/util/worldlist.go @@ -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))] +}