small fix

This commit is contained in:
daniel31x13
2025-06-28 13:10:53 -04:00
parent a05fbd7141
commit 3e015fa76c
2 changed files with 21 additions and 6 deletions

View File

@@ -36,10 +36,7 @@ jobs:
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
git rebase --committer-date-is-author-date \
--exec 'git commit --amend --no-edit --allow-empty \
--author="LinkwardenBot <bot@linkwarden.app>"' \
"$BASE_SHA"
git rebase --committer-date-is-author-date --exec 'git commit --amend --no-edit --allow-empty --author="LinkwardenBot <bot@linkwarden.app>"' "$BASE_SHA"
- name: Push rewritten history
run: git push --force-with-lease origin HEAD:i18n

View File

@@ -20,6 +20,8 @@ export default async function importFromPocket(
skipEmptyLines: true,
}).data as PocketBackup;
console.log("tags", data);
const backup = data.filter((e) => e.url);
let totalImports = backup.length;
@@ -65,8 +67,8 @@ export default async function importFromPocket(
await prisma.link.create({
data: {
url: link.url?.trim().slice(0, 2047),
name: link.title?.trim().slice(0, 254) || "",
url: link.url?.slice(0, 2047).trim(),
name: link.title?.slice(0, 254).trim() || "",
importDate: link.time_added
? new Date(Number(link.time_added) * 1000).toISOString()
: null,
@@ -75,6 +77,22 @@ export default async function importFromPocket(
id: newCollection.id,
},
},
tags: {
connectOrCreate: link?.tags
? link.tags.split("|").map((tag) => ({
where: {
name_ownerId: {
name: tag?.slice(0, 50).trim() || "",
ownerId: userId,
},
},
create: {
name: tag?.slice(0, 50).trim() || "",
ownerId: userId,
},
}))
: [],
},
createdBy: {
connect: {
id: userId,