stremio-core icon indicating copy to clipboard operation
stremio-core copied to clipboard

Fix LibraryItemState snake_case and camelCase inconsistency

Open elpiel opened this issue 2 years ago • 5 comments

We have 2 different ways of representing video_id - snake_case and camelCase, this should be fixed and aligned with core

In core we now use video_id (snake_case) although all other fields are camelCase.

  • core-web - videoId in CW LibraryItemState - https://github.com/Stremio/stremio-core-web/blob/936ab4116a5d071dc604a57b26e0a90a3e63a939/src/model/serialize_continue_watching_preview.rs#L106-L110

  • core-web - video_id in Player LibraryItemState - https://github.com/Stremio/stremio-core-web/blob/af66b2eb6bd1aae35e18cdf66e70879100ee7fd5/src/model/serialize_player.rs#L67-L73

  • [ ] Fix LibraryItemState (core) snake_case field

  • [ ] Fix the 2 LibraryItemState in core-web

elpiel avatar Jun 16 '23 08:06 elpiel

Is not clear, both links references to the same file and line

josuejs23 avatar Oct 08 '23 00:10 josuejs23

You are correct, I just fixed the link.

Core LibraryItemState might not be fixable because this will trigger bad deserialization in apps like stremio-web which store locally a serialised version of the Libarary in one form or another

elpiel avatar Oct 08 '23 14:10 elpiel

ok, so a ticket must be created in that repo. Which other app might be impacted due to this change?

josuejs23 avatar Oct 08 '23 16:10 josuejs23

We need to double check if this field is used in the API, if it is we cannot change it but we could add an alias. All applications will be affected due to the fact that LibraryItems are stored in Local storage depending on the app, e.g. web uses Local storage.

elpiel avatar Nov 02 '23 10:11 elpiel

@elpiel this propery is used in the go server and must be named like that, As a last resort we could use 2 separate serializators, one for the API, and one for the JS layer

unclekingpin avatar Nov 02 '23 11:11 unclekingpin