Merge pull request #142 from adityachandelgit/develop
Merge Develop into Master – Stable Release Update
This commit is contained in:
@@ -41,14 +41,32 @@ jobs:
|
||||
if: github.ref == 'refs/heads/master'
|
||||
id: determine_bump
|
||||
run: |
|
||||
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name' || echo "")
|
||||
if echo "$labels" | grep -q 'breaking-change'; then
|
||||
# Step 1: Check if the PR has a label (priority over commit message)
|
||||
pr_number=$(gh pr list --state merged --base master --limit 1 --json number --jq '.[0].number')
|
||||
echo "PR Number: $pr_number"
|
||||
labels=$(gh pr view "$pr_number" --json labels --jq '.labels[].name' || echo "")
|
||||
if echo "$labels" | grep -q 'major'; then
|
||||
bump="major"
|
||||
elif echo "$labels" | grep -q 'feature\|enhancement'; then
|
||||
elif echo "$labels" | grep -q 'minor'; then
|
||||
bump="minor"
|
||||
else
|
||||
elif echo "$labels" | grep -q 'patch'; then
|
||||
bump="patch"
|
||||
fi
|
||||
# Step 2: If no label, fallback to commit message keywords
|
||||
if [ -z "$bump" ]; then
|
||||
last_commit_msg=$(git log -1 --pretty=%B)
|
||||
echo "Last commit message: $last_commit_msg"
|
||||
|
||||
if echo "$last_commit_msg" | grep -iq '#major'; then
|
||||
bump="major"
|
||||
elif echo "$last_commit_msg" | grep -iq '#minor'; then
|
||||
bump="minor"
|
||||
elif echo "$last_commit_msg" | grep -iq '#patch'; then
|
||||
bump="patch"
|
||||
else
|
||||
bump="patch" # Default to patch if no keyword or label
|
||||
fi
|
||||
fi
|
||||
echo "bump=$bump" >> $GITHUB_ENV
|
||||
echo "Version bump type: $bump"
|
||||
env:
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
# BookLore
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
BookLore is a self-hosted web app for organizing and managing your personal book collection. It provides an intuitive interface to browse, read, and track your progress across PDFs and eBooks. With robust metadata management, multi-user support, and a sleek, modern UI, BookLore makes it easy to build and explore your personal library.
|
||||
|
||||

|
||||

