Skip to content

Add Kindling backend plan document#16

Merged
mmgoodnow merged 23 commits intomainfrom
feat/kindling-backend
Feb 28, 2026
Merged

Add Kindling backend plan document#16
mmgoodnow merged 23 commits intomainfrom
feat/kindling-backend

Conversation

@mmgoodnow
Copy link
Copy Markdown
Owner

Summary

  • add PLAN.md capturing goals, architecture, data model, job semantics, jobs, APIs, integrations, and testing expectations for the Kindling backend rewrite
  • codify detailed persistence, status, asset, and acquisition strategies plus observability, auth, and admin UI guidelines
  • document required tests, mock services, and implementation order to keep future work scoped and trackable

Testing

  • Not run (not requested)

Comment thread test/unit/torrent.test.ts
"0123456789abcdef0123456789abcdef01234567"
);

expect(normalizeInfoHash("AERUKZ4JVPG66AJDIVTYTK6N54ASGRLH")).toBe(
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we would never see this kind of info hash. what is this?

Comment thread test/unit/torrent.test.ts
Comment on lines +16 to +21
test("extracts hash from magnet", () => {
expect(infoHashFromMagnet("magnet:?xt=urn:btih:0123456789abcdef0123456789abcdef01234567")).toBe(
"0123456789abcdef0123456789abcdef01234567"
);
expect(infoHashFromMagnet("https://example.com")).toBeNull();
});
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all code that deals with magnet links. our code does not need to handle magnet links.

Comment thread test/unit/torrent.test.ts
Comment on lines +23 to +26
test("computes info hash from torrent bytes", () => {
const payload = Buffer.from("d8:announce13:http://t/4:infod4:name4:test12:piece lengthi16384e6:lengthi10e6:pieces20:12345678901234567890ee", "ascii");
expect(infoHashFromTorrentBytes(payload)).toBe("800f59e21e8f1129643a478cd402b4180f410435");
});
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we shouldn't really need to compute info hash from the actual info dict either. it will always be present on Torznab items

Comment thread src/config.ts
Comment on lines 18 to 20
const transcodeStatusPath = path.join(dataDir, "transcode-status.json");
const libraryIndexPath = path.join(dataDir, "library-index.json");
const probeCachePath = path.join(dataDir, "probe-cache.json");
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the data currently in these json files - we should store it in the sqlite database.

Comment thread src/kindling/worker.ts
for (const media of mediaList) {
const query = `${book.title} ${book.author}`.trim();
const results = await runSearch(settings, { query, media });
for (const result of results.slice(0, 3)) {
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we just blindly snatch all top 3 search results?

Comment thread src/kindling/torrent.ts
throw new Error("Unsupported info hash format");
}

export function infoHashFromMagnet(url: string): string | null {
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magnets are out of scope. remove

Comment thread src/kindling/torrent.ts
Comment on lines +42 to +44
if (trimmed.length === 32 && /^[a-zA-Z2-7]+$/.test(trimmed)) {
return Buffer.from(base32ToBytes(trimmed)).toString("hex");
}
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

base 32 info hashes are not a thing.

Comment thread src/kindling/torrent.ts
@@ -0,0 +1,156 @@
import { createHash } from "node:crypto";
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should take a dep on bencode.

Comment thread src/kindling/http.ts
if (!authorizeRequest(request, settings)) {
return new Response("Unauthorized", {
status: 401,
headers: { "WWW-Authenticate": 'Bearer realm="kindling"' },
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all references to "kindling" - the reason we implemented it inside podible is because this is what I want podible to be.

@mmgoodnow mmgoodnow merged commit 6824f20 into main Feb 28, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant