File tree Expand file tree Collapse file tree
weko-deposit/weko_deposit
weko-search-ui/weko_search_ui
nginx/ams/weko-frontend/pages/ams Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737 'text/tab-separated-values' ,
3838 'text/xml' ,
3939 'application/x-tex' ,
40- 'application/x-latex'
40+ 'application/x-latex' ,
41+ 'text/markdown' ,
42+ 'application/json' ,
43+ 'application/ld+json' ,
44+ 'text/vnd.yaml' ,
45+ 'text/yaml' ,
46+ 'text/x-yaml' ,
47+ 'application/x-yaml'
4148]
4249
4350WEKO_MIMETYPE_WHITELIST_FOR_ES = [
5158 'application/vnd.openxmlformats-officedocument.presentationml.presentation' ,
5259 'application/vnd.oasis.opendocument.presentation' ,
5360 'application/pdf' ,
61+ 'application/rtf' ,
5462] + WEKO_DEPOSIT_TEXTMIMETYPE_WHITELIST_FOR_ES
5563
5664
Original file line number Diff line number Diff line change @@ -1930,6 +1930,7 @@ def extract_text_from_files(self, filename):
19301930 Returns:
19311931 str: The extracted text content from the file.
19321932 """
1933+
19331934 data_path = self .data_path + "/data"
19341935 try :
19351936 file_path = os .path .join (data_path , filename )
@@ -1942,7 +1943,7 @@ def extract_text_from_files(self, filename):
19421943 text_mimetypes = current_app .config ["WEKO_DEPOSIT_TEXTMIMETYPE_WHITELIST_FOR_ES" ]
19431944 # All mimetypes subject to text extraction (including text_mimetypes)
19441945 extract_mimetypes = current_app .config ["WEKO_MIMETYPE_WHITELIST_FOR_ES" ]
1945- if mimetype not in extract_mimetypes :
1946+ if mimetype not in ( extract_mimetypes + text_mimetypes ) :
19461947 return data
19471948
19481949 # Extract content from file
@@ -1973,6 +1974,11 @@ def extract_text_from_files(self, filename):
19731974 current_app .logger .error (e )
19741975 traceback .print_exc ()
19751976 raise PdfiumError (f"Failed to load PDF file: { filename } " ) from e
1977+ except Exception as e :
1978+ current_app .logger .error (e )
1979+ traceback .print_exc ()
1980+ raise ValueError (f"Failed to load file: { filename } " ) from e
1981+
19761982 return data
19771983
19781984 def to_rocrate_metadata (
Original file line number Diff line number Diff line change 101101 </div >
102102 </div >
103103 <!-- ダウンロードランキング -->
104+ <!--
104105 <div class="bg-miby-light-blue py-3 pl-5">
105106 <p class="icons icon-dl-rank text-white font-bold">
106107 {{ $t('detailDLRank') }}
107108 </p>
108109 </div>
109110 <DownloadRank v-if="renderFlag && !isError" :current-number="currentNumber" @error="setError" />
111+ -->
110112 <!-- エクスポート -->
111113 <div class =" bg-miby-light-blue py-3 pl-5" >
112114 <p class =" icons icon-export text-white font-bold" >
You can’t perform that action at this time.
0 commit comments