diff --git a/komga-webui/src/locales/en.json b/komga-webui/src/locales/en.json
index 5c43e9ca7..eeedbfac0 100644
--- a/komga-webui/src/locales/en.json
+++ b/komga-webui/src/locales/en.json
@@ -152,6 +152,7 @@
"file": "FILE",
"format": "FORMAT",
"isbn": "ISBN",
+ "links": "LINKS",
"navigation_within_readlist": "Navigation within the readlist: {name}",
"outdated_tooltip": "The file for this book has changed, this book must be re-analyzed",
"read_book": "Read book",
@@ -306,12 +307,6 @@
"warning_html": "The read list {name} will be removed from this server. Your media files will not be affected. This cannot be undone. Continue?",
"warning_multiple_html": "{count} read lists will be removed from this server. Your media files will not be affected. This cannot be undone. Continue?"
},
- "delete_user": {
- "button_confirm": "Delete",
- "confirm_delete": "Yes, delete the user \"{name}\"",
- "dialog_title": "Delete User",
- "warning_html": "The user {name} will be deleted from this server. This cannot be undone. Continue?"
- },
"delete_series": {
"button_confirm": "Delete",
"confirm_delete": "Yes, delete series \"{name}\" and its files",
@@ -320,6 +315,12 @@
"warning_html": "The Series {name} will be removed from this server alongside with stored media files. This cannot be undone. Continue?",
"warning_multiple_html": "{count} series will be removed from this server alongside with stored media files. This cannot be undone. Continue?"
},
+ "delete_user": {
+ "button_confirm": "Delete",
+ "confirm_delete": "Yes, delete the user \"{name}\"",
+ "dialog_title": "Delete User",
+ "warning_html": "The user {name} will be deleted from this server. This cannot be undone. Continue?"
+ },
"edit_books": {
"authors_notice_multiple_edit": "You are editing authors for multiple books. This will override existing authors of each book.",
"button_cancel": "Cancel",
diff --git a/komga-webui/src/types/komga-books.ts b/komga-webui/src/types/komga-books.ts
index c90463646..df0f71b56 100644
--- a/komga-webui/src/types/komga-books.ts
+++ b/komga-webui/src/types/komga-books.ts
@@ -63,6 +63,8 @@ export interface BookMetadataDto {
tagsLock: boolean,
isbn: string,
isbnLock: boolean
+ links?: WebLinkDto[],
+ linksLock?: boolean
}
export interface ReadProgressDto {
@@ -100,6 +102,11 @@ export interface AuthorDto {
role: string
}
+export interface WebLinkDto {
+ label: string,
+ url: string
+}
+
export interface ReadProgressUpdateDto {
page?: number,
completed?: boolean
diff --git a/komga-webui/src/views/BrowseBook.vue b/komga-webui/src/views/BrowseBook.vue
index 7ee6e0bc5..45edc8c88 100644
--- a/komga-webui/src/views/BrowseBook.vue
+++ b/komga-webui/src/views/BrowseBook.vue
@@ -250,7 +250,9 @@
:key="role"
class="align-center text-caption"
>
- {{ $te(`author_roles.${role}`) ? $t(`author_roles.${role}`) : role }}
+
+ {{ $te(`author_roles.${role}`) ? $t(`author_roles.${role}`) : role }}
+
@@ -315,6 +317,32 @@
+
+ {{ $t('browse_book.links') }}
+
+
+ {{ link.label }}
+
+ mdi-open-in-new
+
+
+
+
+
{{ $t('browse_book.size') }}
{{ book.size }}
diff --git a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/BookDtoDao.kt b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/BookDtoDao.kt
index fd833412e..d96c1d8a4 100644
--- a/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/BookDtoDao.kt
+++ b/komga/src/main/kotlin/org/gotson/komga/infrastructure/jooq/BookDtoDao.kt
@@ -12,6 +12,7 @@ import org.gotson.komga.interfaces.api.rest.dto.BookDto
import org.gotson.komga.interfaces.api.rest.dto.BookMetadataDto
import org.gotson.komga.interfaces.api.rest.dto.MediaDto
import org.gotson.komga.interfaces.api.rest.dto.ReadProgressDto
+import org.gotson.komga.interfaces.api.rest.dto.WebLinkDto
import org.gotson.komga.jooq.Tables
import org.gotson.komga.jooq.tables.records.BookMetadataRecord
import org.gotson.komga.jooq.tables.records.BookRecord
@@ -49,6 +50,7 @@ class BookDtoDao(
private val s = Tables.SERIES
private val rlb = Tables.READLIST_BOOK
private val bt = Tables.BOOK_METADATA_TAG
+ private val bl = Tables.BOOK_METADATA_LINK
private val countUnread: AggregateFunction = DSL.sum(DSL.`when`(r.COMPLETED.isNull, 1).otherwise(0))
private val countRead: AggregateFunction = DSL.sum(DSL.`when`(r.COMPLETED.isTrue, 1).otherwise(0))
@@ -281,7 +283,13 @@ class BookDtoDao(
.where(bt.BOOK_ID.eq(br.id))
.fetchSet(bt.TAG)
- br.toDto(mr.toDto(), dr.toDto(authors, tags), if (rr.userId != null) rr.toDto() else null)
+ val links = dsl.select(bl.LABEL, bl.URL)
+ .from(bl)
+ .where(bl.BOOK_ID.eq(br.id))
+ .fetchInto(bl)
+ .map { WebLinkDto(it.label, it.url) }
+
+ br.toDto(mr.toDto(), dr.toDto(authors, tags, links), if (rr.userId != null) rr.toDto() else null)
}
private fun BookSearchWithReadProgress.toCondition(): Condition {
@@ -356,7 +364,7 @@ class BookDtoDao(
comment = comment ?: ""
)
- private fun BookMetadataRecord.toDto(authors: List, tags: Set) =
+ private fun BookMetadataRecord.toDto(authors: List, tags: Set, links: List) =
BookMetadataDto(
title = title,
titleLock = titleLock,
@@ -374,6 +382,8 @@ class BookDtoDao(
tagsLock = tagsLock,
isbn = isbn,
isbnLock = isbnLock,
+ links = links,
+ linksLock = linksLock,
created = createdDate,
lastModified = lastModifiedDate
)
diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/BookDto.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/BookDto.kt
index 1f84ee61d..61d57a925 100644
--- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/BookDto.kt
+++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/BookDto.kt
@@ -55,6 +55,8 @@ data class BookMetadataDto(
val tagsLock: Boolean,
val isbn: String,
val isbnLock: Boolean,
+ val links: List,
+ val linksLock: Boolean,
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
val created: LocalDateTime,
diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/WebLinkDto.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/WebLinkDto.kt
new file mode 100644
index 000000000..fb2c00f43
--- /dev/null
+++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/rest/dto/WebLinkDto.kt
@@ -0,0 +1,10 @@
+package org.gotson.komga.interfaces.api.rest.dto
+
+import org.gotson.komga.domain.model.WebLink
+
+data class WebLinkDto(
+ val label: String,
+ val url: String,
+)
+
+fun WebLink.toDto() = WebLinkDto(label, url.toString())