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

refactoring asset types #253

Merged
merged 2 commits into from
Jun 29, 2024
Merged

Conversation

kamtschatka
Copy link
Collaborator

Extracted out functions to silently delete assets and to update them after crawling
Generalized the mapping of assets to bookmark fields to make extending them easier

Extracted out functions to silently delete assets and to update them after crawling
Generalized the mapping of assets to bookmark fields to make extending them easier
*/
export async function silentDeleteAsset(
userId: string,
assetId: string | undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh, not convinced that an API in assetdb that's called silentDeleteAsset accepts an optional assetId. If we really care about this, I'd move it as a helper function in crawlerWorker. Not sure it's worth it.

@@ -5,9 +5,11 @@ import type { Job } from "bullmq";
import type { Browser } from "puppeteer";
import { Readability } from "@mozilla/readability";
import { Mutex } from "async-mutex";
import Database from "better-sqlite3";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should leak better-sqlite3 here. I'll re-export the type that we need from packages/db.

@MohamedBassem MohamedBassem merged commit ccbff18 into hoarder-app:main Jun 29, 2024
3 checks passed
@kamtschatka kamtschatka deleted the refactoring branch July 1, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants