mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 04:27:37 +03:00
Small optimization in MediaFiles.ToAlbum()
This commit is contained in:
parent
0488fb92cb
commit
ee73a9d297
1 changed files with 3 additions and 6 deletions
|
@ -198,15 +198,12 @@ func (mfs MediaFiles) ToAlbum() Album {
|
|||
}
|
||||
|
||||
func allOrNothing(items []string) (string, int) {
|
||||
sort.Strings(items)
|
||||
items = slices.Compact(items)
|
||||
if len(items) == 1 {
|
||||
return items[0], 1
|
||||
}
|
||||
if len(items) > 1 {
|
||||
sort.Strings(items)
|
||||
if len(items) != 1 {
|
||||
return "", len(slices.Compact(items))
|
||||
}
|
||||
return "", 0
|
||||
return items[0], 1
|
||||
}
|
||||
|
||||
func minMax(items []int) (int, int) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue