mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
Bump golang.org/x/exp, change slices.SortFunc function call
This commit is contained in:
parent
ecadcfb403
commit
474f32f1b8
4 changed files with 7 additions and 5 deletions
2
go.mod
2
go.mod
|
@ -45,7 +45,7 @@ require (
|
|||
github.com/stretchr/testify v1.8.4
|
||||
github.com/unrolled/secure v1.13.0
|
||||
github.com/xrash/smetrics v0.0.0-20200730060457-89a2a8a1fb0b
|
||||
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
|
||||
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
|
||||
golang.org/x/image v0.14.0
|
||||
golang.org/x/sync v0.5.0
|
||||
golang.org/x/text v0.14.0
|
||||
|
|
4
go.sum
4
go.sum
|
@ -416,8 +416,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
|
|||
golang.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-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
|
||||
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
|
||||
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/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=
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"cmp"
|
||||
"time"
|
||||
|
||||
"github.com/navidrome/navidrome/utils/slice"
|
||||
|
@ -84,7 +85,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) bool { return a.ID < b.ID })
|
||||
slices.SortFunc(a.Genres, func(a, b Genre) int { return cmp.Compare(a.ID, b.ID) })
|
||||
a.Genres = slices.Compact(a.Genres)
|
||||
a.MbzArtistID = slice.MostFrequent(mbzArtistIds)
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"cmp"
|
||||
"mime"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
|
@ -171,7 +172,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) bool { return a.ID < b.ID })
|
||||
slices.SortFunc(a.Genres, func(a, b Genre) int { return cmp.Compare(a.ID, b.ID) })
|
||||
a.Genres = slices.Compact(a.Genres)
|
||||
a.FullText = " " + utils.SanitizeStrings(fullText...)
|
||||
a = fixAlbumArtist(a, albumArtistIds)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue