Skip to content

Commit

Permalink
fix(NextcloudBookmarks): Retrieve href if possible
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed May 11, 2024
1 parent fb0644c commit c4c28c7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib/adapters/NextcloudBookmarks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
data.map((bm) => {
const bookmark = {
id: bm.id as number | string,
url: bm.url as string,
url: bm.href || bm.url as string,
title: bm.title as string,
parentId: null,
location: ItemLocation.SERVER,
Expand Down Expand Up @@ -375,7 +375,7 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
id: item.id + ';' + folderId,
title: item.title,
parentId: folderId,
url: item.url,
url: item.href || item.url,
location: ItemLocation.SERVER,
})
} else if (item.type === 'folder') {
Expand Down Expand Up @@ -599,7 +599,7 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
return new Bookmark({
id: item.id + ';' + id,
title: item.title,
url: item.url,
url: item.href || item.url,
parentId: id,
location: ItemLocation.SERVER,
})
Expand Down Expand Up @@ -709,7 +709,7 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
return bm.folders.map((parentId) => {
return new Bookmark({
id: bm.id + ';' + parentId,
url: bm.url,
url: bm.href || bm.url,
title: bm.title,
parentId: parentId,
tags: bm.tags,
Expand Down Expand Up @@ -803,7 +803,7 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
const bms = await this._getBookmark(upstreamId)

const body = {
url: newBm.url,
...(this.hasFeatureJavascriptLinks ? {href: newBm.url} : {url: newBm.url}),
title: newBm.title,
folders: bms
.map((bm) => bm.parentId)
Expand Down

0 comments on commit c4c28c7

Please sign in to comment.