mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-16 23:01:06 +02:00
refactor: enhance Google Drive indexer to support file extension filtering, improving file handling and error reporting
This commit is contained in:
parent
0fb92b7c56
commit
f03bf05aaa
3 changed files with 46 additions and 15 deletions
|
|
@ -25,7 +25,10 @@ from app.connectors.google_drive import (
|
|||
get_files_in_folder,
|
||||
get_start_page_token,
|
||||
)
|
||||
from app.connectors.google_drive.file_types import should_skip_file as skip_mime
|
||||
from app.connectors.google_drive.file_types import (
|
||||
should_skip_by_extension,
|
||||
should_skip_file as skip_mime,
|
||||
)
|
||||
from app.db import Document, DocumentStatus, DocumentType, SearchSourceConnectorType
|
||||
from app.indexing_pipeline.connector_document import ConnectorDocument
|
||||
from app.indexing_pipeline.document_hashing import compute_identifier_hash
|
||||
|
|
@ -78,6 +81,8 @@ async def _should_skip_file(
|
|||
|
||||
if skip_mime(mime_type):
|
||||
return True, "folder/shortcut"
|
||||
if should_skip_by_extension(file_name):
|
||||
return True, "unsupported extension"
|
||||
if not file_id:
|
||||
return True, "missing file_id"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue