Update paperless.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Icereed 2025-01-07 16:42:45 +01:00 committed by GitHub
parent 98fb0e2e49
commit 29960013ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {