mirror of
https://github.com/navidrome/navidrome.git
synced 2026-04-28 03:19:38 +00:00
refactor: simplify playlist name extraction using strings.CutPrefix
This commit is contained in:
parent
03608d3eef
commit
d91b5e8f4d
1 changed files with 2 additions and 2 deletions
|
|
@ -31,8 +31,8 @@ func (s *playlists) parseM3U(ctx context.Context, pls *model.Playlist, folder *m
|
|||
filteredLines := make([]string, 0, len(lines))
|
||||
for _, line := range lines {
|
||||
line := strings.TrimSpace(line)
|
||||
if strings.HasPrefix(line, "#PLAYLIST:") {
|
||||
pls.Name = line[len("#PLAYLIST:"):]
|
||||
if after, ok := strings.CutPrefix(line, "#PLAYLIST:"); ok {
|
||||
pls.Name = after
|
||||
continue
|
||||
}
|
||||
if after, ok := strings.CutPrefix(line, "#EXTALBUMARTURL:"); ok {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue