Fix all staticcheck errors that are not deprecations

This commit is contained in:
Jacalz
2025-09-17 22:39:36 +02:00
parent 08f335da44
commit ebc5b7e039
5 changed files with 15 additions and 22 deletions
+1 -3
View File
@@ -58,9 +58,7 @@ func init() {
return err
})
flag.Func("volume-adjust-pct", "adjusts volume up or down by the given percentage (positive or negative)", func(s string) error {
if strings.HasSuffix(s, "%") {
s = s[:len(s)-1]
}
s = strings.TrimSuffix(s, "%")
v, err := strconv.ParseFloat(s, 64)
VolumePctCLIArg = v
return err
@@ -22,11 +22,8 @@ func (s *subsonicMediaProvider) ArtistSortOrders() []string {
}
}
func filterArtistMatches(f mediaprovider.ArtistFilter, artist *subsonic.ArtistID3) bool {
if artist == nil {
return false
}
return true
func filterArtistMatches(_ mediaprovider.ArtistFilter, artist *subsonic.ArtistID3) bool {
return artist != nil
}
func (s *subsonicMediaProvider) IterateArtists(sortOrder string, filter mediaprovider.ArtistFilter) mediaprovider.ArtistIterator {
@@ -176,9 +173,7 @@ func (s *subsonicMediaProvider) artistFetchFnFromStandardSort(sortFn func([]*sub
}
var artists []*subsonic.ArtistID3
for _, idx := range idxs.Index {
for _, ar := range idx.Artist {
artists = append(artists, ar)
}
artists = append(artists, idx.Artist...)
}
artists = sortFn(artists)
return artists, nil
+7 -7
View File
@@ -24,18 +24,18 @@ const (
type SMTC struct{}
var smtcUnsupportedErr = errors.New("SMTC is not supported on this platformo")
var errSMTCUnsupported = errors.New("no support for SMTC on this platform")
func InitSMTCForWindow(hwnd uintptr) (*SMTC, error) {
return nil, smtcUnsupportedErr
return nil, errSMTCUnsupported
}
func (s *SMTC) SetEnabled(enabled bool) error {
return smtcUnsupportedErr
return errSMTCUnsupported
}
func (s *SMTC) SetThumbnail(filepath string) error {
return smtcUnsupportedErr
return errSMTCUnsupported
}
func (s *SMTC) OnButtonPressed(func(SMTCButton)) {}
@@ -45,13 +45,13 @@ func (s *SMTC) OnSeek(f func(millis int)) {}
func (s *SMTC) Shutdown() {}
func (s *SMTC) UpdatePlaybackState(state SMTCPlaybackState) error {
return smtcUnsupportedErr
return errSMTCUnsupported
}
func (s *SMTC) UpdateMetadata(title, artist string) error {
return smtcUnsupportedErr
return errSMTCUnsupported
}
func (s *SMTC) UpdatePosition(positionMillis, durationMillis int) error {
return smtcUnsupportedErr
return errSMTCUnsupported
}