Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stremio-core-web/src/model/serialize_player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

origin: &addon.manifest.name,
})
})
Expand Down