Skip to content

Conversation

ivelinmegdanov
Copy link
Contributor

@ivelinmegdanov ivelinmegdanov commented Apr 15, 2025

.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