generate thumbnails

This commit is contained in:
m
2026-07-16 07:35:08 +02:00
parent 79c743722d
commit 10c07d2946
16 changed files with 608 additions and 28 deletions
+13
View File
@@ -37,6 +37,19 @@ func (s *URLService) GenerateDownloadURL(fileUUID string) string {
)
}
func (s *URLService) GenerateThumbnailURL(thumbUUID string) string {
expires := time.Now().Add(10 * time.Minute).Unix()
sig := s.sign(thumbUUID, expires)
return fmt.Sprintf(
"%s/api/v1/thumbnails/%s?expires=%d&sig=%s",
s.serverHost,
thumbUUID,
expires,
sig,
)
}
func (s *URLService) Validate(fileID, sig string, expires int64) bool {
if time.Now().Unix() > expires {
return false