Reduced size of batches, to not break SQLite
This commit is contained in:
@@ -129,7 +129,7 @@ group by album_id order by f.id`, strings.Join(ids, "','"))
|
||||
}
|
||||
}
|
||||
if len(toInsert) > 0 {
|
||||
n, err := o.InsertMulti(100, toInsert)
|
||||
n, err := o.InsertMulti(10, toInsert)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ func (r *artistRepository) Get(id string) (*model.Artist, error) {
|
||||
// TODO Cache the index (recalculate when there are changes to the DB)
|
||||
func (r *artistRepository) GetIndex() (model.ArtistIndexes, error) {
|
||||
var all []artist
|
||||
// TODO Paginate
|
||||
_, err := r.newQuery(Db()).OrderBy("name").All(&all)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -133,7 +134,7 @@ where f.artist_id in ('%s') group by f.artist_id order by f.id`, strings.Join(id
|
||||
}
|
||||
}
|
||||
if len(toInsert) > 0 {
|
||||
n, err := o.InsertMulti(100, toInsert)
|
||||
n, err := o.InsertMulti(10, toInsert)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@ func (r *mediaFileRepository) FindByPath(path string) (model.MediaFiles, error)
|
||||
func (r *mediaFileRepository) DeleteByPath(path string) error {
|
||||
o := Db()
|
||||
var mfs []mediaFile
|
||||
// TODO Paginate this (and all other situations similar)
|
||||
_, err := r.newQuery(o).Filter("path__istartswith", path).OrderBy("disc_number", "track_number").All(&mfs)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user