[Bug]: Books aren't renamed or pruned with their library

Open Beginner friendly
#110 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
backend, databases

Research direction

Read the rename loop in updateLibrary at src/api/settings.rs:317 and compare its table list against the one in prune_removed_libraries at src/library/scanner.rs:631. Both hardcode the media tables to walk, so the change is adding books alongside items, skipped, tracks, albums, artists in each place, keeping the surrounding query style. Done means a renamed book library shows its books without a rescan and a removed book library leaves no rows behind; verify by renaming and removing a books library and checking the books table.

Written by the indexing model from the issue text.

Description

bug

[!NOTE]
This issue was written by Claude (Claude Opus 5.5) from a code review session with @PhrolovaMoe. It was found by reading the code and hasn't been reproduced on a running server.

Version

0.40.0 (feat/desktop, 017a837b)

Area

Other

What happened?
  • The rename loop in updateLibrary covers items, skipped, tracks, albums, artists but not books (src/api/settings.rs:317), so a renamed book library looks empty until a rescan relabels each book through the upsert.
  • prune_removed_libraries deletes rows from items, skipped, tracks, albums and artists for removed libraries, but never from books (src/library/scanner.rs:631), so books from a removed library stay in the database.
Steps to reproduce
  1. Rename a books library: it shows no books until it's rescanned.
  2. Remove a books library: its rows stay in books.
Expected behavior

Books follow their library like every other kind of media.

Suggested fix

Add books to both table lists.

Dominant language
TypeScript
Stars
4
Forks
1
Avg merge
4h 49m
Merged PRs (30d)
5

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tinystream-dev/tinystream

All issues in tinystream-dev/tinystream

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.