refactor: use std lib trimsuffix

This commit is contained in:
Jan Bader
2025-01-28 15:08:08 +01:00
parent 224a6bc9af
commit 8e86f9eb9a
3 changed files with 4 additions and 16 deletions

View File

@ -21,7 +21,7 @@ func newMediaElement(p string) *mediaElement {
dir := filepath.Dir(p)
name := filepath.Base(p)
ext := filepath.Ext(name)
name = trimSuffix(name, ext)
name = strings.TrimSuffix(name, ext)
name = strings.ReplaceAll(name, ".", " ")
dash := strings.Index(name, "-")