diff options
| author | dakkar <dakkar@thenautilus.net> | 2024-02-03 12:55:46 +0000 |
|---|---|---|
| committer | dakkar <dakkar@thenautilus.net> | 2024-02-03 12:55:46 +0000 |
| commit | bb3694bfed3ac86ed9d4975800d76baf272c9817 (patch) | |
| tree | e851977bac45d6e9856fae7186eb8562ca3a91f3 /packages/backend/src/queue/processors | |
| parent | decode entity references from tweets (diff) | |
| download | sharkey-bb3694bfed3ac86ed9d4975800d76baf272c9817.tar.gz sharkey-bb3694bfed3ac86ed9d4975800d76baf272c9817.tar.bz2 sharkey-bb3694bfed3ac86ed9d4975800d76baf272c9817.zip | |
lint
Diffstat (limited to 'packages/backend/src/queue/processors')
| -rw-r--r-- | packages/backend/src/queue/processors/ImportNotesProcessorService.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/backend/src/queue/processors/ImportNotesProcessorService.ts b/packages/backend/src/queue/processors/ImportNotesProcessorService.ts index 44c92fabb6..5fb68f0a1a 100644 --- a/packages/backend/src/queue/processors/ImportNotesProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportNotesProcessorService.ts @@ -131,7 +131,7 @@ export class ImportNotesProcessorService { } @bindThis - private parseTwitterFile(str : string) : null | { tweet: object }[] { + private parseTwitterFile(str : string) : { tweet: object }[] { const jsonStr = str.replace(/^\s*window\.YTD\.tweets\.part0\s*=\s*/, ''); try { @@ -191,7 +191,7 @@ export class ImportNotesProcessorService { const unprocessedTweets = this.parseTwitterFile(await fs.promises.readFile(outputPath + '/data/tweets.js', 'utf-8')); - const tweets = unprocessedTweets.map(e=>e.tweet); + const tweets = unprocessedTweets.map(e => e.tweet); const processedTweets = await this.recreateChain(['id_str'], ['in_reply_to_status_id_str'], tweets, false); this.queueService.createImportTweetsToDbJob(job.data.user, processedTweets, null); } finally { @@ -584,7 +584,7 @@ export class ImportNotesProcessorService { try { const date = new Date(tweet.created_at); - const decodedText = tweet.full_text.replaceAll('>','>').replaceAll('<','<').replaceAll('&','&'); + const decodedText = tweet.full_text.replaceAll('>', '>').replaceAll('<', '<').replaceAll('&', '&'); const textReplaceURLs = tweet.entities.urls && tweet.entities.urls.length > 0 ? await replaceTwitterUrls(decodedText, tweet.entities.urls) : decodedText; const text = tweet.entities.user_mentions && tweet.entities.user_mentions.length > 0 ? await replaceTwitterMentions(textReplaceURLs, tweet.entities.user_mentions) : textReplaceURLs; const files: MiDriveFile[] = []; |