Skip to content

feat(Subtitles): Changed id format #804

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

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

ivelinmegdanov
Copy link
Contributor

@ivelinmegdanov ivelinmegdanov commented Apr 15, 2025

@@ -206,7 +206,7 @@ pub fn serialize_player<E: stremio_core::runtime::Env + 'static>(
// renames the subtitle id to avoid conflicts
.map(move |(position, subtitles)| model::Subtitles {
subtitles,
id: format!("{}_{}", addon.transport_url, position),
id: format!("Sub {} ID: {}", position, subtitles.id.clone()),
Copy link
Member

Choose a reason for hiding this comment

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

What is the purpose of this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The purpose is to include the original subtitles.id (which gives us meaningful info like the actual source or filename explained in the issue) i dont know why it was changed to be the transport_url in the first place. But also we still keep the position to avoid potential conflicts when multiple subtitles share the same ID.

Copy link
Member

@tymmesyde tymmesyde Apr 16, 2025

Choose a reason for hiding this comment

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

The purpose of the id of a subtitles is just to provide a unique id and is used with stremio-video for track selection
Since it's up to the addons dev to set this id, we use the transport url to make sure that two addons don't use the same id
The id that is set by the addon could be anything like random numbers, it doesn't necessarily contains the filename

Here are the specs for the subtitles object:
https://github.com/Stremio/stremio-addon-sdk/blob/master/docs/api/responses/subtitles.md
I suggest that we had a field here like fileName so that we and the addon devs can pass the name of the file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants