chore(caldav): improve trimming .ics file ending

This commit is contained in:
kolaente 2023-09-07 15:52:37 +02:00
parent e34f503674
commit c5c74e9537
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 1 additions and 3 deletions

View File

@ -133,9 +133,7 @@ func (vcls *VikunjaCaldavProjectStorage) GetResourcesByList(rpaths []string) ([]
var uids []string
for _, path := range rpaths {
parts := strings.Split(path, "/")
uid := []rune(parts[4]) // The 4th part is the id with ".ics" suffix
endlen := len(uid) - len(".ics") // ".ics" are 4 bytes
uids = append(uids, string(uid[:endlen]))
uids = append(uids, strings.TrimSuffix(parts[4], ".ics"))
}
s := db.NewSession()