Move wordlist and increase file limit
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user