@xuda.io/drive_module 1.1.678 → 1.1.680
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +7 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1614,7 +1614,7 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1614
1614
|
// }${file_name}`;
|
|
1615
1615
|
// }
|
|
1616
1616
|
|
|
1617
|
-
let file_url = get_file_url(drive_type, file_name);
|
|
1617
|
+
let file_url = get_file_url(drive_type, file_name, ref);
|
|
1618
1618
|
|
|
1619
1619
|
await fs_module.unlink(tempPath);
|
|
1620
1620
|
|
|
@@ -1991,15 +1991,17 @@ exports.search_drive_files = async function (req) {
|
|
|
1991
1991
|
name: doc.originalname,
|
|
1992
1992
|
path: doc.server_file_name,
|
|
1993
1993
|
type: doc.is_folder ? "directory" : "file", //type ||
|
|
1994
|
-
file_url: get_file_url(drive_type, doc.server_file_name),
|
|
1994
|
+
file_url: get_file_url(drive_type, doc.server_file_name, ref),
|
|
1995
1995
|
mime: doc.mime,
|
|
1996
1996
|
file_ext: doc.file_ext.substr(1),
|
|
1997
1997
|
};
|
|
1998
1998
|
});
|
|
1999
1999
|
};
|
|
2000
2000
|
|
|
2001
|
+
var ref;
|
|
2001
2002
|
switch (drive_type) {
|
|
2002
2003
|
case "workspace": {
|
|
2004
|
+
ref = app_id;
|
|
2003
2005
|
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
2004
2006
|
search_results = alias_results(
|
|
2005
2007
|
(await db_module.find_app_couch_query(app_id_reference, opt)).docs
|
|
@@ -2008,6 +2010,7 @@ exports.search_drive_files = async function (req) {
|
|
|
2008
2010
|
}
|
|
2009
2011
|
|
|
2010
2012
|
case "user": {
|
|
2013
|
+
ref = uid;
|
|
2011
2014
|
search_results = alias_results(
|
|
2012
2015
|
(await db_module.find_couch_query("xuda_drive", opt)).docs
|
|
2013
2016
|
);
|
|
@@ -2015,6 +2018,7 @@ exports.search_drive_files = async function (req) {
|
|
|
2015
2018
|
}
|
|
2016
2019
|
|
|
2017
2020
|
case "studio": {
|
|
2021
|
+
ref = app_id;
|
|
2018
2022
|
const directoryPath = path.join(_conf[`studio_drive_path`], app_id);
|
|
2019
2023
|
|
|
2020
2024
|
const options = {
|
|
@@ -2456,7 +2460,7 @@ exports.update_drive_file_tags = async function (req, job_id, headers) {
|
|
|
2456
2460
|
}
|
|
2457
2461
|
};
|
|
2458
2462
|
|
|
2459
|
-
const get_file_url = function (drive_type, file_name) {
|
|
2463
|
+
const get_file_url = function (drive_type, file_name, ref) {
|
|
2460
2464
|
let file_url = `https://${
|
|
2461
2465
|
process.env.XUDA_HOSTNAME
|
|
2462
2466
|
}/${drive_type}-drive/${ref}${
|