Skip to content

Commit

Permalink
fixing logseq load note
Browse files Browse the repository at this point in the history
  • Loading branch information
Endle committed Sep 21, 2024
1 parent bc4b219 commit b007041
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fire_seq_search_server/debug_server_mac.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set -e
rm -f ./fire_seq_search_server
#nix-shell -p cargo -p rustc -p libiconv --run "cargo build"
cargo build
cargo build --features llm
cp target/debug/fire_seq_search_server ./fire_seq_search_server

export RUST_LOG="warn,fire_seq_search_server=info"
Expand Down
17 changes: 15 additions & 2 deletions fire_seq_search_server/src/load_notes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,24 @@ pub struct NoteListItem {
pub title: String,
}

use crate::query_engine::NotebookSoftware;
pub fn retrive_note_list(server_info: &ServerInformation) -> Vec<NoteListItem> {
let path: &str = &server_info.notebook_path;
let note_list = list_directory( Cow::from(path) , true);

let note_list = match &server_info.software {
NotebookSoftware::Obsidian => list_directory( Cow::from(path) , true),
NotebookSoftware::Logseq => {
let pp = path.to_string() + "/pages";
let mut pages = list_directory( Cow::from(pp), false );

// TODO Journal prefix
let pp = path.to_string() + "/journals";
let jours = list_directory( Cow::from(pp), false );

pages.extend(jours);
pages
},
};
// TODO didn't handle logseq
note_list
}
Expand Down Expand Up @@ -82,7 +96,6 @@ fn list_directory(path: Cow<'_, str>, recursive: bool) -> Vec<NoteListItem> {
};
result.push(row);
}

return result;
}

Expand Down

0 comments on commit b007041

Please sign in to comment.