fix: Put OCR pages into correct order (#38)

A race condition caused the pages to be in a mixed order.
This commit is contained in:
Icereed 2024-10-28 23:05:25 +01:00 committed by GitHub
parent 2d13913b3a
commit def89b5aea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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
}