mirror of
https://github.com/icereed/paperless-gpt.git
synced 2025-03-14 13:48:00 -05:00
Update paperless.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
98fb0e2e49
commit
29960013ca
1 changed files with 1 additions and 1 deletions
|
@ -426,7 +426,7 @@ func (client *PaperlessClient) UpdateDocuments(ctx context.Context, documents []
|
||||||
// DownloadDocumentAsImages downloads the PDF file of the specified document and converts it to images
|
// DownloadDocumentAsImages downloads the PDF file of the specified document and converts it to images
|
||||||
func (client *PaperlessClient) DownloadDocumentAsImages(ctx context.Context, documentId int) ([]string, error) {
|
func (client *PaperlessClient) DownloadDocumentAsImages(ctx context.Context, documentId int) ([]string, error) {
|
||||||
// Create a directory named after the document ID
|
// Create a directory named after the document ID
|
||||||
docDir := filepath.Join(client.GetCacheFolder(), fmt.Sprintf("/document-%d", documentId))
|
docDir := filepath.Join(client.GetCacheFolder(), fmt.Sprintf("document-%d", documentId))
|
||||||
if _, err := os.Stat(docDir); os.IsNotExist(err) {
|
if _, err := os.Stat(docDir); os.IsNotExist(err) {
|
||||||
err = os.MkdirAll(docDir, 0755)
|
err = os.MkdirAll(docDir, 0755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue