Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release #173

Merged
merged 3 commits into from
Jan 4, 2024
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
14 changes: 10 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class OmnivorePlugin extends Plugin {

this.addCommand({
id: "sync",
name: "Sync",
name: "Sync new changes",
callback: () => {
this.fetchOmnivore()
},
Expand Down Expand Up @@ -102,6 +102,9 @@ export default class OmnivorePlugin extends Plugin {
this.addSettingTab(new OmnivoreSettingTab(this.app, this))

this.scheduleSync()

// sync when the app is loaded
await this.fetchOmnivore()
}

onunload() {}
Expand Down Expand Up @@ -454,13 +457,14 @@ class OmnivoreSettingTab extends PluginSettingTab {

new Setting(containerEl)
.setName("Filter")
.setDesc("Select an Omnivore search filter type")
.setDesc("Select an Omnivore search filter type. Changing this would reset the 'Last sync' timestamp")
.addDropdown((dropdown) => {
dropdown.addOptions(Filter)
dropdown
.setValue(this.plugin.settings.filter)
.onChange(async (value) => {
this.plugin.settings.filter = value
this.plugin.settings.syncAt = ""
await this.plugin.saveSettings()
})
})
Expand All @@ -475,7 +479,8 @@ class OmnivoreSettingTab extends PluginSettingTab {
text: "https://docs.omnivore.app/using/search",
href: "https://docs.omnivore.app/using/search",
}),
" for more info on search query syntax. Make sure your Filter (in the section above) is set to advanced when using a custom query."
" for more info on search query syntax. Make sure your Filter (in the section above) is set to advanced when using a custom query.",
" Changing this would reset the 'Last Sync' timestamp"
)
})
)
Expand All @@ -487,13 +492,14 @@ class OmnivoreSettingTab extends PluginSettingTab {
.setValue(this.plugin.settings.customQuery)
.onChange(async (value) => {
this.plugin.settings.customQuery = value
this.plugin.settings.syncAt = ""
await this.plugin.saveSettings()
})
)

new Setting(containerEl)
.setName("Last Sync")
.setDesc("Last time the plugin synced with Omnivore")
.setDesc("Last time the plugin synced with Omnivore. The 'Sync' command fetches articles updated after this timestamp")
.addMomentFormat((momentFormat) =>
momentFormat
.setPlaceholder("Last Sync")
Expand Down
2 changes: 1 addition & 1 deletion src/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const DEFAULT_SETTINGS: OmnivoreSettings = {
dateHighlightedFormat: 'yyyy-MM-dd HH:mm:ss',
dateSavedFormat: 'yyyy-MM-dd HH:mm:ss',
apiKey: '',
filter: 'HIGHLIGHTS',
filter: 'ALL',
syncAt: '',
customQuery: '',
template: DEFAULT_TEMPLATE,
Expand Down
4 changes: 2 additions & 2 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@
): string => {
switch (filter) {
case "ALL":
return ""
return "in:all"
case "HIGHLIGHTS":
return `has:highlights`
return `has:highlights in:all`
case "ADVANCED":
return customQuery
default:
Expand Down Expand Up @@ -152,7 +152,7 @@
}

export const findFrontMatterIndex = (
frontMatter: any[],

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 16.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 14.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 19.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 16.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 14.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 19.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 14.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 16.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 19.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 19.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 14.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 16.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 18.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 18.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 16.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 19.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest, 14.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 18.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 16.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 14.x)

Unexpected any. Specify a different type

Check warning on line 155 in src/util.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 19.x)

Unexpected any. Specify a different type
id: string
): number => {
// find index of front matter with matching id
Expand Down
Loading