diff --git a/README.md b/README.md index 1fcf47297..fcf40cfd3 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A self-hosted library management and reading platform for ebooks, PDFs, audioboo [![Stars](https://img.shields.io/github/stars/bookorbit/bookorbit?style=flat)](https://github.com/bookorbit/bookorbit/stargazers) [![CI](https://github.com/bookorbit/bookorbit/actions/workflows/ci.yml/badge.svg)](https://github.com/bookorbit/bookorbit/actions/workflows/ci.yml) [![Release](https://github.com/bookorbit/bookorbit/actions/workflows/release.yml/badge.svg)](https://github.com/bookorbit/bookorbit/actions/workflows/release.yml) -[![codecov](https://codecov.io/gh/bookorbit/bookorbit/graph/badge.svg?token=F6TADEFCUV)](https://codecov.io/gh/bookorbit/bookorbit) +[![Server Coverage](https://codecov.io/gh/bookorbit/bookorbit/graph/badge.svg?token=F6TADEFCUV&flag=server)](https://codecov.io/gh/bookorbit/bookorbit) [![Latest release](https://img.shields.io/github/v/release/bookorbit/bookorbit?label=latest)](https://github.com/bookorbit/bookorbit/releases) [![Commits/month](https://img.shields.io/github/commit-activity/m/bookorbit/bookorbit?label=commits%2Fmonth)](https://github.com/bookorbit/bookorbit/commits/main) [![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](LICENSE) @@ -123,12 +123,6 @@ For local development, see [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md). To contri --- -## Code Coverage Map - -![Codecov Grid](https://codecov.io/gh/bookorbit/bookorbit/graphs/tree.svg?token=F6TADEFCUV) - ---- - ## Support - **Questions and discussion:** [GitHub Discussions](https://github.com/bookorbit/bookorbit/discussions) diff --git a/codecov.yml b/codecov.yml index 7d2c3eab8..56419d237 100644 --- a/codecov.yml +++ b/codecov.yml @@ -59,3 +59,22 @@ flags: paths: - client/** carryforward: true + +ignore: + - "server/src/**/*.test.ts" + - "server/src/scripts/**" + - "server/src/**/*.module.ts" + - "server/src/main.ts" + - "server/src/db/schema/**" + - "server/src/**/*.types.ts" + - "server/src/**/*.interface.ts" + - "server/src/**/*.constants.ts" + - "server/src/**/*.enum.ts" + - "server/src/config/**" + - "server/src/common/types/**" + - "client/src/**/*.test.ts" + - "client/src/**/*.spec.ts" + - "client/src/**/__tests__/**" + - "client/src/main.ts" + - "client/src/**/*.d.ts" + - "client/src/**/*.types.ts" diff --git a/server/src/modules/book/book.repository.test.ts b/server/src/modules/book/book.repository.test.ts index 0214320c1..a13f9281c 100644 --- a/server/src/modules/book/book.repository.test.ts +++ b/server/src/modules/book/book.repository.test.ts @@ -357,8 +357,10 @@ describe('BookRepository', () => { expect(db.delete).toHaveBeenCalledTimes(1); expect(deleteWhere).toHaveBeenCalledTimes(1); - expect(db.update).toHaveBeenCalledTimes(1); - expect(updateWhere).toHaveBeenCalledTimes(1); + expect(db.update).toHaveBeenCalledTimes(2); + expect(updateBuilder.set).toHaveBeenNthCalledWith(1, { title: 'Updated' }); + expect(updateBuilder.set).toHaveBeenNthCalledWith(2, expect.objectContaining({ updatedAt: expect.any(Date) })); + expect(updateWhere).toHaveBeenCalledTimes(2); expect(db.insert).toHaveBeenCalledTimes(1); }); diff --git a/server/src/modules/book/book.repository.ts b/server/src/modules/book/book.repository.ts index 0f09a5098..7c80d8fbc 100644 --- a/server/src/modules/book/book.repository.ts +++ b/server/src/modules/book/book.repository.ts @@ -988,6 +988,7 @@ export class BookRepository { executor: MetadataUpdateExecutor = this.db, ): Promise { await executor.update(bookMetadata).set(fields).where(eq(bookMetadata.bookId, bookId)); + await executor.update(books).set({ updatedAt: new Date() }).where(eq(books.id, bookId)); } async bulkUpdateMetadataFields( @@ -997,6 +998,7 @@ export class BookRepository { ): Promise { if (bookIds.length === 0) return; await executor.update(bookMetadata).set(fields).where(inArray(bookMetadata.bookId, bookIds)); + await executor.update(books).set({ updatedAt: new Date() }).where(inArray(books.id, bookIds)); } async upsertProgress(