Skip to content

fix: recognize custom subtitle addons like Wizdom and Ktuvit (#80) - #127

Merged
ProdigyV21 merged 1 commit into
mainfrom
fix/custom-subtitle-addons
Apr 5, 2026
Merged

fix: recognize custom subtitle addons like Wizdom and Ktuvit (#80)#127
ProdigyV21 merged 1 commit into
mainfrom
fix/custom-subtitle-addons

Conversation

@ProdigyV21

Copy link
Copy Markdown
Owner

Summary

Closes #80.

User-added Stremio subtitle addons like Wizdom and Ktuvit (the primary Hebrew subtitle providers for Israeli users) were installed successfully but were functionally inert — they showed up in Settings → Addons, could be enabled/disabled, but were never queried during playback. No Hebrew subtitles ever appeared in the player.

Root cause

Two sequential bugs:

  1. StreamRepository.addCustomAddon at line 259 hardcoded type = AddonType.CUSTOM for every user-added addon, regardless of what resources the manifest declared. So a pure-subtitle addon (manifest resources: ["subtitles"]) ended up in the same bucket as a pure-stream addon (manifest resources: ["stream"]).

  2. fetchSubtitlesForSelectedStream at line 1339 filtered strictly on type == AddonType.SUBTITLE, which only matched the built-in OpenSubtitles addon. Pure-subtitle addons stored as CUSTOM were never queried for subtitles.

The result: the addon was installed, the toggle worked, the stream resolver correctly ignored it (because getStreamAddons requires a stream resource in the manifest), but no code path ever actually fetched subtitles from it.

Fix

1. Classify addons by manifest resources at install time

addCustomAddon now inspects the parsed manifest's resources:

val resourceNames = addonManifest.resources.map { it.name }.toSet()
val hasSubtitles = "subtitles" in resourceNames
val hasStream = "stream" in resourceNames
val addonType = when {
    hasSubtitles && !hasStream -> AddonType.SUBTITLE
    else -> AddonType.CUSTOM
}
  • Pure subtitle addon (Wizdom, Ktuvit) → SUBTITLE → picked up by the subtitle fetcher, ignored by the stream fetcher.
  • Pure stream addonCUSTOM with stream resource → picked up by the stream fetcher only (unchanged behavior).
  • Hybrid addon (declares both stream and subtitles) → CUSTOM → picked up by the stream fetcher AND by the subtitle fetcher's new branch (see below).

2. Broaden the subtitle fetcher to include CUSTOM addons that declare subtitles

fetchSubtitlesForSelectedStream now also queries CUSTOM addons whose manifest has a subtitles resource:

val subtitleAddons = allAddons.filter { addon ->
    if (!addon.isInstalled || !addon.isEnabled) return@filter false
    if (addon.type == AddonType.SUBTITLE) return@filter true
    if (addon.type == AddonType.CUSTOM) {
        val declaresSubtitles = addon.manifest?.resources?.any { res ->
            res.name.equals("subtitles", ignoreCase = true)
        } == true
        return@filter declaresSubtitles
    }
    false
}

This covers two cases the type-classification fix alone doesn't:

  • Users who installed Wizdom/Ktuvit before this fix landed — their DataStore still has the addon classified as CUSTOM. They benefit from change (2) immediately without needing to reinstall.
  • Hybrid addons that legitimately provide both streams and subtitles — they should be queried for both resources.

Why the stream side is already correct

getStreamAddons at line 625 already skips AddonType.SUBTITLE, and at line 632-641 requires CUSTOM addons to declare a stream resource in the manifest. So newly-classified SUBTITLE addons are correctly excluded from stream fetches and won't pollute the stream picker with "no streams available" entries.

Test matrix

Scenario Classification Stream fetch Subtitle fetch
OpenSubtitles (builtin) SUBTITLE skip ✓ query ✓
Wizdom/Ktuvit (fresh install) SUBTITLE (new) skip ✓ query ✓ (new)
Wizdom/Ktuvit (installed before fix) CUSTOM (unchanged) skip (no stream resource) ✓ query ✓ (new branch)
Torrentio / Cinemeta (stream addon) CUSTOM query ✓ skip ✓
Hybrid addon (stream + subtitles) CUSTOM query ✓ query ✓ (new branch)

Risk

Low. Single file, 40-line change. The stream-side filter logic is untouched. The subtitle-side filter is a strict superset of the previous filter — no previously-queried addon will stop being queried. All new behavior is additive.

One very small edge case worth noting: the subtitle URL construction (buildSubtitlesUrl) has been working for OpenSubtitles for months and follows the standard Stremio protocol (/subtitles/{type}/{id}.json). Wizdom and Ktuvit follow the same protocol, so it should work out of the box, but if a specific provider turns out to need an unusual query format we can iterate in a follow-up PR.

User-added Stremio addons that declared only the `subtitles` resource in
their manifest (Wizdom, Ktuvit, and other regional subtitle providers)
were installed successfully but were functionally inert. The root cause
was two-fold:

1. `StreamRepository.addCustomAddon` hardcoded `type = AddonType.CUSTOM`
   for every user-added addon regardless of what resources its manifest
   declared. So a pure-subtitle addon ended up in the same bucket as a
   stream addon.

2. `fetchSubtitlesForSelectedStream` then filtered strictly on
   `type == AddonType.SUBTITLE`, which only matched the built-in
   OpenSubtitles addon. Pure-subtitle addons stored as CUSTOM were never
   queried for subtitles.

The result was that Israeli users who added Wizdom or Ktuvit saw them
listed and enabled in Settings \u2192 Addons but never saw any Hebrew
subtitles appear during playback \u2014 effectively making ARVIO unusable
for them as reported in issue #80.

Changes:
- `addCustomAddon` now inspects the parsed manifest's resources. If the
  addon declares `subtitles` but not `stream`, it gets
  `AddonType.SUBTITLE`; otherwise it stays CUSTOM (preserving the
  existing behavior for stream addons and hybrid addons).
- `fetchSubtitlesForSelectedStream` now also includes CUSTOM-typed addons
  whose manifest declares a `subtitles` resource. This covers two cases:
  (a) addons installed before this fix that are still classified as
  CUSTOM in DataStore; (b) hybrid addons that legitimately provide both
  streams and subtitles and should be queried for both.
- The stream-side filter in `getStreamAddons` already requires CUSTOM
  addons to declare `stream` resource, so newly-classified SUBTITLE
  addons are correctly excluded from stream fetches and don't pollute
  the stream picker.

Existing users with Wizdom/Ktuvit already installed will benefit
immediately from change (2) without needing to reinstall. New
installations will benefit from both changes.

Closes #80
@ProdigyV21
ProdigyV21 merged commit 62969ee into main Apr 5, 2026
2 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.

[Bug] External subtitle addons not recognized (Wizdom, Ktuvit) - Israeli Stremio subtitle providers

1 participant