|
||||
|
||||
> ⚠️ **Warning:**
|
||||
> This project is in early development by a sole developer. Expect bugs, missing features, and frequent changes.
|
||||
> **Data Loss Risk:** Non-backwards compatible database changes may result in loss of metadata, such as book titles, authors, and reading progress. Your actual book files (PDFs and ePubs) are unlikely to be affected, but it's always a good idea to keep a backup of both your database and your book files.
|
||||
> **Limited Support:** As this is a one-person project, support may be slow, and features could be experimental or incomplete. Contributions and feedback are welcome!
|
||||
|
||||
## Key Features
|
||||
## ✨ Key Features
|
||||
- **Modern, Responsive UI** – A sleek, highly reactive, and fluent interface for a seamless reading experience.
|
||||
- **Organized Book Management** – Categorize books using Libraries and Shelves for better organization.
|
||||
- **Smart Metadata Handling** – Automatically fetch book details from sources like Goodreads, Amazon, and Google Books, or edit them manually.
|
||||
@@ -19,7 +23,7 @@ BookLore is a self-hosted web app for organizing and managing your personal book
|
||||
|
||||
BookLore is perfect for self-hosters who want complete control over their digital library. Stay tuned for updates!
|
||||
|
||||
## Video Guides & Tutorials
|
||||
## 🎥 Video Guides & Tutorials
|
||||
|
||||
For a step-by-step walkthrough, check out the official BookLore video guides on YouTube:
|
||||
|
||||
@@ -27,7 +31,7 @@ For a step-by-step walkthrough, check out the official BookLore video guides on
|
||||
|
||||
These videos cover deployment, configuration, and feature highlights to help you get started quickly.
|
||||
|
||||
## Deploy with Docker
|
||||
## 🐳 Deploy with Docker
|
||||
|
||||
You can quickly set up and run BookLore using Docker.
|
||||
|
||||
@@ -48,7 +52,9 @@ services:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Etc/UTC
|
||||
- MYSQL_ROOT_PASSWORD=your_secure_password # Use a strong password; must match the one in the mariadb service
|
||||
- DATABASE_URL=jdbc:mariadb://mariadb:3306/booklore # Only modify this if you're familiar with JDBC and your database setup
|
||||
- DATABASE_USERNAME=booklore # Must match MYSQL_USER defined in the mariadb container
|
||||
- DATABASE_PASSWORD=your_secure_password # Use a strong password; must match MYSQL_PASSWORD defined in the mariadb container
|
||||
depends_on:
|
||||
mariadb:
|
||||
condition: service_healthy
|
||||
@@ -66,7 +72,10 @@ services:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Etc/UTC
|
||||
- MYSQL_ROOT_PASSWORD=your_secure_password # Use a strong password; must match the one in the booklore service
|
||||
- MYSQL_ROOT_PASSWORD=super_secure_password # Use a strong password for the database's root user, should be different from MYSQL_PASSWORD
|
||||
- MYSQL_DATABASE=booklore
|
||||
- MYSQL_USER=booklore # Must match DATABASE_USERNAME defined in the booklore container
|
||||
- MYSQL_PASSWORD=your_secure_password # Use a strong password; must match DATABASE_PASSWORD defined in the booklore container
|
||||
volumes:
|
||||
- /your/local/path/to/mariadb/config:/config
|
||||
restart: unless-stopped
|
||||
@@ -107,14 +116,50 @@ Password: admin123
|
||||
> ⚠️ **Important:**
|
||||
> You’ll be prompted to change the default password upon your first login to ensure better security.
|
||||
|
||||
## Tech Stack
|
||||
## 🔧 Configuration
|
||||
|
||||
- **Backend:** Spring Boot (Java)
|
||||
- **Frontend:** Angular (TypeScript)
|
||||
- **Database:** MariaDB
|
||||
- **Containerization:** Docker & Docker Compose
|
||||
The following environment variables can be configured:
|
||||
|
||||
## License
|
||||
| Variable Name | Description | Default Value |
|
||||
|-------------------|---------------------------|---------------------------------------------------------------------|
|
||||
| DATABASE_URL | JDBC connection URL | `jdbc:mariadb://${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}` |
|
||||
| DATABASE_HOST | Database hostname | `mariadb` |
|
||||
| DATABASE_PORT | Database port | `3306` |
|
||||
| DATABASE_NAME | Database name | `booklore` |
|
||||
| DATABASE_USERNAME | Database username for app | `root` |
|
||||
| DATABASE_PASSWORD | Database password for app | **required** |
|
||||
|
||||
## 🤝 Community & Support
|
||||
|
||||
- 🐞 Found a bug? [Open an issue](https://github.com/adityachandelgit/BookLore/issues)
|
||||
- ✨ Want to contribute? [Check out CONTRIBUTING.md](https://github.com/adityachandelgit/BookLore/blob/master/CONTRIBUTING.md)
|
||||
- 💬 Ask questions or share feedback: [Discussions](https://github.com/adityachandelgit/BookLore/discussions)
|
||||
|
||||
## 👨💻 Contributors & Developers
|
||||
|
||||
Thanks to all the amazing people who contribute to Booklore.
|
||||
|
||||
[](https://github.com/adityachandelgit/BookLore/graphs/contributors)
|
||||
|
||||
## ⭐ Star History
|
||||
|
||||
[](https://star-history.com/#adityachandelgit/BookLore&Date&theme=dark)
|
||||
|
||||
## 💖 Support the Project
|
||||
|
||||
If you find BookLore helpful, consider ⭐ starring the repo!
|
||||
|
||||
## 🧰 Tech Stack
|
||||
|
||||
<p align="left">
|
||||
<img src="https://img.shields.io/badge/Spring%20Boot-6DB33F?style=for-the-badge&logo=springboot&logoColor=white" alt="Spring Boot" style="margin-right: 10px;"/>
|
||||
<img src="https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white" alt="Angular" style="margin-right: 10px;"/>
|
||||
<img src="https://img.shields.io/badge/MariaDB-003545?style=for-the-badge&logo=mariadb&logoColor=white" alt="MariaDB" style="margin-right: 10px;"/>
|
||||
<img src="https://img.shields.io/badge/Docker-2496ED?style=for-the-badge&logo=docker&logoColor=white" alt="Docker" style="margin-right: 10px;"/>
|
||||
</p>
|
||||
|
||||
## ⚖️ License
|
||||
|
||||
* [GNU GPL v3](http://www.gnu.org/licenses/gpl.html)
|
||||
* Copyright 2024-2025
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 612 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 10 MiB |
@@ -10,6 +10,5 @@ import org.springframework.stereotype.Component;
|
||||
@Getter
|
||||
@Setter
|
||||
public class AppProperties {
|
||||
private String pathBook;
|
||||
private String pathConfig;
|
||||
}
|
||||
|
||||
+13
-29
@@ -1,46 +1,30 @@
|
||||
package com.adityachandel.booklore.controller;
|
||||
|
||||
import com.adityachandel.booklore.model.dto.ReleaseNote;
|
||||
import com.adityachandel.booklore.model.dto.VersionInfo;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import com.adityachandel.booklore.service.VersionService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestClient;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/version")
|
||||
public class VersionController {
|
||||
|
||||
@Value("${app.version:unknown}")
|
||||
private String appVersion;
|
||||
private final VersionService versionService;
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<VersionInfo> getVersions() {
|
||||
String latestVersion = fetchLatestGitHubReleaseVersion();
|
||||
return ResponseEntity.ok(new VersionInfo(appVersion, latestVersion));
|
||||
public ResponseEntity<VersionInfo> getVersionInfo() {
|
||||
return ResponseEntity.ok(versionService.getVersionInfo());
|
||||
}
|
||||
|
||||
private String fetchLatestGitHubReleaseVersion() {
|
||||
try {
|
||||
RestClient restClient = RestClient.builder()
|
||||
.defaultHeader("Accept", "application/vnd.github+json")
|
||||
.defaultHeader("User-Agent", "BookLore-Version-Checker")
|
||||
.build();
|
||||
|
||||
String response = restClient.get()
|
||||
.uri("https://api.github.com/repos/adityachandelgit/BookLore/releases/latest")
|
||||
.retrieve()
|
||||
.body(String.class);
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
JsonNode root = objectMapper.readTree(response);
|
||||
return root.has("tag_name") ? root.get("tag_name").asText() : "unknown";
|
||||
|
||||
} catch (Exception e) {
|
||||
return "unknown";
|
||||
}
|
||||
@GetMapping("/changelog")
|
||||
public ResponseEntity<List<ReleaseNote>> getChangelogSinceCurrent() {
|
||||
return ResponseEntity.ok(versionService.getChangelogSinceCurrentVersion());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,10 @@ public class BookMetadata {
|
||||
private Double rating;
|
||||
private Integer ratingCount;
|
||||
private Integer reviewCount;
|
||||
private Double amazonRating;
|
||||
private Integer amazonReviewCount;
|
||||
private Double goodreadsRating;
|
||||
private Integer goodreadsReviewCount;
|
||||
private Instant coverUpdatedOn;
|
||||
private List<String> authors;
|
||||
private List<String> categories;
|
||||
@@ -53,6 +57,10 @@ public class BookMetadata {
|
||||
private Boolean languageLocked;
|
||||
private Boolean ratingLocked;
|
||||
private Boolean reviewCountLocked;
|
||||
private Boolean amazonRatingLocked;
|
||||
private Boolean amazonReviewCountLocked;
|
||||
private Boolean goodreadsRatingLocked;
|
||||
private Boolean goodreadsReviewCountLocked;
|
||||
private Boolean coverLocked;
|
||||
private Boolean authorsLocked;
|
||||
private Boolean categoriesLocked;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.adityachandel.booklore.model.dto;
|
||||
|
||||
public record ReleaseNote(String version, String name, String changelog, String url) {
|
||||
}
|
||||
@@ -1,11 +1,5 @@
|
||||
package com.adityachandel.booklore.model.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class VersionInfo {
|
||||
private String current;
|
||||
private String latest;
|
||||
public record VersionInfo(String current, String latest) {
|
||||
}
|
||||
|
||||
+28
-1
@@ -69,6 +69,18 @@ public class BookMetadataEntity {
|
||||
@Column(name = "cover_updated_on")
|
||||
private Instant coverUpdatedOn;
|
||||
|
||||
@Column(name = "amazon_rating")
|
||||
private Double amazonRating;
|
||||
|
||||
@Column(name = "amazon_review_count")
|
||||
private Integer amazonReviewCount;
|
||||
|
||||
@Column(name = "goodreads_rating")
|
||||
private Double goodreadsRating;
|
||||
|
||||
@Column(name = "goodreads_review_count")
|
||||
private Integer goodreadsReviewCount;
|
||||
|
||||
// Locking fields
|
||||
@Column(name = "all_fields_locked")
|
||||
private Boolean allFieldsLocked = Boolean.FALSE;
|
||||
@@ -109,6 +121,18 @@ public class BookMetadataEntity {
|
||||
@Column(name = "review_count_locked")
|
||||
private Boolean reviewCountLocked = Boolean.FALSE;
|
||||
|
||||
@Column(name = "amazon_rating_locked")
|
||||
private Boolean amazonRatingLocked = Boolean.FALSE;
|
||||
|
||||
@Column(name = "amazon_review_count_locked")
|
||||
private Boolean amazonReviewCountLocked = Boolean.FALSE;
|
||||
|
||||
@Column(name = "goodreads_rating_locked")
|
||||
private Boolean goodreadsRatingLocked = Boolean.FALSE;
|
||||
|
||||
@Column(name = "goodreads_review_count_locked")
|
||||
private Boolean goodreadsReviewCountLocked = Boolean.FALSE;
|
||||
|
||||
@Column(name = "cover_locked")
|
||||
private Boolean coverLocked = Boolean.FALSE;
|
||||
|
||||
@@ -151,7 +175,6 @@ public class BookMetadataEntity {
|
||||
@OneToMany(fetch = FetchType.LAZY, mappedBy = "book")
|
||||
private List<BookAwardEntity> awards;
|
||||
|
||||
|
||||
public void applyLockToAllFields(boolean lock) {
|
||||
this.allFieldsLocked = lock;
|
||||
this.titleLocked = lock;
|
||||
@@ -172,5 +195,9 @@ public class BookMetadataEntity {
|
||||
this.seriesTotalLocked = lock;
|
||||
this.authorsLocked = lock;
|
||||
this.categoriesLocked = lock;
|
||||
this.amazonRatingLocked = lock;
|
||||
this.amazonReviewCountLocked = lock;
|
||||
this.goodreadsRatingLocked = lock;
|
||||
this.goodreadsReviewCountLocked = lock;
|
||||
}
|
||||
}
|
||||
+22
-8
@@ -80,12 +80,20 @@ public class BookMetadataUpdater {
|
||||
metadata.setPageCount(newMetadata.getPageCount());
|
||||
}
|
||||
|
||||
if ((metadata.getRatingLocked() == null || !metadata.getRatingLocked()) && newMetadata.getRating() != null) {
|
||||
metadata.setRating(newMetadata.getRating());
|
||||
if ((metadata.getAmazonRatingLocked() == null || !metadata.getAmazonRatingLocked()) && newMetadata.getAmazonRating() != null) {
|
||||
metadata.setAmazonRating(newMetadata.getAmazonRating());
|
||||
}
|
||||
|
||||
if ((metadata.getReviewCountLocked() == null || !metadata.getReviewCountLocked()) && newMetadata.getReviewCount() != null) {
|
||||
metadata.setReviewCount(newMetadata.getReviewCount());
|
||||
if ((metadata.getAmazonReviewCountLocked() == null || !metadata.getAmazonReviewCountLocked()) && newMetadata.getAmazonReviewCount() != null) {
|
||||
metadata.setAmazonReviewCount(newMetadata.getAmazonReviewCount());
|
||||
}
|
||||
|
||||
if ((metadata.getGoodreadsRatingLocked() == null || !metadata.getGoodreadsRatingLocked()) && newMetadata.getGoodreadsRating() != null) {
|
||||
metadata.setGoodreadsRating(newMetadata.getGoodreadsRating());
|
||||
}
|
||||
|
||||
if ((metadata.getGoodreadsReviewCountLocked() == null || !metadata.getGoodreadsReviewCountLocked()) && newMetadata.getGoodreadsReviewCount() != null) {
|
||||
metadata.setGoodreadsReviewCount(newMetadata.getGoodreadsReviewCount());
|
||||
}
|
||||
|
||||
if ((metadata.getSeriesNameLocked() == null || !metadata.getSeriesNameLocked()) && newMetadata.getSeriesName() != null) {
|
||||
@@ -214,11 +222,17 @@ public class BookMetadataUpdater {
|
||||
if (newMetadata.getLanguageLocked() != null) {
|
||||
metadata.setLanguageLocked(newMetadata.getLanguageLocked());
|
||||
}
|
||||
if (newMetadata.getRatingLocked() != null) {
|
||||
metadata.setRatingLocked(newMetadata.getRatingLocked());
|
||||
if (newMetadata.getAmazonRatingLocked() != null) {
|
||||
metadata.setAmazonRatingLocked(newMetadata.getAmazonRatingLocked());
|
||||
}
|
||||
if (newMetadata.getReviewCountLocked() != null) {
|
||||
metadata.setReviewCountLocked(newMetadata.getReviewCountLocked());
|
||||
if (newMetadata.getAmazonReviewCountLocked() != null) {
|
||||
metadata.setAmazonReviewCountLocked(newMetadata.getAmazonReviewCountLocked());
|
||||
}
|
||||
if (newMetadata.getGoodreadsRatingLocked() != null) {
|
||||
metadata.setGoodreadsRatingLocked(newMetadata.getGoodreadsRatingLocked());
|
||||
}
|
||||
if (newMetadata.getGoodreadsReviewCountLocked() != null) {
|
||||
metadata.setGoodreadsReviewCountLocked(newMetadata.getGoodreadsReviewCountLocked());
|
||||
}
|
||||
if (newMetadata.getSeriesNameLocked() != null) {
|
||||
metadata.setSeriesNameLocked(newMetadata.getSeriesNameLocked());
|
||||
|
||||
+2
-2
@@ -55,14 +55,14 @@ public class FileUploadService {
|
||||
}
|
||||
|
||||
try {
|
||||
file.transferTo(storageFile);
|
||||
file.transferTo(storagePath); // storagePath here is required for windows, otherwise it will be resoled relative to Tomcat FS
|
||||
log.info("File uploaded successfully: {}", storageFile.getAbsolutePath());
|
||||
Book book = processFile(file, libraryEntity, libraryPathEntity, storageFile);
|
||||
notificationService.sendMessage(Topic.BOOK_ADD, book);
|
||||
log.info("Book processed successfully: {}", book.getMetadata().getTitle());
|
||||
return book;
|
||||
} catch (IOException e) {
|
||||
log.error("Error saving file: {}", e.getMessage());
|
||||
log.error("Error saving file", e);
|
||||
throw ApiError.FILE_READ_ERROR.createException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.adityachandel.booklore.service;
|
||||
|
||||
import com.adityachandel.booklore.model.dto.ReleaseNote;
|
||||
import com.adityachandel.booklore.model.dto.VersionInfo;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RestClient;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class VersionService {
|
||||
|
||||
@Value("${app.version:unknown}")
|
||||
private String appVersion;
|
||||
|
||||
private static final String GITHUB_REPO = "adityachandelgit/BookLore";
|
||||
|
||||
public VersionInfo getVersionInfo() {
|
||||
String latestVersion = fetchLatestGitHubReleaseVersion();
|
||||
return new VersionInfo(appVersion, latestVersion);
|
||||
}
|
||||
|
||||
public List<ReleaseNote> getChangelogSinceCurrentVersion() {
|
||||
return fetchReleaseNotesSince(appVersion);
|
||||
}
|
||||
|
||||
private String fetchLatestGitHubReleaseVersion() {
|
||||
try {
|
||||
RestClient restClient = RestClient.builder()
|
||||
.defaultHeader("Accept", "application/vnd.github+json")
|
||||
.defaultHeader("User-Agent", "BookLore-Version-Checker")
|
||||
.build();
|
||||
|
||||
String response = restClient.get()
|
||||
.uri("https://api.github.com/repos/" + GITHUB_REPO + "/releases/latest")
|
||||
.retrieve()
|
||||
.body(String.class);
|
||||
|
||||
JsonNode root = new ObjectMapper().readTree(response);
|
||||
return root.has("tag_name") ? root.get("tag_name").asText() : "unknown";
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to fetch latest release version", e);
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
private List<ReleaseNote> fetchReleaseNotesSince(String currentVersion) {
|
||||
List<ReleaseNote> updates = new ArrayList<>();
|
||||
try {
|
||||
RestClient restClient = RestClient.builder()
|
||||
.defaultHeader("Accept", "application/vnd.github+json")
|
||||
.defaultHeader("User-Agent", "BookLore-Version-Checker")
|
||||
.build();
|
||||
|
||||
String response = restClient.get()
|
||||
.uri("https://api.github.com/repos/" + GITHUB_REPO + "/releases")
|
||||
.retrieve()
|
||||
.body(String.class);
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode releases = mapper.readTree(response);
|
||||
|
||||
for (JsonNode release : releases) {
|
||||
String tag = release.get("tag_name").asText();
|
||||
if (isVersionGreater(tag, currentVersion)) {
|
||||
String url = "https://github.com/" + GITHUB_REPO + "/releases/tag/" + tag;
|
||||
updates.add(new ReleaseNote(
|
||||
tag,
|
||||
release.get("name").asText(),
|
||||
release.get("body").asText(),
|
||||
url
|
||||
));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to fetch release notes", e);
|
||||
}
|
||||
return updates;
|
||||
}
|
||||
|
||||
private boolean isVersionGreater(String version1, String version2) {
|
||||
try {
|
||||
String[] v1 = version1.replace("v", "").split("\\.");
|
||||
String[] v2 = version2.replace("v", "").split("\\.");
|
||||
for (int i = 0; i < Math.max(v1.length, v2.length); i++) {
|
||||
int num1 = i < v1.length ? Integer.parseInt(v1[i]) : 0;
|
||||
int num2 = i < v2.length ? Integer.parseInt(v2[i]) : 0;
|
||||
if (num1 > num2) return true;
|
||||
if (num1 < num2) return false;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Version comparison failed", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+5
-8
@@ -1,9 +1,8 @@
|
||||
package com.adityachandel.booklore.service.fileprocessor;
|
||||
|
||||
import com.adityachandel.booklore.config.AppProperties;
|
||||
import com.adityachandel.booklore.model.entity.BookMetadataEntity;
|
||||
import com.adityachandel.booklore.repository.BookRepository;
|
||||
import com.adityachandel.booklore.service.AppSettingService;
|
||||
import com.adityachandel.booklore.util.FileService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -26,24 +25,22 @@ import java.util.stream.Stream;
|
||||
@Slf4j
|
||||
public class FileProcessingUtils {
|
||||
|
||||
private final AppProperties appProperties;
|
||||
private final FileService fileService;
|
||||
private final AppSettingService appSettingService;
|
||||
|
||||
public void setBookCoverPath(long bookId, BookMetadataEntity bookMetadataEntity) {
|
||||
bookMetadataEntity.setThumbnail(appProperties.getPathConfig() + "/thumbs/" + bookId + "/f.jpg");
|
||||
bookMetadataEntity.setThumbnail(fileService.getThumbnailPath(bookId) + "/f.jpg");
|
||||
bookMetadataEntity.setCoverUpdatedOn(Instant.now());
|
||||
}
|
||||
|
||||
public boolean saveCoverImage(BufferedImage coverImage, long bookId) throws IOException {
|
||||
File coverDirectory = new File(appProperties.getPathConfig() + "/thumbs");
|
||||
|
||||
String resolution = appSettingService.getAppSettings().getCoverSettings().getResolution();
|
||||
String[] split = resolution.split("x");
|
||||
int x = Integer.parseInt(split[0]);
|
||||
int y = Integer.parseInt(split[1]);
|
||||
|
||||
BufferedImage resizedImage = resizeImage(coverImage, x, y);
|
||||
File bookDirectory = new File(coverDirectory, String.valueOf(bookId));
|
||||
File bookDirectory = new File(fileService.getThumbnailPath(bookId));
|
||||
if (!bookDirectory.exists()) {
|
||||
if (!bookDirectory.mkdirs()) {
|
||||
throw new IOException("Failed to create directory: " + bookDirectory.getAbsolutePath());
|
||||
@@ -65,7 +62,7 @@ public class FileProcessingUtils {
|
||||
|
||||
public void deleteBookCovers(Set<Long> bookIds) {
|
||||
for (Long bookId : bookIds) {
|
||||
String bookCoverFolder = appProperties.getPathConfig() + "/thumbs/" + bookId;
|
||||
String bookCoverFolder = fileService.getThumbnailPath(bookId);
|
||||
Path folderPath = Paths.get(bookCoverFolder);
|
||||
try {
|
||||
if (Files.exists(folderPath) && Files.isDirectory(folderPath)) {
|
||||
|
||||
+2
-2
@@ -137,8 +137,8 @@ public class AmazonBookParser implements BookParser {
|
||||
.language(getLanguage(doc))
|
||||
.pageCount(getPageCount(doc))
|
||||
.thumbnailUrl(getThumbnail(doc))
|
||||
.rating(getRating(doc))
|
||||
.reviewCount(getReviewCount(doc))
|
||||
.amazonRating(getRating(doc))
|
||||
.amazonReviewCount(getReviewCount(doc))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -153,9 +153,8 @@ public class GoodReadsParser implements BookParser {
|
||||
if (workJson != null) {
|
||||
JSONObject statsJson = workJson.optJSONObject("stats");
|
||||
if (statsJson != null) {
|
||||
builder.rating(parseDouble(statsJson.optString("averageRating")))
|
||||
.ratingCount(parseInteger(statsJson.optString("ratingsCount")))
|
||||
.reviewCount(parseInteger(statsJson.optString("textReviewsCount")));
|
||||
builder.goodreadsRating(parseDouble(statsJson.optString("averageRating")))
|
||||
.goodreadsReviewCount(parseInteger(statsJson.optString("ratingsCount")));
|
||||
}
|
||||
|
||||
JSONObject detailsJson = workJson.optJSONObject("details");
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
app:
|
||||
path-book: '/app/books'
|
||||
path-config: '/app/data'
|
||||
version: 'development'
|
||||
version: 'v0.0.40'
|
||||
|
||||
spring:
|
||||
servlet:
|
||||
@@ -15,12 +14,10 @@ spring:
|
||||
application:
|
||||
name: booklore-api
|
||||
datasource:
|
||||
driver-class-name: org.mariadb.jdbc.Driver
|
||||
url: jdbc:mariadb://${DB_HOST:mariadb}:3306/booklore?createDatabaseIfNotExist=true
|
||||
username: root
|
||||
password: ${MYSQL_ROOT_PASSWORD}
|
||||
url: ${DATABASE_URL:jdbc:mariadb://${DATABASE_HOST:${DB_HOST:mariadb}}:${DATABASE_PORT:3306}/${DATABASE_NAME:booklore}?createDatabaseIfNotExist=true}
|
||||
username: ${DATABASE_USERNAME:root}
|
||||
password: ${DATABASE_PASSWORD:${MYSQL_ROOT_PASSWORD}}
|
||||
jpa:
|
||||
database-platform: org.hibernate.dialect.MariaDBDialect
|
||||
hibernate:
|
||||
naming:
|
||||
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
ALTER TABLE book_metadata
|
||||
ADD COLUMN amazon_rating FLOAT,
|
||||
ADD COLUMN amazon_review_count INT,
|
||||
ADD COLUMN goodreads_rating FLOAT,
|
||||
ADD COLUMN goodreads_review_count INT,
|
||||
ADD COLUMN amazon_rating_locked BOOLEAN DEFAULT FALSE,
|
||||
ADD COLUMN amazon_review_count_locked BOOLEAN DEFAULT FALSE,
|
||||
ADD COLUMN goodreads_rating_locked BOOLEAN DEFAULT FALSE,
|
||||
ADD COLUMN goodreads_review_count_locked BOOLEAN DEFAULT FALSE;
|
||||
@@ -131,6 +131,7 @@
|
||||
"cli": {
|
||||
"schematicCollections": [
|
||||
"angular-eslint"
|
||||
]
|
||||
],
|
||||
"analytics": false
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+83
-4
@@ -30,6 +30,7 @@
|
||||
"primeng": "19.0.10",
|
||||
"quill": "2.0.3",
|
||||
"rxjs": "7.8.2",
|
||||
"showdown": "^2.1.0",
|
||||
"tailwindcss-primeui": "0.6.1",
|
||||
"tslib": "2.8.1",
|
||||
"ws": "8.18.1",
|
||||
@@ -39,7 +40,9 @@
|
||||
"@angular-devkit/build-angular": "19.2.7",
|
||||
"@angular/cli": "19.2.7",
|
||||
"@angular/compiler-cli": "19.2.6",
|
||||
"@tailwindcss/typography": "^0.5.16",
|
||||
"@types/jasmine": "5.1.7",
|
||||
"@types/showdown": "^2.0.6",
|
||||
"angular-eslint": "19.3.0",
|
||||
"autoprefixer": "10.4.21",
|
||||
"eslint": "9.24.0",
|
||||
@@ -5981,6 +5984,36 @@
|
||||
"integrity": "sha512-1ZIUqtPITFbv/DxRmDr5/agPqJwF69d24m9qmM1939TJehgY539CtzeZRjbLt5G6fSy/7YqqYsfvoTEw9xUI2A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@tailwindcss/typography": {
|
||||
"version": "0.5.16",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.16.tgz",
|
||||
"integrity": "sha512-0wDLwCVF5V3x3b1SGXPCDcdsbDHMBe+lkFzBRaHeLvNi+nrrnZ1lA18u+OTWO8iSWU2GxUOCvlXtDuqftc1oiA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"lodash.castarray": "^4.4.0",
|
||||
"lodash.isplainobject": "^4.0.6",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"postcss-selector-parser": "6.0.10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser": {
|
||||
"version": "6.0.10",
|
||||
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz",
|
||||
"integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cssesc": "^3.0.0",
|
||||
"util-deprecate": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/@tufjs/canonical-json": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-2.0.0.tgz",
|
||||
@@ -6287,6 +6320,13 @@
|
||||
"@types/send": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/showdown": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/showdown/-/showdown-2.0.6.tgz",
|
||||
"integrity": "sha512-pTvD/0CIeqe4x23+YJWlX2gArHa8G0J0Oh6GKaVXV7TAeickpkkZiNOgFcFcmLQ5lB/K0qBJL1FtRYltBfbGCQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/sockjs": {
|
||||
"version": "0.3.36",
|
||||
"resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz",
|
||||
@@ -11867,6 +11907,13 @@
|
||||
"integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.castarray": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz",
|
||||
"integrity": "sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.clonedeep": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
|
||||
@@ -11886,6 +11933,13 @@
|
||||
"integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.isplainobject": {
|
||||
"version": "4.0.6",
|
||||
"resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
|
||||
"integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.merge": {
|
||||
"version": "4.6.2",
|
||||
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
|
||||
@@ -15217,6 +15271,31 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/showdown": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/showdown/-/showdown-2.1.0.tgz",
|
||||
"integrity": "sha512-/6NVYu4U819R2pUIk79n67SYgJHWCce0a5xTP979WbNp0FL9MN1I1QK662IDU1b6JzKTvmhgI7T7JYIxBi3kMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"commander": "^9.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"showdown": "bin/showdown.js"
|
||||
},
|
||||
"funding": {
|
||||
"type": "individual",
|
||||
"url": "https://www.paypal.me/tiviesantos"
|
||||
}
|
||||
},
|
||||
"node_modules/showdown/node_modules/commander": {
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
|
||||
"integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^12.20.0 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz",
|
||||
@@ -16938,9 +17017,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "9.0.1",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
|
||||
"integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",
|
||||
"version": "11.1.0",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
|
||||
"integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==",
|
||||
"funding": [
|
||||
"https://github.com/sponsors/broofa",
|
||||
"https://github.com/sponsors/ctavan"
|
||||
@@ -16948,7 +17027,7 @@
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
"uuid": "dist/esm/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/validate-npm-package-license": {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"build": "ng build",
|
||||
"dev": "ng serve --open --watch --configuration development",
|
||||
"watch": "ng build --watch --configuration development",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint"
|
||||
@@ -33,6 +34,7 @@
|
||||
"primeng": "19.0.10",
|
||||
"quill": "2.0.3",
|
||||
"rxjs": "7.8.2",
|
||||
"showdown": "^2.1.0",
|
||||
"tailwindcss-primeui": "0.6.1",
|
||||
"tslib": "2.8.1",
|
||||
"ws": "8.18.1",
|
||||
@@ -42,7 +44,9 @@
|
||||
"@angular-devkit/build-angular": "19.2.7",
|
||||
"@angular/cli": "19.2.7",
|
||||
"@angular/compiler-cli": "19.2.6",
|
||||
"@tailwindcss/typography": "^0.5.16",
|
||||
"@types/jasmine": "5.1.7",
|
||||
"@types/showdown": "^2.0.6",
|
||||
"angular-eslint": "19.3.0",
|
||||
"autoprefixer": "10.4.21",
|
||||
"eslint": "9.24.0",
|
||||
|
||||
@@ -32,6 +32,10 @@ export interface BookMetadata {
|
||||
language?: string;
|
||||
rating?: number | null;
|
||||
reviewCount?: number | null;
|
||||
amazonRating?: number | null;
|
||||
amazonReviewCount?: number | null;
|
||||
goodreadsRating?: number | null;
|
||||
goodreadsReviewCount?: number | null;
|
||||
coverUpdatedOn?: string;
|
||||
authors: string[];
|
||||
categories: string[];
|
||||
@@ -56,6 +60,10 @@ export interface BookMetadata {
|
||||
languageLocked?: boolean;
|
||||
ratingLocked?: boolean;
|
||||
reviewCountLocked?: boolean;
|
||||
amazonRatingLocked?: boolean;
|
||||
amazonReviewCountLocked?: boolean;
|
||||
goodreadsRatingLocked?: boolean;
|
||||
goodreadsReviewCountLocked?: boolean;
|
||||
coverUpdatedOnLocked?: boolean;
|
||||
authorsLocked?: boolean;
|
||||
categoriesLocked?: boolean;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<p-card class="change-password-card p-fluid">
|
||||
|
||||
<ng-template pTemplate="content">
|
||||
<form #changePasswordForm="ngForm">
|
||||
<form #changePasswordForm="ngForm" (ngSubmit)="changePassword()">
|
||||
<div class="p-field">
|
||||
<label for="currentPassword">Current Password</label>
|
||||
<p-password id="currentPassword" [(ngModel)]="currentPassword" name="currentPassword" [feedback]="false" required fluid></p-password>
|
||||
@@ -20,7 +20,7 @@
|
||||
<p-message *ngIf="!passwordsMatch && confirmNewPassword" severity="error" text="New passwords do not match."></p-message>
|
||||
</div>
|
||||
|
||||
<p-button label="Change Password" icon="pi pi-key" (click)="changePassword()" class="p-fluid"></p-button>
|
||||
<p-button type="submit" label="Change Password" icon="pi pi-key" class="p-fluid"></p-button>
|
||||
|
||||
<p-message *ngIf="errorMessage" severity="error" text="{{ errorMessage }}"></p-message>
|
||||
<p-message *ngIf="successMessage" severity="success" text="{{ successMessage }}"></p-message>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<ng-template pTemplate="title">Login</ng-template>
|
||||
|
||||
<ng-template pTemplate="content">
|
||||
<form #loginForm="ngForm">
|
||||
<form #loginForm="ngForm" (ngSubmit)="login()">
|
||||
<div class="p-field">
|
||||
<label for="username">Username</label>
|
||||
<input pInputText id="username" [(ngModel)]="username" name="username" required fluid/>
|
||||
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
|
||||
<div class="p-mt-3">
|
||||
<p-button label="Login" icon="pi pi-sign-in" (click)="login()" class="p-fluid"></p-button>
|
||||
<p-button type="submit" label="Login" icon="pi pi-sign-in" class="p-fluid"></p-button>
|
||||
</div>
|
||||
|
||||
<p-message *ngIf="errorMessage" severity="error" text="{{ errorMessage }}"></p-message>
|
||||
|
||||
@@ -8,6 +8,13 @@ export interface AppVersion {
|
||||
latest: string;
|
||||
}
|
||||
|
||||
export interface ReleaseNote {
|
||||
version: string;
|
||||
name: string;
|
||||
changelog: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -19,4 +26,8 @@ export class VersionService {
|
||||
getVersion(): Observable<AppVersion> {
|
||||
return this.http.get<AppVersion>(this.versionUrl);
|
||||
}
|
||||
|
||||
getChangelog(): Observable<ReleaseNote[]> {
|
||||
return this.http.get<ReleaseNote[]>(`${this.versionUrl}/changelog`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,10 +42,8 @@
|
||||
</div>
|
||||
<div *ngIf="versionInfo.latest && versionInfo.latest !== versionInfo.current">
|
||||
<a
|
||||
[href]="getVersionUrl(versionInfo.latest)"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="text-orange-400 hover:underline hover:text-orange-300 text-xs"
|
||||
(click)="openChangelogDialog()"
|
||||
class="cursor-pointer text-orange-400 hover:underline hover:text-orange-300 text-xs"
|
||||
>
|
||||
(Update)
|
||||
</a>
|
||||
|
||||
@@ -9,6 +9,8 @@ import {ShelfService} from '../../../book/service/shelf.service';
|
||||
import {BookService} from '../../../book/service/book.service';
|
||||
import {LibraryShelfMenuService} from '../../../book/service/library-shelf-menu.service';
|
||||
import {AppVersion, VersionService} from '../../../core/service/version.service';
|
||||
import {DialogService, DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {VersionChangelogDialogComponent} from './version-changelog-dialog/version-changelog-dialog.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-menu',
|
||||
@@ -21,12 +23,15 @@ export class AppMenuComponent implements OnInit {
|
||||
homeMenu$: Observable<any> | undefined;
|
||||
|
||||
versionInfo: AppVersion | null = null;
|
||||
dynamicDialogRef: DynamicDialogRef | undefined;
|
||||
|
||||
private libraryService = inject(LibraryService);
|
||||
private shelfService = inject(ShelfService);
|
||||
private bookService = inject(BookService);
|
||||
private versionService = inject(VersionService);
|
||||
private libraryShelfMenuService = inject(LibraryShelfMenuService);
|
||||
private dialogService = inject(DialogService);
|
||||
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
@@ -94,6 +99,20 @@ export class AppMenuComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
openChangelogDialog() {
|
||||
this.dynamicDialogRef = this.dialogService.open(VersionChangelogDialogComponent, {
|
||||
header: 'What’s New',
|
||||
modal: true,
|
||||
closable: true,
|
||||
style: {
|
||||
position: 'absolute',
|
||||
top: '10%',
|
||||
bottom: '10%',
|
||||
minWidth: '800px',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
getVersionUrl(version: string | undefined): string {
|
||||
if (!version) return '#';
|
||||
if (version.startsWith('v')) {
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<div *ngIf="loading" class="p-4 text-center text-gray-400">
|
||||
Loading changelog...
|
||||
</div>
|
||||
|
||||
<div *ngIf="!loading && changelog.length === 0" class="p-4 text-center text-gray-400">
|
||||
No updates available.
|
||||
</div>
|
||||
|
||||
<div *ngIf="!loading && changelog.length > 0" class="space-y-6 p-4 max-h-[70vh] overflow-auto">
|
||||
<div *ngFor="let release of changelog" class="border-b pb-4">
|
||||
<p class="font-bold text-2xl pb-2">
|
||||
<a [href]="release.url" target="_blank" rel="noopener noreferrer" class="text-blue-400 hover:underline">
|
||||
{{ release.name }}
|
||||
</a>
|
||||
</p>
|
||||
<div [innerHTML]="markdownToHtml(release.changelog)" class="prose prose-invert w-full max-w-full"></div>
|
||||
</div>
|
||||
</div>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
:host ::ng-deep .prose h3 {
|
||||
margin-top: 0px;
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
import { Component, inject, OnInit } from '@angular/core';
|
||||
import { ReleaseNote, VersionService } from '../../../../core/service/version.service';
|
||||
import { NgForOf, NgIf } from '@angular/common';
|
||||
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
||||
import showdown from 'showdown';
|
||||
|
||||
@Component({
|
||||
selector: 'app-version-changelog-dialog',
|
||||
standalone: true,
|
||||
imports: [NgIf, NgForOf],
|
||||
templateUrl: './version-changelog-dialog.component.html',
|
||||
styleUrl: './version-changelog-dialog.component.scss'
|
||||
})
|
||||
export class VersionChangelogDialogComponent implements OnInit {
|
||||
|
||||
private versionService = inject(VersionService);
|
||||
private sanitizer = inject(DomSanitizer);
|
||||
|
||||
changelog: ReleaseNote[] = [];
|
||||
loading = true;
|
||||
|
||||
private converter = new showdown.Converter({ tables: true, emoji: true });
|
||||
|
||||
ngOnInit(): void {
|
||||
this.versionService.getChangelog().subscribe({
|
||||
next: (data) => {
|
||||
this.changelog = data;
|
||||
this.loading = false;
|
||||
},
|
||||
error: () => {
|
||||
this.loading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
markdownToHtml(markdown: string): SafeHtml {
|
||||
let html = this.converter.makeHtml(markdown);
|
||||
html = html.replace(/<h2\b([^>]*)>/g, '<h3$1>').replace(/<\/h2>/g, '</h3>');
|
||||
return this.sanitizer.bypassSecurityTrustHtml(html);
|
||||
}
|
||||
}
|
||||
+65
-28
@@ -115,37 +115,37 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Series -->
|
||||
|
||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||
<div class="flex flex-col gap-1 w-1/3">
|
||||
<label for="language">Series</label>
|
||||
|
||||
<div class="flex flex-col gap-1 basis-2/6">
|
||||
<label for="seriesName">Series Name</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="seriesName" formControlName="seriesName" class="w-full"/>
|
||||
<p-button *ngIf="!metadata['seriesNameLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesName')" severity="success"></p-button>
|
||||
<p-button *ngIf="metadata['seriesNameLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesName')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 w-1/3">
|
||||
<label for="isbn10">Book Number</label>
|
||||
|
||||
<div class="flex flex-col gap-1 basis-1/6">
|
||||
<label for="seriesNumber">Book Number</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="seriesNumber" formControlName="seriesNumber" class="w-full"/>
|
||||
<p-button *ngIf="!metadata['seriesNumberLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesNumber')" severity="success"></p-button>
|
||||
<p-button *ngIf="metadata['seriesNumberLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesNumber')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 w-1/3">
|
||||
<label for="isbn13">Books in Series</label>
|
||||
|
||||
<div class="flex flex-col gap-1 basis-1/6">
|
||||
<label for="seriesTotal">Books in Series</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="seriesTotal" formControlName="seriesTotal" class="w-full"/>
|
||||
<p-button *ngIf="!metadata['seriesTotalLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesTotal')" severity="success"></p-button>
|
||||
<p-button *ngIf="metadata['seriesTotalLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesTotal')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ISBN, Language, Review Count -->
|
||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||
<div class="flex flex-col gap-1 w-1/3">
|
||||
<div class="flex flex-col gap-1 basis-1/6">
|
||||
<label for="language">Language</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="language" formControlName="language" class="w-full"/>
|
||||
@@ -153,7 +153,20 @@
|
||||
<p-button *ngIf="metadata['languageLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('language')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 w-1/3">
|
||||
|
||||
<div class="flex flex-col gap-1 basis-1/6">
|
||||
<label for="pageCount">Page Count</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="pageCount" formControlName="pageCount" class="w-full"/>
|
||||
<p-button *ngIf="!metadata['pageCountLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('pageCount')" severity="success"></p-button>
|
||||
<p-button *ngIf="metadata['pageCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('pageCount')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ISBN, Language, Review Count -->
|
||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||
<div class="flex flex-col gap-1 w-1/4">
|
||||
<label for="isbn10">ISBN 10</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="isbn10" formControlName="isbn10" class="w-full"/>
|
||||
@@ -161,7 +174,7 @@
|
||||
<p-button *ngIf="metadata['isbn10Locked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('isbn10')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 w-1/3">
|
||||
<div class="flex flex-col gap-1 w-1/4">
|
||||
<label for="isbn13">ISBN 13</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="isbn13" formControlName="isbn13" class="w-full"/>
|
||||
@@ -169,32 +182,56 @@
|
||||
<p-button *ngIf="metadata['isbn13Locked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('isbn13')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 w-1/4">
|
||||
<label for="reviewCount">Rating Count (Legacy)</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input [disabled]="true" pInputText id="reviewCount" formControlName="reviewCount" class="w-full"/>
|
||||
<p-button disabled *ngIf="!metadata['reviewCountLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('reviewCount')" severity="success"></p-button>
|
||||
<p-button disabled *ngIf="metadata['reviewCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('reviewCount')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 w-1/4">
|
||||
<label for="rating">Rating (Legacy)</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input [disabled]="true" pInputText id="rating" formControlName="rating" class="w-full"/>
|
||||
<p-button disabled *ngIf="!metadata['ratingLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('rating')" severity="success"></p-button>
|
||||
<p-button disabled *ngIf="metadata['ratingLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('rating')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Review Count, Rating, Page Count -->
|
||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||
<div class="flex flex-col gap-1 w-1/3">
|
||||
<label for="reviewCount">Review Count</label>
|
||||
<div class="flex flex-col gap-1 w-1/4">
|
||||
<label for="amazonRatingCount">Amazon Rating Count</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="reviewCount" formControlName="reviewCount" class="w-full"/>
|
||||
<p-button *ngIf="!metadata['reviewCountLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('reviewCount')" severity="success"></p-button>
|
||||
<p-button *ngIf="metadata['reviewCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('reviewCount')" severity="warn"></p-button>
|
||||
<input pInputText id="amazonRatingCount" formControlName="amazonReviewCount" class="w-full"/>
|
||||
<p-button *ngIf="!metadata['amazonReviewCountLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="success"></p-button>
|
||||
<p-button *ngIf="metadata['amazonReviewCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 w-1/3">
|
||||
<label for="rating">Rating</label>
|
||||
<div class="flex flex-col gap-1 w-1/4">
|
||||
<label for="amazonRating">Amazon Rating</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="rating" formControlName="rating" class="w-full"/>
|
||||
<p-button *ngIf="!metadata['ratingLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('rating')" severity="success"></p-button>
|
||||
<p-button *ngIf="metadata['ratingLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('rating')" severity="warn"></p-button>
|
||||
<input pInputText id="amazonRating" formControlName="amazonRating" class="w-full"/>
|
||||
<p-button *ngIf="!metadata['amazonRatingLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="success"></p-button>
|
||||
<p-button *ngIf="metadata['amazonRatingLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 w-1/3">
|
||||
<label for="pageCount">Page Count</label>
|
||||
<div class="flex flex-col gap-1 w-1/4">
|
||||
<label for="goodreadsReviewCount">Goodreads Rating Count</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="pageCount" formControlName="pageCount" class="w-full"/>
|
||||
<p-button *ngIf="!metadata['pageCountLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('pageCount')" severity="success"></p-button>
|
||||
<p-button *ngIf="metadata['pageCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('pageCount')" severity="warn"></p-button>
|
||||
<input pInputText id="goodreadsReviewCount" formControlName="goodreadsReviewCount" class="w-full"/>
|
||||
<p-button *ngIf="!metadata['goodreadsReviewCountLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="success"></p-button>
|
||||
<p-button *ngIf="metadata['goodreadsReviewCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 w-1/4">
|
||||
<label for="goodreadsRating">Goodreads Rating</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="goodreadsRating" formControlName="goodreadsRating" class="w-full"/>
|
||||
<p-button *ngIf="!metadata['goodreadsRatingLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="success"></p-button>
|
||||
<p-button *ngIf="metadata['goodreadsRatingLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+30
-2
@@ -64,6 +64,10 @@ export class MetadataEditorComponent implements OnInit {
|
||||
language: new FormControl(''),
|
||||
rating: new FormControl(''),
|
||||
reviewCount: new FormControl(''),
|
||||
amazonRating: new FormControl(''),
|
||||
amazonReviewCount: new FormControl(''),
|
||||
goodreadsRating: new FormControl(''),
|
||||
goodreadsReviewCount: new FormControl(''),
|
||||
seriesName: new FormControl(''),
|
||||
seriesNumber: new FormControl(''),
|
||||
seriesTotal: new FormControl(''),
|
||||
@@ -81,6 +85,10 @@ export class MetadataEditorComponent implements OnInit {
|
||||
languageLocked: new FormControl(false),
|
||||
ratingLocked: new FormControl(false),
|
||||
reviewCountLocked: new FormControl(false),
|
||||
amazonRatingLocked: new FormControl(false),
|
||||
amazonReviewCountLocked: new FormControl(false),
|
||||
goodreadsRatingLocked: new FormControl(false),
|
||||
goodreadsReviewCountLocked: new FormControl(false),
|
||||
seriesNameLocked: new FormControl(false),
|
||||
seriesNumberLocked: new FormControl(false),
|
||||
seriesTotalLocked: new FormControl(false),
|
||||
@@ -107,6 +115,10 @@ export class MetadataEditorComponent implements OnInit {
|
||||
language: metadata.language || null,
|
||||
rating: metadata.rating || null,
|
||||
reviewCount: metadata.reviewCount || null,
|
||||
amazonRating: metadata.amazonRating || null,
|
||||
amazonReviewCount: metadata.amazonReviewCount || null,
|
||||
goodreadsRating: metadata.goodreadsRating || null,
|
||||
goodreadsReviewCount: metadata.goodreadsReviewCount || null,
|
||||
seriesName: metadata.seriesName || null,
|
||||
seriesNumber: metadata.seriesNumber || null,
|
||||
seriesTotal: metadata.seriesTotal || null,
|
||||
@@ -124,6 +136,10 @@ export class MetadataEditorComponent implements OnInit {
|
||||
languageLocked: metadata.languageLocked || false,
|
||||
ratingLocked: metadata.ratingLocked || false,
|
||||
reviewCountLocked: metadata.reviewCountLocked || false,
|
||||
amazonRatingLocked: metadata.amazonRatingLocked || false,
|
||||
amazonReviewCountLocked: metadata.amazonReviewCountLocked || false,
|
||||
goodreadsRatingLocked: metadata.goodreadsRatingLocked || false,
|
||||
goodreadsReviewCountLocked: metadata.goodreadsReviewCountLocked || false,
|
||||
seriesNameLocked: metadata.seriesNameLocked || false,
|
||||
seriesNumberLocked: metadata.seriesNumberLocked || false,
|
||||
seriesTotalLocked: metadata.seriesTotalLocked || false,
|
||||
@@ -139,8 +155,12 @@ export class MetadataEditorComponent implements OnInit {
|
||||
if (metadata.languageLocked) this.metadataForm.get('language')?.disable();
|
||||
if (metadata.isbn10Locked) this.metadataForm.get('isbn10')?.disable();
|
||||
if (metadata.isbn13Locked) this.metadataForm.get('isbn13')?.disable();
|
||||
if (metadata.reviewCountLocked) this.metadataForm.get('reviewCount')?.disable();
|
||||
if (metadata.ratingLocked) this.metadataForm.get('rating')?.disable();
|
||||
this.metadataForm.get('reviewCount')?.disable();
|
||||
this.metadataForm.get('rating')?.disable();
|
||||
if (metadata.amazonReviewCountLocked) this.metadataForm.get('amazonReviewCount')?.disable();
|
||||
if (metadata.amazonRatingLocked) this.metadataForm.get('amazonRating')?.disable();
|
||||
if (metadata.goodreadsReviewCountLocked) this.metadataForm.get('goodreadsReviewCount')?.disable();
|
||||
if (metadata.goodreadsRatingLocked) this.metadataForm.get('goodreadsRating')?.disable();
|
||||
if (metadata.pageCountLocked) this.metadataForm.get('pageCount')?.disable();
|
||||
if (metadata.descriptionLocked) this.metadataForm.get('description')?.disable();
|
||||
if (metadata.seriesNameLocked) this.metadataForm.get('seriesName')?.disable();
|
||||
@@ -211,6 +231,10 @@ export class MetadataEditorComponent implements OnInit {
|
||||
pageCount: this.metadataForm.get('pageCount')?.value,
|
||||
rating: this.metadataForm.get('rating')?.value,
|
||||
reviewCount: this.metadataForm.get('reviewCount')?.value,
|
||||
amazonRating: this.metadataForm.get('amazonRating')?.value,
|
||||
amazonReviewCount: this.metadataForm.get('amazonReviewCount')?.value,
|
||||
goodreadsRating: this.metadataForm.get('goodreadsRating')?.value,
|
||||
goodreadsReviewCount: this.metadataForm.get('goodreadsReviewCount')?.value,
|
||||
language: this.metadataForm.get('language')?.value,
|
||||
seriesName: this.metadataForm.get('seriesName')?.value,
|
||||
seriesNumber: this.metadataForm.get('seriesNumber')?.value,
|
||||
@@ -229,6 +253,10 @@ export class MetadataEditorComponent implements OnInit {
|
||||
languageLocked: this.metadataForm.get('languageLocked')?.value,
|
||||
ratingLocked: this.metadataForm.get('ratingLocked')?.value,
|
||||
reviewCountLocked: this.metadataForm.get('reviewCountLocked')?.value,
|
||||
amazonRatingLocked: this.metadataForm.get('amazonRatingLocked')?.value,
|
||||
amazonReviewCountLocked: this.metadataForm.get('amazonReviewCountLocked')?.value,
|
||||
goodreadsRatingLocked: this.metadataForm.get('goodreadsRatingLocked')?.value,
|
||||
goodreadsReviewCountLocked: this.metadataForm.get('goodreadsReviewCountLocked')?.value,
|
||||
seriesNameLocked: this.metadataForm.get('seriesNameLocked')?.value,
|
||||
seriesNumberLocked: this.metadataForm.get('seriesNumberLocked')?.value,
|
||||
seriesTotalLocked: this.metadataForm.get('seriesTotalLocked')?.value,
|
||||
|
||||
+44
-28
@@ -54,8 +54,10 @@ export class MetadataPickerComponent implements OnInit {
|
||||
{label: 'Book #', controlName: 'seriesNumber', lockedKey: 'seriesNumberLocked', fetchedKey: 'seriesNumber'},
|
||||
{label: 'Total Books', controlName: 'seriesTotal', lockedKey: 'seriesTotalLocked', fetchedKey: 'seriesTotal'},
|
||||
{label: 'ISBN-13', controlName: 'isbn13', lockedKey: 'isbn13Locked', fetchedKey: 'isbn13'},
|
||||
{label: 'Rating', controlName: 'rating', lockedKey: 'ratingLocked', fetchedKey: 'rating'},
|
||||
{label: 'Reviews', controlName: 'reviewCount', lockedKey: 'reviewCountLocked', fetchedKey: 'reviewCount'},
|
||||
{label: 'Amazon Reviews', controlName: 'amazonReviewCount', lockedKey: 'amazonReviewCountLocked', fetchedKey: 'amazonReviewCount'},
|
||||
{label: 'Amazon Rating', controlName: 'amazonRating', lockedKey: 'amazonRatingLocked', fetchedKey: 'amazonRating'},
|
||||
{label: 'Goodreads Reviews', controlName: 'goodreadsReviewCount', lockedKey: 'goodreadsReviewCountLocked', fetchedKey: 'goodreadsReviewCount'},
|
||||
{label: 'Goodreads Rating', controlName: 'goodreadsRating', lockedKey: 'goodreadsRatingLocked', fetchedKey: 'goodreadsRating'},
|
||||
{label: 'Pages', controlName: 'pageCount', lockedKey: 'pageCountLocked', fetchedKey: 'pageCount'}
|
||||
];
|
||||
|
||||
@@ -88,8 +90,10 @@ export class MetadataPickerComponent implements OnInit {
|
||||
description: new FormControl(''),
|
||||
pageCount: new FormControl(''),
|
||||
language: new FormControl(''),
|
||||
rating: new FormControl(''),
|
||||
reviewCount: new FormControl(''),
|
||||
amazonRating: new FormControl(''),
|
||||
amazonReviewCount: new FormControl(''),
|
||||
goodreadsRating: new FormControl(''),
|
||||
goodreadsReviewCount: new FormControl(''),
|
||||
seriesName: new FormControl(''),
|
||||
seriesNumber: new FormControl(''),
|
||||
seriesTotal: new FormControl(''),
|
||||
@@ -106,8 +110,10 @@ export class MetadataPickerComponent implements OnInit {
|
||||
descriptionLocked: new FormControl(false),
|
||||
pageCountLocked: new FormControl(false),
|
||||
languageLocked: new FormControl(false),
|
||||
ratingLocked: new FormControl(false),
|
||||
reviewCountLocked: new FormControl(false),
|
||||
amazonRatingLocked: new FormControl(false),
|
||||
amazonReviewCountLocked: new FormControl(false),
|
||||
goodreadsRatingLocked: new FormControl(false),
|
||||
goodreadsReviewCountLocked: new FormControl(false),
|
||||
seriesNameLocked: new FormControl(false),
|
||||
seriesNumberLocked: new FormControl(false),
|
||||
seriesTotalLocked: new FormControl(false),
|
||||
@@ -122,22 +128,24 @@ export class MetadataPickerComponent implements OnInit {
|
||||
this.originalMetadata.thumbnailUrl = this.urlHelper.getCoverUrl(metadata.bookId, metadata.coverUpdatedOn);
|
||||
this.currentBookId = metadata.bookId;
|
||||
this.metadataForm.patchValue({
|
||||
title: metadata.title || '',
|
||||
subtitle: metadata.subtitle || '',
|
||||
title: metadata.title || null,
|
||||
subtitle: metadata.subtitle || null,
|
||||
authors: (metadata.authors || []).sort().join(', '),
|
||||
categories: (metadata.categories || []).sort().join(', '),
|
||||
publisher: metadata.publisher || '',
|
||||
publishedDate: metadata.publishedDate || '',
|
||||
isbn10: metadata.isbn10 || '',
|
||||
isbn13: metadata.isbn13 || '',
|
||||
description: metadata.description || '',
|
||||
pageCount: metadata.pageCount || '',
|
||||
language: metadata.language || '',
|
||||
rating: metadata.rating || '',
|
||||
reviewCount: metadata.reviewCount || '',
|
||||
seriesName: metadata.seriesName || '',
|
||||
seriesNumber: metadata.seriesNumber || '',
|
||||
seriesTotal: metadata.seriesTotal || '',
|
||||
publisher: metadata.publisher || null,
|
||||
publishedDate: metadata.publishedDate || null,
|
||||
isbn10: metadata.isbn10 || null,
|
||||
isbn13: metadata.isbn13 || null,
|
||||
description: metadata.description || null,
|
||||
pageCount: metadata.pageCount || null,
|
||||
language: metadata.language || null,
|
||||
amazonRating: metadata.amazonRating || null,
|
||||
amazonReviewCount: metadata.amazonReviewCount || null,
|
||||
goodreadsRating: metadata.goodreadsRating || null,
|
||||
goodreadsReviewCount: metadata.goodreadsReviewCount || null,
|
||||
seriesName: metadata.seriesName || null,
|
||||
seriesNumber: metadata.seriesNumber || null,
|
||||
seriesTotal: metadata.seriesTotal || null,
|
||||
thumbnailUrl: this.urlHelper.getCoverUrl(metadata.bookId, metadata.coverUpdatedOn),
|
||||
|
||||
titleLocked: metadata.titleLocked || false,
|
||||
@@ -151,8 +159,10 @@ export class MetadataPickerComponent implements OnInit {
|
||||
descriptionLocked: metadata.descriptionLocked || false,
|
||||
pageCountLocked: metadata.pageCountLocked || false,
|
||||
languageLocked: metadata.languageLocked || false,
|
||||
ratingLocked: metadata.ratingLocked || false,
|
||||
reviewCountLocked: metadata.reviewCountLocked || false,
|
||||
amazonRatingLocked: metadata.amazonRatingLocked || false,
|
||||
amazonReviewCountLocked: metadata.amazonReviewCountLocked || false,
|
||||
goodreadsRatingLocked: metadata.goodreadsRatingLocked || false,
|
||||
goodreadsReviewCountLocked: metadata.goodreadsReviewCountLocked || false,
|
||||
seriesNameLocked: metadata.seriesNameLocked || false,
|
||||
seriesNumberLocked: metadata.seriesNumberLocked || false,
|
||||
seriesTotalLocked: metadata.seriesTotalLocked || false,
|
||||
@@ -168,8 +178,10 @@ export class MetadataPickerComponent implements OnInit {
|
||||
if (metadata.languageLocked) this.metadataForm.get('language')?.disable();
|
||||
if (metadata.isbn10Locked) this.metadataForm.get('isbn10')?.disable();
|
||||
if (metadata.isbn13Locked) this.metadataForm.get('isbn13')?.disable();
|
||||
if (metadata.reviewCountLocked) this.metadataForm.get('reviewCount')?.disable();
|
||||
if (metadata.ratingLocked) this.metadataForm.get('rating')?.disable();
|
||||
if (metadata.amazonReviewCountLocked) this.metadataForm.get('amazonReviewCount')?.disable();
|
||||
if (metadata.amazonRatingLocked) this.metadataForm.get('amazonRating')?.disable();
|
||||
if (metadata.goodreadsReviewCountLocked) this.metadataForm.get('goodreadsReviewCount')?.disable();
|
||||
if (metadata.goodreadsRatingLocked) this.metadataForm.get('goodreadsRating')?.disable();
|
||||
if (metadata.pageCountLocked) this.metadataForm.get('pageCount')?.disable();
|
||||
if (metadata.descriptionLocked) this.metadataForm.get('description')?.disable();
|
||||
if (metadata.seriesNameLocked) this.metadataForm.get('seriesName')?.disable();
|
||||
@@ -211,8 +223,10 @@ export class MetadataPickerComponent implements OnInit {
|
||||
description: this.metadataForm.get('description')?.value || this.copiedFields['description'] ? this.getValueOrCopied('description') : '',
|
||||
pageCount: this.metadataForm.get('pageCount')?.value || this.copiedFields['pageCount'] ? this.getPageCountOrCopied() : null,
|
||||
language: this.metadataForm.get('language')?.value || this.copiedFields['language'] ? this.getValueOrCopied('language') : '',
|
||||
rating: this.metadataForm.get('rating')?.value || this.copiedFields['rating'] ? this.getNumberOrCopied('rating') : null,
|
||||
reviewCount: this.metadataForm.get('reviewCount')?.value || this.copiedFields['reviewCount'] ? this.getNumberOrCopied('reviewCount') : null,
|
||||
amazonRating: this.metadataForm.get('amazonRating')?.value || this.copiedFields['amazonRating'] ? this.getNumberOrCopied('amazonRating') : null,
|
||||
amazonReviewCount: this.metadataForm.get('amazonReviewCount')?.value || this.copiedFields['amazonReviewCount'] ? this.getNumberOrCopied('amazonReviewCount') : null,
|
||||
goodreadsRating: this.metadataForm.get('goodreadsRating')?.value || this.copiedFields['goodreadsRating'] ? this.getNumberOrCopied('goodreadsRating') : null,
|
||||
goodreadsReviewCount: this.metadataForm.get('goodreadsReviewCount')?.value || this.copiedFields['goodreadsReviewCount'] ? this.getNumberOrCopied('goodreadsReviewCount') : null,
|
||||
seriesName: this.metadataForm.get('seriesName')?.value || this.copiedFields['seriesName'] ? this.getValueOrCopied('seriesName') : '',
|
||||
seriesNumber: this.metadataForm.get('seriesNumber')?.value || this.copiedFields['seriesNumber'] ? this.getNumberOrCopied('seriesNumber') : null,
|
||||
seriesTotal: this.metadataForm.get('seriesTotal')?.value || this.copiedFields['seriesTotal'] ? this.getNumberOrCopied('seriesTotal') : null,
|
||||
@@ -229,8 +243,10 @@ export class MetadataPickerComponent implements OnInit {
|
||||
descriptionLocked: this.metadataForm.get('descriptionLocked')?.value,
|
||||
pageCountLocked: this.metadataForm.get('pageCountLocked')?.value,
|
||||
languageLocked: this.metadataForm.get('languageLocked')?.value,
|
||||
ratingLocked: this.metadataForm.get('ratingLocked')?.value,
|
||||
reviewCountLocked: this.metadataForm.get('reviewCountLocked')?.value,
|
||||
amazonRatingLocked: this.metadataForm.get('amazonRatingLocked')?.value,
|
||||
amazonReviewCountLocked: this.metadataForm.get('amazonReviewCountLocked')?.value,
|
||||
goodreadsRatingLocked: this.metadataForm.get('goodreadsRatingLocked')?.value,
|
||||
goodreadsReviewCountLocked: this.metadataForm.get('goodreadsReviewCountLocked')?.value,
|
||||
seriesNameLocked: this.metadataForm.get('seriesNameLocked')?.value,
|
||||
seriesNumberLocked: this.metadataForm.get('seriesNumberLocked')?.value,
|
||||
seriesTotalLocked: this.metadataForm.get('seriesTotalLocked')?.value,
|
||||
|
||||
+19
-4
@@ -28,9 +28,23 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-4 pt-2">
|
||||
<p-rating [(ngModel)]="metadata.rating" readonly stars="5"></p-rating>
|
||||
<p class="font-semibold">({{ metadata.reviewCount || 0 }} Reviews)</p>
|
||||
<div class="flex items-center gap-2 pt-2">
|
||||
<ng-container *ngIf="metadata.amazonRating || metadata.goodreadsRating; else legacyRating">
|
||||
<p *ngIf="metadata.amazonRating" class="font-semibold">Amazon: {{ metadata.amazonRating }}</p>
|
||||
<p-rating *ngIf="metadata.amazonRating" [(ngModel)]="metadata.amazonRating" readonly stars="5"></p-rating>
|
||||
<p *ngIf="metadata.amazonRating" class="font-semibold"> ({{ metadata.amazonReviewCount | number:'1.0-0' }})</p>
|
||||
|
||||
<p *ngIf="metadata.amazonRating && metadata.goodreadsRating">|</p>
|
||||
|
||||
<p *ngIf="metadata.goodreadsRating" class="font-semibold">Goodreads: {{ metadata.goodreadsRating }}</p>
|
||||
<p-rating *ngIf="metadata.goodreadsRating" [(ngModel)]="metadata.goodreadsRating" readonly stars="5"></p-rating>
|
||||
<p *ngIf="metadata.goodreadsRating" class="font-semibold"> ({{ metadata.goodreadsReviewCount | number:'1.0-0' }})</p>
|
||||
</ng-container>
|
||||
|
||||
<ng-template #legacyRating>
|
||||
<p-rating [(ngModel)]="metadata.rating" readonly stars="5"></p-rating>
|
||||
<p class="font-semibold">({{ metadata.reviewCount | number:'1.0-0' }} Ratings)</p>
|
||||
</ng-template>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-2 pt-4 overflow-x-auto scrollbar-hide">
|
||||
@@ -54,7 +68,8 @@
|
||||
<p-button label="Read" icon="pi pi-book" severity="info" (onClick)="read(metadata.bookId)"></p-button>
|
||||
<p-button label="Assign Shelf" icon="pi pi-folder" severity="info" outlined (onClick)="assignShelf(metadata.bookId)"></p-button>
|
||||
<p-button *ngIf="userData.permissions.canDownload" label="Download" icon="pi pi-download" severity="info" outlined (onClick)="download(metadata.bookId)"></p-button>
|
||||
<p-splitbutton *ngIf="userData.permissions.canEmailBook" label="Quick Send" icon="pi pi-send" [model]="items" (onClick)="quickSend(metadata.bookId)" outlined severity="info"/>
|
||||
<p-splitbutton *ngIf="userData.permissions.canEmailBook" label="Quick Send" icon="pi pi-send" [model]="items" (onClick)="quickSend(metadata.bookId)" outlined
|
||||
severity="info"/>
|
||||
<!--<p-button
|
||||
outlined
|
||||
[label]="metadata.allFieldsLocked ? 'Unlock Metadata' : 'Lock Metadata'"
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import {Component, inject, Input, OnInit} from '@angular/core';
|
||||
import {Button} from 'primeng/button';
|
||||
import {AsyncPipe, NgClass, NgForOf, NgIf} from '@angular/common';
|
||||
import {AsyncPipe, DecimalPipe, NgClass, NgForOf, NgIf} from '@angular/common';
|
||||
import {first, Observable} from 'rxjs';
|
||||
import {BookService} from '../../../book/service/book.service';
|
||||
import {BookMetadataCenterService} from '../book-metadata-center.service';
|
||||
@@ -24,7 +24,7 @@ import {Tooltip} from 'primeng/tooltip';
|
||||
standalone: true,
|
||||
templateUrl: './metadata-viewer.component.html',
|
||||
styleUrl: './metadata-viewer.component.scss',
|
||||
imports: [Button, NgForOf, NgIf, AsyncPipe, Rating, FormsModule, Tag, Divider, SplitButton, NgClass, Tooltip]
|
||||
imports: [Button, NgForOf, NgIf, AsyncPipe, Rating, FormsModule, Tag, Divider, SplitButton, NgClass, Tooltip, DecimalPipe]
|
||||
})
|
||||
export class MetadataViewerComponent implements OnInit {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export const environment = {
|
||||
production: false,
|
||||
API_CONFIG: {
|
||||
BASE_URL: 'http://localhost:7050',
|
||||
BROKER_URL: 'ws://localhost:7050/ws',
|
||||
BASE_URL: 'http://localhost:8080',
|
||||
BROKER_URL: 'ws://localhost:8080/ws',
|
||||
},
|
||||
};
|
||||
|
||||
+14
-14
@@ -1,18 +1,18 @@
|
||||
import { provideHttpClient, withInterceptors } from '@angular/common/http';
|
||||
import { DialogService } from 'primeng/dynamicdialog';
|
||||
import { ConfirmationService, MessageService } from 'primeng/api';
|
||||
import { RxStompService } from './app/shared/websocket/rx-stomp.service';
|
||||
import { rxStompServiceFactory } from './app/shared/websocket/rx-stomp-service-factory';
|
||||
import { provideRouter, RouteReuseStrategy } from '@angular/router';
|
||||
import { CustomReuseStrategy } from './app/custom-reuse-strategy';
|
||||
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
|
||||
import { providePrimeNG } from 'primeng/config';
|
||||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
import { AppComponent } from './app/app.component';
|
||||
import {provideHttpClient, withInterceptors} from '@angular/common/http';
|
||||
import {DialogService} from 'primeng/dynamicdialog';
|
||||
import {ConfirmationService, MessageService} from 'primeng/api';
|
||||
import {RxStompService} from './app/shared/websocket/rx-stomp.service';
|
||||
import {rxStompServiceFactory} from './app/shared/websocket/rx-stomp-service-factory';
|
||||
import {provideRouter, RouteReuseStrategy} from '@angular/router';
|
||||
import {CustomReuseStrategy} from './app/custom-reuse-strategy';
|
||||
import {provideAnimationsAsync} from '@angular/platform-browser/animations/async';
|
||||
import {providePrimeNG} from 'primeng/config';
|
||||
import {bootstrapApplication} from '@angular/platform-browser';
|
||||
import {AppComponent} from './app/app.component';
|
||||
import Aura from '@primeng/themes/aura';
|
||||
import { routes } from './app/app.routes';
|
||||
import { AuthInterceptorService } from './app/auth-interceptor.service';
|
||||
import { AuthService } from './app/core/service/auth.service';
|
||||
import {routes} from './app/app.routes';
|
||||
import {AuthInterceptorService} from './app/auth-interceptor.service';
|
||||
import {AuthService} from './app/core/service/auth.service';
|
||||
|
||||
bootstrapApplication(AppComponent, {
|
||||
providers: [
|
||||
|
||||
@@ -6,6 +6,9 @@ module.exports = {
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [require('tailwindcss-primeui')]
|
||||
plugins: [
|
||||
require('tailwindcss-primeui'),
|
||||
require('@tailwindcss/typography')
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -12,7 +12,10 @@ TZ=Etc/UTC # Change this to your timezone (e.g., America/New_York, Asia/Kolk
|
||||
|
||||
# Database Credentials (Replace with a secure password)
|
||||
# This password is used by MariaDB. Make sure to keep it secure.
|
||||
MYSQL_ROOT_PASSWORD=your_secure_password
|
||||
MYSQL_ROOT_PASSWORD=super_secure_password
|
||||
MYSQL_DATABASE=booklore
|
||||
MYSQL_USER=booklore
|
||||
MYSQL_PASSWORD=your_secure_password
|
||||
|
||||
# Paths for Docker Volumes (Update these paths as per your system)
|
||||
# These paths store persistent data for Booklore and MariaDB.
|
||||
|
||||
@@ -5,6 +5,10 @@ services:
|
||||
container_name: booklore_server
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- DATABASE_URL=jdbc:mariadb://mariadb:3306/${MYSQL_DATABASE}
|
||||
- DATABASE_USERNAME=${MYSQL_USER}
|
||||
- DATABASE_PASSWORD=${MYSQL_PASSWORD}
|
||||
depends_on:
|
||||
mariadb:
|
||||
condition: service_healthy
|
||||
@@ -15,7 +19,7 @@ services:
|
||||
- ${BOOKLORE_BOOKS_PATH}:/books
|
||||
|
||||
mariadb:
|
||||
image: lscr.io/linuxserver/mariadb:11.4.5
|
||||
image: lscr.io/linuxserver/mariadb:11.4
|
||||
container_name: booklore_mariadb
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
Reference in New Issue
Block a user