mirror of
https://github.com/navidrome/navidrome.git
synced 2026-12-03 10:27:38 +00:00
Enforces the default staticcheck SA, S, ST and QF checks; fixed 76 sites (54 autofixed quick fixes, 22 by hand). Dot imports are allowed only for squirrel, the established query builder style in persistence. SA1019 is excluded for the deprecated plugins/types.SongRef wire fields the host still reads and writes for older plugins. Also fixes an off-by-one in the redactrus test levelThreshold helper that panicked one level past TraceLevel.
36 lines
693 B
Go
36 lines
693 B
Go
package metadata_test
|
|
|
|
import (
|
|
"io/fs"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/djherbis/times"
|
|
_ "github.com/mattn/go-sqlite3"
|
|
"github.com/navidrome/navidrome/conf/configtest"
|
|
"github.com/navidrome/navidrome/log"
|
|
"github.com/navidrome/navidrome/tests"
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
func TestMetadata(t *testing.T) {
|
|
tests.Init(t, true)
|
|
log.SetLevel(log.LevelFatal)
|
|
RegisterFailHandler(Fail)
|
|
RunSpecs(t, "Metadata Suite")
|
|
}
|
|
|
|
var _ = configtest.RestoreAfterEachSpec()
|
|
|
|
type testFileInfo struct {
|
|
fs.FileInfo
|
|
}
|
|
|
|
func (t testFileInfo) BirthTime() time.Time {
|
|
if ts := times.Get(t.FileInfo); ts.HasBirthTime() {
|
|
return ts.BirthTime()
|
|
}
|
|
return t.ModTime()
|
|
}
|