Commit Graph
7 Commits
Author SHA1 Message Date
David Lacroix 5472c36c56 fix(irc): accept a channel setting written with its # prefix (#1722)
The IRC channel setting asks for the name without the `#`, and the
client adds it when it joins. Mine was stored as `#ebooks`, so Shelfmark
joined `##ebooks`, a different and nearly empty channel. The log said
`Joined ##ebooks - 1 servers online`, every search came back empty, and
nothing in the UI said why. With `ebooks` the same search joined
`#ebooks` with 26 servers and returned 9 results.

This strips whitespace and leading `#` where the two channel settings
are read: the release source (availability, search channel, audiobook
channel) and the download handler, which reads `IRC_CHANNEL` on its own.
The join, the message target and the cache key all get the bare name.

Tests are in `tests/irc/test_source.py` (main and audiobook channel) and
a new `tests/irc/test_handler.py`. With the source change reverted all
three fail (`assert '#ebooks' == 'ebooks'`). `make python-checks` is
clean.

One thing I left alone: the download handler always uses `IRC_CHANNEL`,
never `IRC_AUDIOBOOK_CHANNEL`, so an audiobook found in a separate
audiobook channel is requested in the main one.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* IRC channel settings now work consistently whether entered with or
without a leading `#`. Surrounding whitespace is also handled, helping
searches, audiobook routing, and downloads use the intended channel.
* Downloads connect using the normalized channel name while keeping the
channel request correctly formatted.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-15 18:27:14 -05:00
Zoltán Szabó 35037b35fd fix(irc): search by surname, and rank the answer by author (#1331) (#1332)
Fixes #1331.

A search bot ANDs every term against a filename, so the given name is
the term
that empties the result set. Measured against irchighway's #ebooks:
"Revelations
David Petrie" is answered "no results", "Revelations Petrie" returns 9
matches,
6 of which parse, all filed as "D Petrie".

The query now carries the title and the surname, read off the search
variant so
the ISBN fallback and a manual query - which set author="" on purpose -
keep
their current shape.

Title-only, the shape #1295 settled on for Prowlarr, does not transfer:
the bot
caps an answer at 1000 matches, and a bare "Revelations" hits that cap
with 923
parsed rows across 500 authors, so the cap itself can drop the wanted
book. The
surname is the token the two spellings share and it keeps the answer
small.

The full author then orders what comes back, reusing author_affinity
from #1295,
since a surname also matches a different author who shares it. It sits
under
server availability the way indexer priority does in #1295: a download
addresses
one named bot and waits 120s for it, so a match from a bot that has left
the
channel must not outrank a mismatch that can answer. Ranking runs on the
way out
rather than before the cache, because one query identity is shared by
every book
that produced that query.

Two things found while testing:

- The parser writes the literal "Unknown" when a filename has no " - "
separator
  (parser.py:168). Ranked literally that sorts as a wrong author, so
author_affinity's middle tier was unreachable here; it is now read as
absent.
  5 of those 923 rows are affected.
- author_affinity moves to shelfmark/core/author_match.py, unchanged, so
IRC
does not import from the Prowlarr package. Prowlarr behaviour is
untouched and
  its tests pass as they are.

The three IRC assertions in the #1252 regression file move to the
surname form.
The invariant they pin - one contributor's name reaches the query, never
the
whole credit list - is unchanged.

Tested with make python-lint, python-format, python-dead-code,
python-typecheck
and python-test, and end to end against irchighway with the patched
source: it
posts "Revelations Petrie" and returns 6 releases.
2026-09-11 22:14:37 -04:00
CaliBrain 7fdaf3f67d Add Audiobook support to IRC (#1136) 2026-07-24 18:34:12 -04:00
CaliBrain e9668371f7 Fix IRC caching (#1072) 2026-06-17 14:25:31 -04:00
CaliBrain c64c2d374a Make IRC less spammy and require a bot name for conversatons (#1065)
First step towards fixing the friction created by shelfmark in #997
2026-06-14 01:40:09 -04:00
Alex d7b9f2e67f Backend test hardening + quality enforcement (#872)
- Reworked many tests
- Enforcing lint + type checking for test suite
- Fixed various issues surfaced by the new tests
- CI tweaks
2026-04-12 12:01:52 +01:00
Alex c59ea46540 Frontend update + Misc fixes (#735)
- Updated frontend CSS to Tailwind v4
- Reverted socket IO origin restriction
- Fixed search queries not persisting after auth redirect
- Move advanced search options to left UI selector
- Unlock IRC source to be used for audiobook content_type
- Tweaked security settings env var syncing to be prioritised
- Fix AA "all languages" query generation
- Added language-free AA query as second fallback in case of no results
- Testing moving SeleniumBase scratch files to /tmp via symlink
- Added enhanced logging for activity dismissals and other events
- Removed iFrame restrictions
2026-03-11 18:16:34 +00:00