Skip to content

Commit

Permalink
Fix duplicate entries in journal review plugin (#169)
Browse files Browse the repository at this point in the history
* Fix duplicate entries in journal review plugin

Fixes #13

Update the `reduceTimeSpans` function in `src/constants.ts` to filter out duplicate entries when time spans overlap.

* Add a helper function `isDuplicateNote` to check for duplicate entries based on note paths.
* Modify the `reduceTimeSpans` function to use the `isDuplicateNote` helper function to filter out duplicate notes.
* Update the settings description in `src/settingsTab.ts` to inform users about overlapping time spans and potential duplicates.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Kageetai/obsidian-plugin-journal-review/issues/13?shareId=XXXX-XXXX-XXXX-XXXX).

* chore: prettier

* fix: install and use moment for generateNotes.ts

* chore: version

* chore: prettier

* chore: prettier

* fix: don't commit everything from workspace

* chore: npm audit fix
  • Loading branch information
Kageetai authored Oct 25, 2024
1 parent f27953f commit f4c430c
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 19 deletions.
6 changes: 0 additions & 6 deletions .devcontainer.json

This file was deleted.

2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "journal-review",
"name": "Journal Review",
"version": "2.4.4",
"version": "2.5.0",
"minAppVersion": "0.15.0",
"description": "Review your daily notes on their anniversaries, like \"what happened today last year\".",
"author": "Kageetai",
Expand Down
37 changes: 29 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-plugin-journal-review",
"version": "2.4.4",
"version": "2.5.0",
"description": "Review your daily notes on their anniversaries, like \"what happened today last year\"\n\n",
"main": "main.js",
"scripts": {
Expand All @@ -25,6 +25,7 @@
"eslint": "^9.13.0",
"globals": "^15.11.0",
"knip": "^5.33.3",
"moment": "^2.30.1",
"obsidian": "latest",
"prettier": "^3.2.5",
"ts-node": "^10.9.2",
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateNotes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mkdirSync, readFileSync, writeFileSync } from "fs";
import { moment } from "obsidian";
import * as moment from "moment";

interface PeriodicNotesSettings {
daily: {
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export const reduceTimeSpans = (
notes.filter(
(note) => !isDuplicateNote(note, acc[title].notes),
),
)
)
: notes,
};
}
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
"2.4.1": "0.15.0",
"2.4.2": "0.15.0",
"2.4.3": "0.15.0",
"2.4.4": "0.15.0"
"2.4.4": "0.15.0",
"2.5.0": "0.15.0"
}

0 comments on commit f4c430c

Please sign in to comment.