Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
JoinTyang committed Aug 24, 2024
1 parent 6ddf735 commit dfe3671
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/file-chooser/file-chooser.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class FileChooser extends React.Component {
return results;
};

if (isPro && enableSeasearch && !enableElasticsearch) {
if (isPro) {
seafileAPI.aiSearchFiles(queryData, cancelToken).then(res => {
const filteredResults = filterCurrentRepo(res.data.results.filter(item => item.is_dir));
this.setState({
Expand Down
3 changes: 1 addition & 2 deletions seahub/api2/endpoints/metadata_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
from seahub.repo_metadata.models import RepoMetadata, RepoMetadataViews
from seahub.views import check_folder_permission
from seahub.repo_metadata.utils import add_init_metadata_task, gen_unique_id, init_metadata, \
get_sys_columns, update_docs_summary
get_sys_columns, update_docs_summary, get_file_download_token
from seahub.repo_metadata.metadata_server_api import MetadataServerAPI, list_metadata_view_records
from seahub.utils.timeutils import datetime_to_isoformat_timestr
from seahub.utils.repo import is_repo_admin
from seahub.ai.utils import get_file_download_token
from pysearpc import SearpcError
from seaserv import seafile_api

Expand Down
4 changes: 4 additions & 0 deletions seahub/repo_metadata/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from seahub.settings import SECRET_KEY, SEAFEVENTS_SERVER_URL, SEAFILE_AI_SECRET_KEY, SEAFILE_AI_SERVER_URL

from seaserv import seafile_api

def add_init_metadata_task(params):
payload = {'exp': int(time.time()) + 300, }
Expand Down Expand Up @@ -76,3 +77,6 @@ def update_docs_summary(repo_id, files_info_list):
}
resp = requests.post(url, json=params, headers=headers)
return resp

def get_file_download_token(repo_id, file_id, username):
return seafile_api.get_fileserver_access_token(repo_id, file_id, 'download', username, use_onetime=True)

0 comments on commit dfe3671

Please sign in to comment.