Merge branch 'master' into ldap_auth

This commit is contained in:
2025-09-21 06:37:41 +02:00
68 changed files with 1411 additions and 644 deletions

No files matched your search

+10 -7
View File
@@ -67,7 +67,7 @@ func (db *DB) InsertBulkLeftMany(table string, head []string, left int, col []in
return nil
}
var rows []string
var values []interface{}
var values []any
for _, c := range col {
rows = append(rows, "(?, ?)")
values = append(values, left, c)
@@ -138,10 +138,7 @@ func (db *DB) TransactionChunked(data []int64, cb func(*DB, []int64) error) erro
const size = 999
return db.Transaction(func(tx *DB) error {
for i := 0; i < len(data); i += size {
end := i + size
if end > len(data) {
end = len(data)
}
end := min(i+size, len(data))
if err := cb(tx, data[i:end]); err != nil {
return err
}
@@ -235,6 +232,7 @@ type Track struct {
TagTrackNumber int `sql:"default: null"`
TagDiscNumber int `sql:"default: null"`
TagBrainzID string `sql:"default: null"`
TagLyrics string `sql:"default:null"`
ReplayGainTrackGain float32
ReplayGainTrackPeak float32
@@ -339,6 +337,8 @@ type Album struct {
TagTitleUDec string `sql:"default: null"`
TagBrainzID string `sql:"default: null"`
TagYear int `sql:"default: null"`
TagCompilation bool `sql:"default: null"`
TagReleaseType string `sql:"default: null"`
Tracks []*Track
ChildCount int `sql:"-"`
Duration int `sql:"-"`
@@ -475,6 +475,7 @@ type Podcast struct {
Episodes []*PodcastEpisode
AutoDownload PodcastAutoDownload
RootDir string
Author string
}
func (p *Podcast) SID() *specid.ID {
@@ -508,6 +509,8 @@ type PodcastEpisode struct {
Status PodcastEpisodeStatus
Error string
Podcast *Podcast
Artist string
Album string
}
func (pe *PodcastEpisode) AudioLength() int { return pe.Length }
@@ -637,8 +640,8 @@ func Dump(ctx context.Context, db *gorm.DB, to string) error {
}
defer connDest.Close()
err = connDest.Raw(func(connDest interface{}) error {
return connSrc.Raw(func(connSrc interface{}) error {
err = connDest.Raw(func(connDest any) error {
return connSrc.Raw(func(connSrc any) error {
connDestq := connDest.(*sqlite3.SQLiteConn)
connSrcq := connSrc.(*sqlite3.SQLiteConn)
bk, err := connDestq.Backup("main", connSrcq, "main")