From e8469fdcc29ab5feb9fac49441c0b4e775a06a3f Mon Sep 17 00:00:00 2001 From: "aditya.chandel" Date: Sun, 20 Jul 2025 15:21:24 -0600 Subject: [PATCH 01/11] Add documentation website link --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ae1a5d192..a167f7976 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,16 @@ BookLore is a self-hosted web app for organizing and managing your personal book - πŸ“€ **Multi-Book Uploads** - Upload multiple books at once with metadata auto-detection and file organization. - πŸ“§ **Send Books via Email** - Share books directly with others by sending them via email – quick and easy. - πŸš€ **Continuous Improvements** - Frequent updates with new features, performance enhancements, and UI improvements. BookLore is perfect for self-hosters who want complete control over their digital library. Stay tuned for updates! -## πŸŽ₯ Video Guides & Tutorials -For a step-by-step walkthrough, check out the official BookLore video guides on YouTube: +## πŸš€ Getting Started with BookLore -πŸ“Ί [BookLore Tutorials – YouTube](https://www.youtube.com/watch?v=UMrn_fIeFRo&list=PLi0fq0zaM7lqY7dX0R66jQtKW64z4_Tdz) +Kick off your BookLore journey with our official documentation and helpful video guides. -These videos cover deployment, configuration, and feature highlights to help you get started quickly. +πŸ“˜ [BookLore Documentation: Getting Started](https://adityachandelgit.github.io/booklore-docs/docs/getting-started) +Our up-to-date docs walk you through installation, setup, configuration, and key features, everything you need to get up and running smoothly. + +πŸŽ₯ [BookLore Tutorials: YouTube](https://www.youtube.com/watch?v=UMrn_fIeFRo&list=PLi0fq0zaM7lqY7dX0R66jQtKW64z4_Tdz) +These older videos provide useful walkthroughs and visual guidance, but note that some content may be outdated compared to the current docs. ## 🐳 Deploy with Docker From a8ba7084778e782bb101f817a85cf5aabbdac49d Mon Sep 17 00:00:00 2001 From: rahairston Date: Mon, 21 Jul 2025 10:25:22 -0500 Subject: [PATCH 02/11] Adding minor code to Fix file permissions on Upload (#752) Adding permission changes to temp file to allow proper upload --- CONTRIBUTING.md | 2 +- .../service/upload/FileUploadService.java | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b4e021504..58ef1ae6e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -147,7 +147,7 @@ git checkout -b fix/my-fix - Follow code conventions, keep PRs focused and scoped - Link the relevant issue in your PR - Test your changes -- Target the `master` branch when opening PRs +- Target the `develop` branch when opening PRs --- diff --git a/booklore-api/src/main/java/com/adityachandel/booklore/service/upload/FileUploadService.java b/booklore-api/src/main/java/com/adityachandel/booklore/service/upload/FileUploadService.java index a8b649fc1..2b956c65a 100644 --- a/booklore-api/src/main/java/com/adityachandel/booklore/service/upload/FileUploadService.java +++ b/booklore-api/src/main/java/com/adityachandel/booklore/service/upload/FileUploadService.java @@ -22,14 +22,22 @@ import com.adityachandel.booklore.util.FileUtils; import com.adityachandel.booklore.util.PathPatternResolver; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; + +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import java.io.File; import java.io.IOException; +import java.nio.file.FileSystems; import java.nio.file.Files; +import java.nio.file.LinkOption; import java.nio.file.Path; import java.nio.file.Paths; +import java.nio.file.attribute.GroupPrincipal; +import java.nio.file.attribute.PosixFileAttributeView; +import java.nio.file.attribute.UserPrincipal; +import java.nio.file.attribute.UserPrincipalLookupService; import java.util.Objects; @RequiredArgsConstructor @@ -47,6 +55,12 @@ public class FileUploadService { private final EpubMetadataExtractor epubMetadataExtractor; private final MonitoringService monitoringService; + @Value("${PUID:0}") + private String userId; + + @Value("${GUID:0}") + private String groupId; + public Book uploadFile(MultipartFile file, long libraryId, long pathId) throws IOException { validateFile(file); @@ -70,6 +84,8 @@ public class FileUploadService { try { file.transferTo(tempPath); + + setTemporaryFileOwnership(tempPath); BookFileExtension fileExt = BookFileExtension.fromFileName(file.getOriginalFilename()).orElseThrow(() -> ApiError.INVALID_FILE_FORMAT.createException("Unsupported file extension")); @@ -138,6 +154,19 @@ public class FileUploadService { } } + private void setTemporaryFileOwnership(Path tempPath) throws IOException { + UserPrincipalLookupService lookupService = FileSystems.getDefault() + .getUserPrincipalLookupService(); + if (!userId.equals("0")) { + UserPrincipal user = lookupService.lookupPrincipalByName(userId); + Files.getFileAttributeView(tempPath, PosixFileAttributeView.class, LinkOption.NOFOLLOW_LINKS).setOwner(user); + } + if (!groupId.equals("0")) { + GroupPrincipal group = lookupService.lookupPrincipalByGroupName(groupId); + Files.getFileAttributeView(tempPath, PosixFileAttributeView.class, LinkOption.NOFOLLOW_LINKS).setGroup(group); + } + } + private Book processFile(String fileName, LibraryEntity libraryEntity, LibraryPathEntity libraryPathEntity, File storageFile, BookFileType fileType) { String subPath = FileUtils.getRelativeSubPath(libraryPathEntity.getPath(), storageFile.toPath()); From ca5a09f7404bec78f2b6dce4e89c765ab7324db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Tatl=C4=B1?= Date: Mon, 21 Jul 2025 18:31:39 +0300 Subject: [PATCH 03/11] Fix dark theme detection when has multiple classes (#747) --- .../src/assets/layout/styles/layout/variables/main/_dark.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/booklore-ui/src/assets/layout/styles/layout/variables/main/_dark.scss b/booklore-ui/src/assets/layout/styles/layout/variables/main/_dark.scss index a303eb599..3c9fce083 100644 --- a/booklore-ui/src/assets/layout/styles/layout/variables/main/_dark.scss +++ b/booklore-ui/src/assets/layout/styles/layout/variables/main/_dark.scss @@ -1,4 +1,4 @@ -:root[class="p-dark"] { +:root[class~="p-dark"] { --primary-text-color: var(--p-primary-400); --primary-text-color-dark: var(--p-primary-900); --primary-color: var(--p-primary-color); From 49c4519cf7c4022e4ca99dfe35bdbb6be8c59485 Mon Sep 17 00:00:00 2001 From: "aditya.chandel" Date: Mon, 21 Jul 2025 17:26:48 -0600 Subject: [PATCH 04/11] Persist cover scale preference per device using LocalStorage - Store cover scale preference locally to allow different settings per device (desktop, mobile) - Disabled backend saving for cover scale but kept code commented for future reference - Load scale preference from LocalStorage on init for faster and device-specific UX --- .../book-browser/book-browser.component.ts | 2 +- .../cover-scale-preference.service.ts | 44 ++++++++++++------- .../app/core/service/local-storage-service.ts | 25 +++++++++++ .../global-preferences.component.ts | 2 - 4 files changed, 54 insertions(+), 19 deletions(-) create mode 100644 booklore-ui/src/app/core/service/local-storage-service.ts diff --git a/booklore-ui/src/app/book/components/book-browser/book-browser.component.ts b/booklore-ui/src/app/book/components/book-browser/book-browser.component.ts index 5c4c52bf4..9b8615b58 100644 --- a/booklore-ui/src/app/book/components/book-browser/book-browser.component.ts +++ b/booklore-ui/src/app/book/components/book-browser/book-browser.component.ts @@ -275,7 +275,7 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { this.entityViewPreferences = user.userSettings?.entityViewPreferences; const globalPrefs = this.entityViewPreferences?.global; const currentEntityTypeStr = this.entityType ? this.entityType.toString().toUpperCase() : undefined; - this.coverScalePreferenceService.initScaleValue(user?.userSettings?.entityViewPreferences?.global?.coverSize); + this.coverScalePreferenceService.initScaleValue(this.coverScalePreferenceService.scaleFactor); this.filterSortPreferenceService.initValue(user?.userSettings?.filterSortingMode); this.columnPreferenceService.initPreferences(user.userSettings?.tableColumnPreference); this.visibleColumns = this.columnPreferenceService.visibleColumns; diff --git a/booklore-ui/src/app/book/components/book-browser/cover-scale-preference.service.ts b/booklore-ui/src/app/book/components/book-browser/cover-scale-preference.service.ts index 51919acc1..db385f1fd 100644 --- a/booklore-ui/src/app/book/components/book-browser/cover-scale-preference.service.ts +++ b/booklore-ui/src/app/book/components/book-browser/cover-scale-preference.service.ts @@ -1,8 +1,8 @@ -import {Injectable, inject} from '@angular/core'; +import {inject, Injectable} from '@angular/core'; import {Subject} from 'rxjs'; import {debounceTime} from 'rxjs/operators'; import {MessageService} from 'primeng/api'; -import {UserService} from '../../../settings/user-management/user.service'; +import {LocalStorageService} from '../../../core/service/local-storage-service'; @Injectable({ providedIn: 'root' @@ -12,9 +12,10 @@ export class CoverScalePreferenceService { private readonly BASE_WIDTH = 135; private readonly BASE_HEIGHT = 220; private readonly DEBOUNCE_MS = 1000; + private readonly STORAGE_KEY = 'coverScalePreference'; private readonly messageService = inject(MessageService); - private readonly userService = inject(UserService); + private readonly localStorageService = inject(LocalStorageService); private readonly scaleChangeSubject = new Subject(); readonly scaleChange$ = this.scaleChangeSubject.asObservable(); @@ -22,6 +23,8 @@ export class CoverScalePreferenceService { scaleFactor = 1.0; constructor() { + this.loadScaleFromStorage(); + this.scaleChange$ .pipe(debounceTime(this.DEBOUNCE_MS)) .subscribe(scale => this.saveScalePreference(scale)); @@ -48,19 +51,28 @@ export class CoverScalePreferenceService { } private saveScalePreference(scale: number): void { - const user = this.userService.getCurrentUser(); - const prefs = user?.userSettings?.entityViewPreferences; + try { + this.localStorageService.set(this.STORAGE_KEY, scale); + this.messageService.add({ + severity: 'success', + summary: 'Cover Size Saved', + detail: `Cover size set to ${scale.toFixed(2)}x.`, + life: 1500 + }); + } catch (e) { + this.messageService.add({ + severity: 'error', + summary: 'Save Failed', + detail: 'Could not save cover size preference locally.', + life: 3000 + }); + } + } - if (!user || !prefs) return; - - prefs.global = {...prefs.global, coverSize: scale}; - this.userService.updateUserSetting(user.id, 'entityViewPreferences', prefs); - - this.messageService.add({ - severity: 'success', - summary: 'Cover Size Saved', - detail: `Cover size set to ${scale.toFixed(2)}x.`, - life: 1500 - }); + private loadScaleFromStorage(): void { + const saved = this.localStorageService.get(this.STORAGE_KEY); + if (saved !== null && !isNaN(saved)) { + this.scaleFactor = saved; + } } } diff --git a/booklore-ui/src/app/core/service/local-storage-service.ts b/booklore-ui/src/app/core/service/local-storage-service.ts new file mode 100644 index 000000000..78e1129c4 --- /dev/null +++ b/booklore-ui/src/app/core/service/local-storage-service.ts @@ -0,0 +1,25 @@ +import {Injectable} from '@angular/core'; + +@Injectable({providedIn: 'root'}) +export class LocalStorageService { + + get(key: string): T | null { + try { + const value = localStorage.getItem(key); + return value ? JSON.parse(value) as T : null; + } catch { + return null; + } + } + + set(key: string, value: T): void { + try { + localStorage.setItem(key, JSON.stringify(value)); + } catch { + } + } + + remove(key: string): void { + localStorage.removeItem(key); + } +} diff --git a/booklore-ui/src/app/settings/global-preferences/global-preferences.component.ts b/booklore-ui/src/app/settings/global-preferences/global-preferences.component.ts index f0f6db6f3..670ee91ef 100644 --- a/booklore-ui/src/app/settings/global-preferences/global-preferences.component.ts +++ b/booklore-ui/src/app/settings/global-preferences/global-preferences.component.ts @@ -15,7 +15,6 @@ import {BookService} from '../../book/service/book.service'; import {AppSettingKey, AppSettings} from '../../core/model/app-settings.model'; import {filter, take} from 'rxjs/operators'; import {FileUploadPatternComponent} from './file-upload-pattern/file-upload-pattern.component'; -import {OpdsSettingsComponent} from './opds-settings/opds-settings.component'; import {InputText} from 'primeng/inputtext'; @Component({ @@ -30,7 +29,6 @@ import {InputText} from 'primeng/inputtext'; ToggleSwitch, FormsModule, FileUploadPatternComponent, - OpdsSettingsComponent, InputText ], templateUrl: './global-preferences.component.html', From 65741dc855749334a4375cd1bd94c31667603ef6 Mon Sep 17 00:00:00 2001 From: "aditya.chandel" Date: Mon, 21 Jul 2025 17:31:33 -0600 Subject: [PATCH 05/11] Move logout tooltip to left --- .../layout-topbar/app.topbar.component.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.html b/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.html index f7678cb31..9b6896d19 100644 --- a/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.html +++ b/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.html @@ -32,7 +32,7 @@ @if (userService.userState$ | async; as userData) {
  • @if (userData.permissions.canManipulateLibrary || userData.permissions.admin) { - + } @@ -41,14 +41,14 @@ @if (userService.userState$ | async; as userData) {
  • @if (userData.permissions.canManipulateLibrary || userData.permissions.admin) { - + }
  • }
  • - +
  • @@ -84,7 +84,7 @@
    -
  • +
  • @@ -108,12 +108,12 @@
  • -
  • -
  • From 99d43bca1e2e901be5ecf04759704af90b96ac3b Mon Sep 17 00:00:00 2001 From: "aditya.chandel" Date: Mon, 21 Jul 2025 18:00:57 -0600 Subject: [PATCH 06/11] Add buttons to open BookLore documentation in topbar and mobile menu --- .../layout-topbar/app.topbar.component.html | 93 +++++++++++-------- 1 file changed, 56 insertions(+), 37 deletions(-) diff --git a/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.html b/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.html index 9b6896d19..e1d7a4ce5 100644 --- a/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.html +++ b/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.html @@ -33,7 +33,7 @@
  • @if (userData.permissions.canManipulateLibrary || userData.permissions.admin) { - + }
  • @@ -42,48 +42,47 @@
  • @if (userData.permissions.canManipulateLibrary || userData.permissions.admin) { - + }
  • }
  • - +
  • -
  • - - - @if (shouldShowNotificationBadge) { - {{ completedTaskCount }} - } - - - - -
  • - -
    +
  • + + + @if (shouldShowNotificationBadge) { + {{ completedTaskCount }} + } + + + + +
  • +
  • +
  • + + + +
  • @@ -135,7 +144,7 @@ class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded" (click)="openLibraryCreatorDialog(); mobileMenu.hide()" > - + Create Library @@ -144,7 +153,7 @@ class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded" (click)="openFileUploadDialog(); mobileMenu.hide()" > - + Upload Book @@ -155,16 +164,26 @@ class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded" (click)="navigateToSettings(); mobileMenu.hide()" > - + Settings +
  • + + + Documentation + +
  • @@ -173,7 +192,7 @@ class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded" (click)="openUserProfileDialog(); mobileMenu.hide()" > - + Profile @@ -182,7 +201,7 @@ class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded" (click)="logout(); mobileMenu.hide()" > - + Logout From 60e7ff8403a221dd2de66a37396f7687ff2a62f0 Mon Sep 17 00:00:00 2001 From: "aditya.chandel" Date: Mon, 21 Jul 2025 18:08:18 -0600 Subject: [PATCH 07/11] Responsive UI enhancements for mobile device --- .../book-browser/book-browser.component.scss | 7 + .../layout-menu/app.menu.component.ts | 8 +- .../layout-topbar/app.topbar.component.ts | 11 +- .../book-metadata-center.component.scss | 4 +- .../metadata-editor.component.html | 74 ++++++--- .../metadata-searcher.component.html | 70 +++++---- .../metadata-searcher.component.ts | 2 + .../metadata-viewer.component.html | 148 +++++++++--------- .../user-profile-dialog.component.html | 2 +- 9 files changed, 198 insertions(+), 128 deletions(-) diff --git a/booklore-ui/src/app/book/components/book-browser/book-browser.component.scss b/booklore-ui/src/app/book/components/book-browser/book-browser.component.scss index da45311fa..53f9bb82d 100644 --- a/booklore-ui/src/app/book/components/book-browser/book-browser.component.scss +++ b/booklore-ui/src/app/book/components/book-browser/book-browser.component.scss @@ -50,6 +50,13 @@ border-width: 1px 1px 0px 1px; } +@media (max-width: 768px) { + .book-browser-footer { + left: 0%; + right: 0%; + } +} + .topbar-item { display: inline-flex; align-items: center; diff --git a/booklore-ui/src/app/layout/component/layout-menu/app.menu.component.ts b/booklore-ui/src/app/layout/component/layout-menu/app.menu.component.ts index 3edd18ab1..62fccd6b4 100644 --- a/booklore-ui/src/app/layout/component/layout-menu/app.menu.component.ts +++ b/booklore-ui/src/app/layout/component/layout-menu/app.menu.component.ts @@ -1,6 +1,6 @@ import {Component, inject, OnInit} from '@angular/core'; import {AppMenuitemComponent} from './app.menuitem.component'; -import { AsyncPipe } from '@angular/common'; +import {AsyncPipe} from '@angular/common'; import {MenuModule} from 'primeng/menu'; import {LibraryService} from '../../../book/service/library.service'; import {Observable, of} from 'rxjs'; @@ -141,6 +141,7 @@ export class AppMenuComponent implements OnInit { } openChangelogDialog() { + const isMobile = window.innerWidth <= 768; this.dynamicDialogRef = this.dialogService.open(VersionChangelogDialogComponent, { header: 'What’s New', modal: true, @@ -149,8 +150,9 @@ export class AppMenuComponent implements OnInit { position: 'absolute', top: '10%', bottom: '10%', - minWidth: '800px', - maxWidth: '800px', + width: isMobile ? '90vw' : '800px', + maxWidth: isMobile ? '90vw' : '800px', + minWidth: isMobile ? '90vw' : '800px', }, }); } diff --git a/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.ts b/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.ts index ed4cb77bf..9534591d6 100644 --- a/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.ts +++ b/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.ts @@ -140,11 +140,20 @@ export class AppTopBarComponent implements OnDestroy { } private openDialog(component: any, header: string, top: string) { + const isMobile = window.innerWidth <= 768; this.ref = this.dialogService.open(component, { header, modal: true, closable: true, - style: { position: 'absolute', top }, + style: { + position: 'absolute', + top, + ...(isMobile && { + width: '90vw', + maxWidth: '90vw', + minWidth: '90vw', + }), + }, }); } diff --git a/booklore-ui/src/app/metadata/book-metadata-center-component/book-metadata-center.component.scss b/booklore-ui/src/app/metadata/book-metadata-center-component/book-metadata-center.component.scss index b768465b3..8526a7bc2 100644 --- a/booklore-ui/src/app/metadata/book-metadata-center-component/book-metadata-center.component.scss +++ b/booklore-ui/src/app/metadata/book-metadata-center-component/book-metadata-center.component.scss @@ -1,9 +1,9 @@ .tabpanels-responsive { - height: calc(100vh - 9.7rem); + height: calc(100dvh - 9.7rem); } @media (max-width: 768px) { .tabpanels-responsive { - height: calc(100vh - 8.5rem); + height: calc(100dvh - 8.5rem); } } diff --git a/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-editor/metadata-editor.component.html b/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-editor/metadata-editor.component.html index 8615fe7d8..388b3901d 100644 --- a/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-editor/metadata-editor.component.html +++ b/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-editor/metadata-editor.component.html @@ -12,9 +12,8 @@ Image + class="w-[200px] md:w-[250px] transition-all duration-300 ease-in-out"/> @if (isUploading) { @@ -54,7 +53,7 @@ } -
    +
    @@ -426,7 +425,7 @@
    -
    +
    } -
    - - +
    +
    + + - @if (book.bookType === 'PDF' || book.bookType === 'EPUB') { - - } - - - - + @if (book.bookType === 'PDF' || book.bookType === 'EPUB') { + + + } + + + + + + +
    + +
    + + +
    diff --git a/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-searcher/metadata-searcher.component.html b/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-searcher/metadata-searcher.component.html index afa4a5f1b..31d30ed31 100644 --- a/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-searcher/metadata-searcher.component.html +++ b/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-searcher/metadata-searcher.component.html @@ -9,7 +9,7 @@ } @else {
    -
    +
    @@ -50,40 +50,56 @@
    @if (loading) { -
    - +
    + +

    + Fetching metadata from your selected sources.
    + This may take a few moments... +

    } @if (!loading) { -
    - @for (metadata of allFetchedMetadata; track metadata) { -
    -
    - Image -
    -
    -

    {{ truncateText(metadata['title']!, 90) }}

    -
    -

    ISBN: {{ metadata['isbn10'] || metadata['asin'] }}

    - -

    Published: {{ metadata['publishedDate'] }}

    + @if (searchTriggered && allFetchedMetadata.length === 0) { +
    +

    No metadata results found.
    Try adjusting your search criteria.

    +
    + } + @if (!searchTriggered && allFetchedMetadata.length === 0) { +
    +

    Start by searching for metadata using the search bar above.

    +
    + } + @if (allFetchedMetadata.length > 0) { +
    + @for (metadata of allFetchedMetadata; track metadata) { +
    +
    + Image +
    +
    +

    {{ truncateText(metadata['title']!, 90) }}

    +
    +

    ISBN: {{ metadata['isbn10'] || metadata['asin'] }}

    + +

    Published: {{ metadata['publishedDate'] }}

    +
    +
    +

    by {{ truncateText(metadata['authors']!.join(', '), 70) }}

    + +

    Source:

    +
    +

    + {{ sanitizeHtml(metadata['description']) }} +

    -
    -

    by {{ truncateText(metadata['authors']!.join(', '), 70) }}

    - -

    Source:

    -
    -

    - {{ sanitizeHtml(metadata['description']) }} -

    +
    - -
    - } -
    + } +
    + } } } diff --git a/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-searcher/metadata-searcher.component.ts b/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-searcher/metadata-searcher.component.ts index de573a791..466d46292 100644 --- a/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-searcher/metadata-searcher.component.ts +++ b/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-searcher/metadata-searcher.component.ts @@ -40,6 +40,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy { allFetchedMetadata: BookMetadata[] = []; bookId!: number; loading: boolean = false; + searchTriggered = false; @Input() book$!: Observable; @@ -120,6 +121,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy { } onSubmit(): void { + this.searchTriggered = true; if (this.form.valid) { const providerKeys = this.form.get('provider')?.value; if (!providerKeys) return; diff --git a/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-viewer/metadata-viewer.component.html b/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-viewer/metadata-viewer.component.html index 0fd371cbc..db37d7185 100644 --- a/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-viewer/metadata-viewer.component.html +++ b/booklore-ui/src/app/metadata/book-metadata-center-component/metadata-viewer/metadata-viewer.component.html @@ -187,96 +187,98 @@
    } -
    -

    - Publisher: - @if (book?.metadata?.publisher) { - +

    +
    +

    + Publisher: + @if (book?.metadata?.publisher) { + {{ book?.metadata?.publisher }} - } @else { - - - } -

    -

    Published: {{ book?.metadata!.publishedDate || '-' }}

    -

    Language: {{ book?.metadata!.language || '-' }}

    -

    - File Type: - + } @else { + - + } +

    +

    Published: {{ book?.metadata!.publishedDate || '-' }}

    +

    Language: {{ book?.metadata!.language || '-' }}

    +

    + File Type: + {{ getFileExtension(book?.filePath) || '-' }} -

    -

    File Size: {{ getFileSizeInMB(book) }}

    -

    - ISBN: - @if (book?.metadata?.isbn13 || book?.metadata?.isbn10) { - {{ book.metadata!.isbn13 }} - @if (book?.metadata?.isbn13 && book?.metadata?.isbn10) { - / +

    +

    File Size: {{ getFileSizeInMB(book) }}

    +

    + ISBN: + @if (book?.metadata?.isbn13 || book?.metadata?.isbn10) { + {{ book.metadata!.isbn13 }} + @if (book?.metadata?.isbn13 && book?.metadata?.isbn10) { + / + } + {{ book.metadata!.isbn10 }} + } @else { + - } - {{ book.metadata!.isbn10 }} - } @else { - - - } -

    -

    - Read Status: - +

    +

    + Read Status: + {{ getStatusLabel(selectedReadStatus) }} - -

    -

    - Progress: - + +

    +

    + Progress: + {{ getProgressPercent(book) !== null ? getProgressPercent(book) + '%' : 'N/A' }} - @if (getProgressPercent(book) !== null) { - + @if (getProgressPercent(book) !== null) { + - } + } -

    -

    - Metadata Match: - @if (book?.metadataMatchScore != null) { - +

    +

    + Metadata Match: + @if (book?.metadataMatchScore != null) { + {{ (book?.metadataMatchScore! * 100) | number:'1.0-0' }}% - } @else { - - - } -

    -
    + } @else { + - + } +

    +
    -
    - File Path: - - @if (showFilePath) { - {{ book?.filePath }} - } +
    + File Path: + + @if (showFilePath) { + {{ book?.filePath }} + } +
    diff --git a/booklore-ui/src/app/settings/global-preferences/user-profile-dialog/user-profile-dialog.component.html b/booklore-ui/src/app/settings/global-preferences/user-profile-dialog/user-profile-dialog.component.html index 81dbe9f74..09622c9ec 100644 --- a/booklore-ui/src/app/settings/global-preferences/user-profile-dialog/user-profile-dialog.component.html +++ b/booklore-ui/src/app/settings/global-preferences/user-profile-dialog/user-profile-dialog.component.html @@ -3,7 +3,7 @@
    -
    +

    User Profile

    From bfc7ae76948149141e29846d8072bc3ca2fcada0 Mon Sep 17 00:00:00 2001 From: "aditya.chandel" Date: Mon, 21 Jul 2025 18:13:27 -0600 Subject: [PATCH 08/11] Remove "Remote Authentication" from documentation section in favor of SSO --- README.md | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/README.md b/README.md index a167f7976..be10659e2 100644 --- a/README.md +++ b/README.md @@ -144,31 +144,6 @@ For detailed instructions on setting up OIDC authentication: - πŸ“Ί [YouTube video on configuring Authentik with BookLore](https://www.youtube.com/watch?v=r6Ufh9ldF9M) - πŸ“˜ [Step-by-step setup guide for Pocket ID](docs/OIDC-Setup-With-PocketID.md) -## πŸ” Remote Authentication (Trusted Header SSO, Forward Auth) - -If you run BookLore behind a reverse proxy with remote authentication (middleware), -you can enable automatic login by setting `REMOTE_AUTH_ENABLED` to `true`. - -This allows you to use your existing authentication system (e.g., OAuth, SAML) to log in to BookLore. - -The following remote auth environment variables can be configured: - -| Variable Name | Description | Default Value | -|------------------------------|-----------------------------------------|---------------------------------------------------------------------| -| REMOTE_AUTH_ENABLED | Enable remote authentication | `false` | -| REMOTE_AUTH_CREATE_NEW_USERS | Auto-create users from remote auth | `true` | -| REMOTE_AUTH_HEADER_NAME | HTTP header containing user's name | `Remote-Name` | -| REMOTE_AUTH_HEADER_USER | HTTP header containing username | `Remote-User` | -| REMOTE_AUTH_HEADER_EMAIL | HTTP header containing user's email | `Remote-Email` | -| REMOTE_AUTH_HEADER_GROUPS | HTTP header containing user's groups | `Remote-Groups` | -| REMOTE_AUTH_ADMIN_GROUP | Group name that grants admin privileges | - | - -Example implementations: -- https://www.authelia.com/integration/trusted-header-sso/introduction/ -- https://caddyserver.com/docs/caddyfile/directives/forward_auth -- https://doc.traefik.io/traefik/middlewares/http/forwardauth/ -- https://github.com/sevensolutions/traefik-oidc-auth (Traefik OIDC Auth) - ## 🀝 Community & Support - 🐞 Found a bug? [Open an issue](https://github.com/adityachandelgit/BookLore/issues) From c96997c2d882d237567416bfe4cbde3f0021a6ce Mon Sep 17 00:00:00 2001 From: "aditya.chandel" Date: Mon, 21 Jul 2025 18:28:18 -0600 Subject: [PATCH 09/11] Enhance README with clear, concise key features overview --- README.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index be10659e2..b943e01bb 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,17 @@ BookLore is a self-hosted web app for organizing and managing your personal book ## ✨ Key Features -- πŸ“š **Organized Book Management** - Categorize books with **Libraries** and **Shelves** for easy discovery and structured organization. -- 🧠 **Smart Metadata Handling** - Automatically fetch book details from **Goodreads**, **Amazon**, and **Google Books**, or edit them manually with fine-grained control. -- πŸ‘₯ **Multi-User Support** - Admins can create accounts, assign libraries, and manage permissions for metadata edits, uploads, and downloads. -- πŸ“– **Built-in PDF & ePub Reader** - A fast, feature-rich reader for PDFs and ePubs, with customizable reading settings and a clean UI. -- 🌐 **OPDS 1.2 Support** - Browse and download books through the **Open Publication Distribution System** – compatible with many reading apps. -- πŸ” **Optional OIDC Authentication** - Secure access with **OpenID Connect**, supporting both local JWT authentication and external providers like **Authentik**. -- πŸ“€ **Multi-Book Uploads** - Upload multiple books at once with metadata auto-detection and file organization. -- πŸ“§ **Send Books via Email** - Share books directly with others by sending them via email – quick and easy. -- πŸš€ **Continuous Improvements** - Frequent updates with new features, performance enhancements, and UI improvements. BookLore is perfect for self-hosters who want complete control over their digital library. Stay tuned for updates! +- πŸ“š **Powerful Book Organization**: Keep your library tidy with **Libraries** and **Shelves**. Whether you're sorting by genre, author, or mood, finding the right book is effortless. +- 🧠 **Intelligent Metadata Management**: Instantly fetch rich metadata from **Goodreads**, **Amazon**, **Google Books**, **Hardcover**, and more, or fine-tune every detail yourself with our advanced editor. +- πŸ‘₯ **Multi-User Access with Permissions**: Add users, assign libraries, and control who can edit, upload, or download. Perfect for families, friends, or teams. +- πŸ“– **Built-in PDF, ePub, and CBX Reader**: Enjoy a smooth, distraction-free reading experience directly in your browser. Supports themes and adjustable settings. +- 🌐 **OPDS 1.2 Integration**: Connect BookLore to your favorite reading apps with full **OPDS** support for seamless downloads. +- πŸ” **Flexible Authentication**: Secure your library with optional **OIDC login** via providers like **Authentik** and **Pocket ID**, or stick with local **JWT**, the choice is yours. +- πŸ“€ **Smart Batch Upload with BookDrop Folder**: Drop dozens of books into the **BookDrop Folder**, and BookLore will automatically scan, organize, and fetch metadata for all of them, hands-free and efficient. +- πŸ“§ **Send Books by Email**: Seamlessly share books with friends or your own devices by sending them directly via email from within BookLore. Just one click, and it’s delivered. +- πŸ“± **Mobile-Optimized UI**: Sleek, responsive design tailored for phones and tablets. Manage your library from anywhere, effortlessly. +- πŸ”„ **Open Source & Self-Hosted**: Take full control of your digital library with BookLore’s open-source, self-hosted design. +- πŸš€ **Active Development**: BookLore is under continuous improvement with regular updates to features, UI, and performance. ## πŸš€ Getting Started with BookLore From 4fe00e3bced9b468842eda547d5ee6cd3a5e58bf Mon Sep 17 00:00:00 2001 From: "aditya.chandel" Date: Mon, 21 Jul 2025 18:41:55 -0600 Subject: [PATCH 10/11] Fix scheduled library rescan failing due to missing authentication --- .../booklore/service/library/LibraryService.java | 5 +++++ .../booklore/service/scheduler/LibraryRescanScheduler.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/booklore-api/src/main/java/com/adityachandel/booklore/service/library/LibraryService.java b/booklore-api/src/main/java/com/adityachandel/booklore/service/library/LibraryService.java index 1adf02e7a..fb0c3f00a 100644 --- a/booklore-api/src/main/java/com/adityachandel/booklore/service/library/LibraryService.java +++ b/booklore-api/src/main/java/com/adityachandel/booklore/service/library/LibraryService.java @@ -190,6 +190,11 @@ public class LibraryService { return libraryMapper.toLibrary(libraryEntity); } + public List getAllLibraries() { + List libraries = libraryRepository.findAll(); + return libraries.stream().map(libraryMapper::toLibrary).toList(); + } + public List getLibraries() { BookLoreUser user = authenticationService.getAuthenticatedUser(); BookLoreUserEntity userEntity = userRepository.findById(user.getId()).orElseThrow(() -> new UsernameNotFoundException("User not found")); diff --git a/booklore-api/src/main/java/com/adityachandel/booklore/service/scheduler/LibraryRescanScheduler.java b/booklore-api/src/main/java/com/adityachandel/booklore/service/scheduler/LibraryRescanScheduler.java index 10b3e83b0..36323c120 100644 --- a/booklore-api/src/main/java/com/adityachandel/booklore/service/scheduler/LibraryRescanScheduler.java +++ b/booklore-api/src/main/java/com/adityachandel/booklore/service/scheduler/LibraryRescanScheduler.java @@ -17,7 +17,7 @@ public class LibraryRescanScheduler { @Scheduled(cron = "0 0 0 * * *") // At 00:00 every day public void rescanLibraries() { log.info("Starting scheduled library rescan at midnight"); - for (Library library : libraryService.getLibraries()) { + for (Library library : libraryService.getAllLibraries()) { try { libraryService.rescanLibrary(library.getId()); log.info("Rescanned library '{}'", library.getName()); From a15eb8684fd299e9e09cac2104f0c8e68ed2faf2 Mon Sep 17 00:00:00 2001 From: "aditya.chandel" Date: Mon, 21 Jul 2025 23:08:45 -0600 Subject: [PATCH 11/11] Fix incorrect file path resolution when using {currentFilename} in naming pattern --- .../booklore/service/bookdrop/BookDropService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/booklore-api/src/main/java/com/adityachandel/booklore/service/bookdrop/BookDropService.java b/booklore-api/src/main/java/com/adityachandel/booklore/service/bookdrop/BookDropService.java index 59a56ccbc..eeb9d637a 100644 --- a/booklore-api/src/main/java/com/adityachandel/booklore/service/bookdrop/BookDropService.java +++ b/booklore-api/src/main/java/com/adityachandel/booklore/service/bookdrop/BookDropService.java @@ -20,6 +20,7 @@ import com.adityachandel.booklore.util.FileUtils; import com.adityachandel.booklore.util.PathPatternResolver; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.FilenameUtils; import org.springframework.core.io.PathResource; import org.springframework.core.io.Resource; import org.springframework.stereotype.Service; @@ -105,7 +106,7 @@ public class BookDropService { filePattern += "{currentFilename}"; } - String relativePath = PathPatternResolver.resolvePattern(metadata, filePattern, bookdropFile.getFilePath()); + String relativePath = PathPatternResolver.resolvePattern(metadata, filePattern, FilenameUtils.getName(bookdropFile.getFilePath())); Path source = Path.of(bookdropFile.getFilePath()); Path target = Paths.get(path.getPath(), relativePath); File targetFile = target.toFile();