Add a scheduled, throttled metadata refresh for books already in the library
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start with LibraryController.cs and LibraryMetadataRescanWorkflow.cs for the existing per-book refresh, then read AuthorMonitoringBackgroundService.cs and AuthorMonitoringService.cs for scheduling and monitoring patterns. The issue proposes three coordinated operations sharing a throttle that counts provider requests, plus progress and logging; scope and design are still open for discussion, so agree on the shape before implementation.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The only route that re-fetches provider metadata for a book already in the library is per book: POST /api/v1/library/{id}/rescan-metadata (listenarr.api/Features/Library/LibraryController.cs:165). Nothing schedules it, and there is no library-wide or per-author way to trigger it either.
Author monitoring and series monitoring each announce a twenty-four hour interval on start and report each cycle's completion (AuthorMonitoringBackgroundService.cs, around lines 28 and 32), but every message either job emits is about adding a book, not revisiting one. In AuthorMonitoringService.cs, a book already matched to an existing row increments an ExistingCount and moves to the next one, around lines 253 and 278; nothing there refreshes it. The one job whose name contains "rescan," MetadataRescanService.cs (five minutes fixed at line 32), turns out to be a file-tag repair job rather than a provider refresh, and logs nothing on a cycle with no candidate files.
The per-book call bypasses the metadata cache (GetMetadataAsync(..., cache: false), LibraryMetadataRescanWorkflow.cs around line 169) and loops the configured regions for every identifier it tries (around lines 147, 201 and 224), so one book is worth more than one provider request. A throttle on a bulk version of this needs to count requests, not books, or it will undercount its own traffic by that multiplier. The endpoint has a short per-actor cooldown on one call, but nothing throttles a run across many books, since no such run exists yet.
I think the shape to reach for is close to what Sonarr, Radarr and Readarr already settled on for their own catalogue units. Readarr, as I recall it, offers a per-author refresh-and-scan command alongside a scheduled refresh task, both routed through the provider client's own rate limiting. I'd name three shapes here, all through the same throttle: a per-author manual trigger, since the per-book route exists and a library-wide one doesn't, and the author is the natural unit the monitoring jobs already work in; a background job walking monitored authors on a configurable interval and refreshing the books already held for each, spread across the interval rather than fired all at once; and an explicit library-wide operation, with its own progress reporting, for when a per-author walk isn't the right tool, catching a whole library up in one throttled pass instead of a shell loop hitting the per-book endpoint thousands of times. A tasks page listing every scheduled job would help, but that's a separate, larger piece of work, so I'm leaving it out here.
On a real library I measured a couple of thousand series-membership rows with no identifier and never a second series, a separate defect I am writing up. Our #768 and #847, plus a monitoring-mapper fix still in progress, should get new rows carrying that data correctly going forward, but none of it repairs what's already there. That's exactly the case the library-wide operation above is for: once a fix like that lands, catching existing rows up should be one throttled operation, not thousands of individual calls.
I am building all three as one piece of work, sharing the per-book workflow, one throttle that counts provider requests, and the log contract the monitoring jobs already follow, and running it on a real library before offering it. If you would rather have fewer of the three, or a different unit than the author, say so before it arrives and I will cut it to fit.
Disclosure: drafted with Claude Code at my direction; I read the cited code at the stated commit and reviewed this before posting.
- Ngôn ngữ chính
- C#
- Star
- 901
- Fork
- 70
- Merge trung bình
- 16 giờ 27 phút
- Pull request đã merge (30 ngày)
- 60
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Listenarrs/Listenarr
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Listenarrs/Listenarr#1173 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Listenarrs/Listenarr#1133 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Listenarrs/Listenarr#1128 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add New's search splits a title that contains "Series:", "Author:"… as if they were search keywordsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Listenarrs/Listenarr#1127 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
p3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Listenarrs/Listenarr#971 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Listenarrs/Listenarr
Issue tương tự
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/backend type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
umbraco/Umbraco-CMS#24668 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Pri3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
MicrosoftDocs/windows-dev-docs#6205 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area-ai untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dotnet/extensions#7956 ·
Maintainer thường phản hồi trong vòng 1 ngày