Revert "Bump golang.org/x/exp, change slices.SortFunc function call"

This reverts commit 474f32f1
This commit is contained in:
Deluan 2023-11-24 17:57:22 -05:00
parent 069da5d91c
commit 21f1354cd1
4 changed files with 5 additions and 7 deletions

View file

@ -1,7 +1,6 @@
package model
import (
"cmp"
"time"
"github.com/navidrome/navidrome/utils/slice"
@ -85,7 +84,7 @@ func (als Albums) ToAlbumArtist() Artist {
a.Genres = append(a.Genres, al.Genres...)
mbzArtistIds = append(mbzArtistIds, al.MbzAlbumArtistID)
}
slices.SortFunc(a.Genres, func(a, b Genre) int { return cmp.Compare(a.ID, b.ID) })
slices.SortFunc(a.Genres, func(a, b Genre) bool { return a.ID < b.ID })
a.Genres = slices.Compact(a.Genres)
a.MbzArtistID = slice.MostFrequent(mbzArtistIds)

View file

@ -1,7 +1,6 @@
package model
import (
"cmp"
"mime"
"path/filepath"
"sort"
@ -172,7 +171,7 @@ func (mfs MediaFiles) ToAlbum() Album {
a.Comment, _ = allOrNothing(comments)
a.Comment, _ = allOrNothing(comments)
a.Genre = slice.MostFrequent(a.Genres).Name
slices.SortFunc(a.Genres, func(a, b Genre) int { return cmp.Compare(a.ID, b.ID) })
slices.SortFunc(a.Genres, func(a, b Genre) bool { return a.ID < b.ID })
a.Genres = slices.Compact(a.Genres)
a.FullText = " " + utils.SanitizeStrings(fullText...)
a = fixAlbumArtist(a, albumArtistIds)