这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions server/models/documentSyncQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ const DocumentSyncQueue = {
* @returns {boolean} - true if the document can be watched, false otherwise
*/
canWatch: function ({ title, chunkSource = null } = {}) {
if (!chunkSource) return false;

if (chunkSource.startsWith("link://") && title.endsWith(".html"))
return true; // If is web-link material (prior to feature most chunkSources were links://)
if (chunkSource.startsWith("youtube://")) return true; // If is a youtube link
Expand Down
9 changes: 4 additions & 5 deletions server/utils/files/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,6 @@ async function fileToPickerData({
const filename = path.basename(pathToFile);
const fileStats = fs.statSync(pathToFile);
const cachedStatus = await cachedVectorInformation(cachefilename, true);
const canWatchStatus = liveSyncAvailable
? DocumentSyncQueue.canWatch(metadata)
: false;

if (fileStats.size < FILE_READ_SIZE_THRESHOLD) {
const rawData = fs.readFileSync(pathToFile, "utf8");
Expand All @@ -381,7 +378,9 @@ async function fileToPickerData({
type: "file",
...metadata,
cached: cachedStatus,
canWatch: canWatchStatus,
canWatch: liveSyncAvailable
? DocumentSyncQueue.canWatch(metadata)
: false,
// pinnedWorkspaces: [], // This is the list of workspaceIds that have pinned this document
// watched: false, // boolean to indicate if this document is watched in ANY workspace
};
Expand Down Expand Up @@ -429,7 +428,7 @@ async function fileToPickerData({
type: "file",
...metadata,
cached: cachedStatus,
canWatch: canWatchStatus,
canWatch: liveSyncAvailable ? DocumentSyncQueue.canWatch(metadata) : false,
};
}

Expand Down