diff --git a/docs/environment-variables.md b/docs/environment-variables.md index 9682fdf9..db5923a4 100644 --- a/docs/environment-variables.md +++ b/docs/environment-variables.md @@ -1441,7 +1441,7 @@ Delay between requests in seconds to avoid rate limiting (0-10). | `IRC_CHANNEL` | Channel name without the # prefix. Used for all searches unless a separate audiobook channel is configured below. | string | _none_ | | `IRC_NICK` | Your IRC nickname (required). Must be unique on the IRC network. | string | _none_ | | `IRC_SEARCH_BOT` | The search bot to address queries to (required). Searches are sent as "@ ". | string | _none_ | -| `IRC_AUDIOBOOK_CHANNEL` | Optional. Channel name (without the # prefix) to use for audiobook searches. Leave blank to use the main channel above for audiobooks too. | string | _none_ | +| `IRC_AUDIOBOOK_CHANNEL` | Optional. Channel name (without the # prefix) for networks that index audiobooks separately, such as Undernet's bookz. Leave blank (the usual setting) to search the main channel above for audiobooks too. | string | _none_ | | `IRC_AUDIOBOOK_SEARCH_BOT` | Optional. Search bot for the audiobook channel. Leave blank to reuse the main search bot above. Only used when an audiobook channel is set. | string | _none_ | | `IRC_CACHE_TTL` | How long to keep cached search results before they expire. | string (choice) | `2592000` | @@ -1510,7 +1510,7 @@ The search bot to address queries to (required). Searches are sent as "@ list[SettingsField]: key="audiobook_heading", title="Audiobooks", description=( - "Some networks index audiobooks in a separate channel from ebooks " - "(for example #ebooks for ebooks and #bookz for audiobooks). " - "Configure that channel here to search it for audiobook requests. " - "Leave these blank to search the main channel above for both." + "Most networks index audiobooks in the same channel as ebooks, so leaving " + "these blank is the right setting for almost everyone. On irc.irchighway.net " + "the audiobooks are in #ebooks and #bookz is effectively inactive — pointing " + "this at an empty channel just returns no results. Only fill these in when " + "your network really does index audiobooks elsewhere (Undernet's #bookz, for " + "example). Audiobooks are usually posted as archives, so keep ZIP and RAR " + "enabled under Supported Audiobook Formats or the releases are filtered out." ), ), TextField( @@ -113,8 +116,9 @@ def irc_settings() -> list[SettingsField]: label="Audiobook channel", placeholder="e.g. bookz", description=( - "Optional. Channel name (without the # prefix) to use for audiobook " - "searches. Leave blank to use the main channel above for audiobooks too." + "Optional. Channel name (without the # prefix) for networks that index " + "audiobooks separately, such as Undernet's bookz. Leave blank (the usual " + "setting) to search the main channel above for audiobooks too." ), required=False, env_supported=True, diff --git a/shelfmark/release_sources/irc/source.py b/shelfmark/release_sources/irc/source.py index 46336d2e..6ee134b5 100644 --- a/shelfmark/release_sources/irc/source.py +++ b/shelfmark/release_sources/irc/source.py @@ -240,11 +240,11 @@ class IRCReleaseSource(ReleaseSource): nick = _config_text("IRC_NICK") search_bot = _config_text("IRC_SEARCH_BOT") - # Audiobooks may be indexed in a separate channel from ebooks on some networks - # (e.g. #ebooks for ebooks, #bookz for audiobooks). When an audiobook channel is - # configured and an audiobook was requested, route the search there (with its own - # search bot if set). Otherwise fall back to the main channel/bot, which keeps the - # single-channel networks that index both formats working unchanged. + # A few networks index audiobooks in a separate channel from ebooks (Undernet's + # #bookz, say). When an audiobook channel is configured and an audiobook was + # requested, route the search there (with its own search bot if set). Otherwise + # fall back to the main channel/bot — that is the common case, since most networks + # (irchighway included) serve both formats from the one channel. if is_audiobook(content_type): audiobook_channel = _config_text("IRC_AUDIOBOOK_CHANNEL") if audiobook_channel: diff --git a/shelfmark/release_sources/newznab/source.py b/shelfmark/release_sources/newznab/source.py index 2e2da599..8f258545 100644 --- a/shelfmark/release_sources/newznab/source.py +++ b/shelfmark/release_sources/newznab/source.py @@ -111,11 +111,12 @@ def _resolve_content_type( ranges, so trust the searched content type when the result carries a category we explicitly asked for. """ - detected = _detect_content_type_from_categories(categories, content_type) + category_list = list(categories) if isinstance(categories, (list, tuple)) else [] + detected = _detect_content_type_from_categories(category_list, content_type) if ( detected == "other" and searched_categories - and _result_category_ids(categories) & set(searched_categories) + and _result_category_ids(category_list) & set(searched_categories) ): return "audiobook" if content_type == "audiobook" else "book" return detected