Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subtitle parsing issue in SoraStream provider #732

Open
stojkovskistefan opened this issue Jul 20, 2024 · 1 comment
Open

Subtitle parsing issue in SoraStream provider #732

stojkovskistefan opened this issue Jul 20, 2024 · 1 comment

Comments

@stojkovskistefan
Copy link

There's a critical issue with subtitle parsing in the SoraStream provider. The problem stems from a mismatch between the expected structure of the subtitle data and the actual structure provided by the API. This issue is causing subtitles to be incorrectly parsed or not parsed at all.

Current behavior:
The current code expects subtitle data in this format:

json.subtitlingList?.map { sub ->
    subtitleCallback.invoke(
        SubtitleFile(
            getVipLanguage(sub.languageAbbr ?: return@map),
            sub.subtitlingUrl ?: return@map
        )
    )
}

Actual API response:
The API is actually providing subtitle data in this format:

"subtitles": [
  {
    "url": "https://cc.2cdns.com/d6/20/d62068ec491a43de9fc34e18b5dcdcfb/eng-3.vtt",
    "lang": "English - English (SDH)"
  },
  ...
]

Expected behavior:
The code should correctly parse and use the subtitle information provided by the API.

Proposed fix:
Update the subtitle parsing code to match the actual API response. Here's a suggested modification:

json.subtitles?.forEach { sub ->
    subtitleCallback.invoke(
        SubtitleFile(
            sub.lang ?: "Unknown",
            sub.url ?: return@forEach
        )
    )
}

Here is a picture:
image

Steps to reproduce:

  1. Attempt to load subtitles for any media in the SoraStream provider
  2. Observe that subtitles are not correctly loaded or parsed

Potential impact:
This issue affects all users of the SoraStream provider, preventing them from accessing subtitles for their media.

Suggested priority: High

By addressing this issue, we can ensure that subtitles are correctly parsed and available to users of the SoraStream provider. This fix would also bring the SoraStream provider in line with the expected behavior described in the linked issue, contributing to a more consistent subtitle handling across the entire application.

@stojkovskistefan
Copy link
Author

@hexated
@jackjohn
@alex
@tuiodongme
@olivia
@IndusAryan
@Winterandroid
@pavankatari
@lisa
@adityajd
@tuan041
@OshekharO
@samantha
@irfannajmudinsidik
@ethangamerxp
@Luna712
@krishus96
@monica
@KillerDogeEmpire
@CuongBa956
@b4byhuey
@geekboysuraj
@Peigie
@galih27
@lirena00
@keyiflerolsun
@hazaku-rei
@phisher98
@Bnyro
@movieforme
@hatt3r
@szechnaya
@dontseehereStopMotion
@codecm
@SaurabhKaperwan
@g3n3ziz

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

No branches or pull requests

1 participant