🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Revert "Bump golang.org/x/exp, change slices.SortFunc function call"
Deluan21f1354cd14e
diff --git a/go.mod b/go.modindex d15862ec8..c397b5b2b 100644--- a/go.mod+++ b/go.mod@@ -45,7 +45,7 @@ require (github.com/stretchr/testify v1.8.4github.com/unrolled/secure v1.13.0github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673- golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa+ golang.org/x/exp v0.0.0-20220722155223-a9213eeb770egolang.org/x/image v0.14.0golang.org/x/sync v0.5.0golang.org/x/text v0.14.0diff --git a/go.sum b/go.sumindex 03ef9f61c..239d9518a 100644--- a/go.sum+++ b/go.sum@@ -403,8 +403,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=-golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=-golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=+golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=+golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=golang.org/x/exp/shiny v0.0.0-20230515195305-f3d0a9c9a5cc h1:JMi0oO0NoPZTAzHSdkdUoHbdcLfo9nPtK37kzE6I3Hk=golang.org/x/exp/shiny v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:UH99kUObWAZkDnWqppdQe5ZhPYESUw8I0zVV1uWBR+0=golang.org/x/image v0.0.0-20190220214146-31aff87c08e9/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=diff --git a/model/album.go b/model/album.goindex c7fa5c8f8..cae0f427a 100644--- a/model/album.go+++ b/model/album.go@@ -1,7 +1,6 @@package modelimport (- "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)diff --git a/model/mediafile.go b/model/mediafile.goindex fc54867ff..71951d587 100644--- a/model/mediafile.go+++ b/model/mediafile.go@@ -1,7 +1,6 @@package modelimport (- "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)