feat(server): add DefaultShareExpiration config option (#4082)

* add DefaultShareExpiration config option

* run prettier so that I can push

* undo reformatting

* sort imports
This commit is contained in:
Caio Cotts
2025-05-20 22:17:30 -04:00
committed by GitHub
parent 453630d430
commit fef1739c1a
2 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -8,6 +8,7 @@ import (
"github.com/Masterminds/squirrel"
"github.com/deluan/rest"
gonanoid "github.com/matoous/go-nanoid/v2"
"github.com/navidrome/navidrome/conf"
"github.com/navidrome/navidrome/log"
"github.com/navidrome/navidrome/model"
. "github.com/navidrome/navidrome/utils/gg"
@@ -93,7 +94,7 @@ func (r *shareRepositoryWrapper) Save(entity interface{}) (string, error) {
}
s.ID = id
if V(s.ExpiresAt).IsZero() {
s.ExpiresAt = P(time.Now().Add(365 * 24 * time.Hour))
s.ExpiresAt = P(time.Now().Add(conf.Server.DefaultShareExpiration))
}
firstId := strings.SplitN(s.ResourceIDs, ",", 2)[0]