fix: Put OCR pages into correct order

A race condition caused the pages to be
in a mixed order.
This commit is contained in:
Dominik Schröter 2024-10-28 22:51:04 +01:00
parent 2d13913b3a
commit 8d1580d106

View file

@ -11,6 +11,7 @@ import (
"net/http"
"os"
"path/filepath"
"slices"
"strings"
"sync"
@ -411,6 +412,9 @@ func (c *PaperlessClient) DownloadDocumentAsImages(ctx context.Context, document
return nil, err
}
// sort the image paths to ensure they are in order
slices.Sort(imagePaths)
return imagePaths, nil
}