Skip to content

Commit

Permalink
feat: add user library
Browse files Browse the repository at this point in the history
  • Loading branch information
ahasverus committed Sep 23, 2024
1 parent aba790f commit 4c3396f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions R/get-zotero-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,15 @@ get_zotero_data <- function(path = "~/zotero") {
groups_id <- get_groups_id(conn)
collections_id <- get_collections_id(conn)

zotero <- merge(libraries_id, groups_id, by = "library_id", all = FALSE)
zotero <- merge(zotero, collections_id, by = "library_id", all = FALSE)
zotero <- merge(libraries_id, groups_id, by = "library_id", all = TRUE)
zotero <- merge(zotero, collections_id, by = "library_id", all = TRUE)


## Add user library ----

zotero$"group_name" <- ifelse(is.na(zotero$"group_name"),
"Main",
zotero$"group_name")


## Get items data ----
Expand All @@ -75,7 +82,6 @@ get_zotero_data <- function(path = "~/zotero") {
items_data_id <- get_items_data_id(conn)
items_data_values <- get_items_data_values(conn)

items <- merge(items_data_id, fields_id, by = "field_id", all = FALSE)
items <- merge(items_data_id, fields_id, by = "field_id", all = FALSE)
items <- merge(items, items_data_values, by = "value_id", all = FALSE)
items <- items[ , c("item_id", "field_name", "value")]
Expand Down

0 comments on commit 4c3396f

Please sign in to comment.