mirror of
https://github.com/icereed/paperless-gpt.git
synced 2025-03-13 05:08:01 -05:00
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:
parent
2d13913b3a
commit
def89b5aea
1 changed files with 4 additions and 0 deletions
|
@ -11,6 +11,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
@ -411,6 +412,9 @@ func (c *PaperlessClient) DownloadDocumentAsImages(ctx context.Context, document
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sort the image paths to ensure they are in order
|
||||||
|
slices.Sort(imagePaths)
|
||||||
|
|
||||||
return imagePaths, nil
|
return imagePaths, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue