Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
fix: broken unicode in strings on IG imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Mar0xy committed Nov 12, 2023
1 parent 486a2ad commit 8cad8f0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export class ImportNotesProcessorService {

if (post.media && this.isIterable(post.media) && post.media.length > 1) {
date = new Date(post.creation_timestamp * 1000);
title = post.title;
title = post.title.encode('latin-1').decode('utf-8');
for await (const file of post.media) {
const slashdex = file.uri.lastIndexOf('/');
const name = file.uri.substring(slashdex + 1);
Expand All @@ -377,7 +377,7 @@ export class ImportNotesProcessorService {
}
} else if (post.media && this.isIterable(post.media) && !(post.media.length > 1)) {
date = new Date(post.media[0].creation_timestamp * 1000);
title = post.media[0].title;
title = post.media[0].title.encode('latin-1').decode('utf-8');
const slashdex = post.media[0].uri.lastIndexOf('/');
const name = post.media[0].uri.substring(slashdex + 1);
const exists = await this.driveFilesRepository.findOneBy({ name: name, userId: user.id }) ?? await this.driveFilesRepository.findOneBy({ name: `${name}.jpg`, userId: user.id }) ?? await this.driveFilesRepository.findOneBy({ name: `${name}.mp4`, userId: user.id });
Expand Down

0 comments on commit 8cad8f0

Please sign in to comment.