-
Notifications
You must be signed in to change notification settings - Fork 59
feat(project): add new type of lists (recommendations) #556
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
Conversation
Visit the preview URL for this PR (updated for commit ddeeb74): https://ottwebapp--pr556-feat-add-content-lis-xm1980a1.web.app (expires Wed, 24 Jul 2024 07:42:20 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c198f8a3a199ba8747819f7f1e45cf602b777529 |
36c8ea9
to
03b0af8
Compare
App Config for testing: |
packages/ui-react/src/pages/ScreenRouting/RecommendationsScreenRouter.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR overall looks good, but I do have some questions:
Do you have content list IDs to test with?You just added it 😄- Do we need to add e2e testing for this?
- Do we really need an abstraction for the content and playlist APIs or could it just be two separate services?
- This could prevent some breaking changes in the
usePlaylist
hook for example
- This could prevent some breaking changes in the
- Should we use different names for the service/controller/types?
- Content list can be confused with contentTypes
RecommendationsService
sounds like it's used for different purposes- I suggest renaming it to
PlaylistController
,PlaylistService
,PlaylistContentService
andPLAYLIST_TYPE
removing the content analogy from most most places
We do need. I will add it to the Q3 plan.
Do you mean having two hooks "usePlaylist" and "usePlaylistContent" which could be called conditionally + removing the controller completely? We still need to know the type to make a decision, so there will be also a "parent" hook receiving it as an argument.
I agree naming is a problem. My idea was to consume playlists, content lists (recommendations), series using controller in the future. That is why I used "ContentController" name. We also have some plans to deliever an additional "media" endpoint returning data based on the content type (maybe series, stream data inside). Though it can be also overengineering to consider this case in advance and to avoid braking changes we could start with conditional calls. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still going through some parts, but I think we can keep this change simpler without adding the content service abstractions. If we add the new content list endpoint to the existing Api Service, we can do switching at the hook or controller level to get playlists or content lists as needed.
da89a6e
to
8dc9523
Compare
8dc9523
to
f75a8f4
Compare
033b2c8
to
39c9f98
Compare
@ChristiaanScheermeijer @dbudzins simplified approach without abstraction layer. |
packages/ui-react/src/pages/ScreenRouting/sharedScreens/PlaylistGrid/PlaylistGrid.tsx
Outdated
Show resolved
Hide resolved
packages/ui-react/src/pages/ScreenRouting/PlaylistScreenRouter.tsx
Outdated
Show resolved
Hide resolved
packages/ui-react/src/pages/ScreenRouting/PlaylistScreenRouter.tsx
Outdated
Show resolved
Hide resolved
353e007
to
289fb21
Compare
289fb21
to
1f52905
Compare
@ChristiaanScheermeijer @dbudzins
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect @AntonLantukh! This looks good to me.
Only the playlistURL
method has changed, but that's only used once in our platforms 😄
@ChristiaanScheermeijer rolled back |
const queryClient = useQueryClient(); | ||
const siteId = useConfigStore((state) => state.config.siteId); | ||
|
||
const queryOptions = getPlaylistQueryOptions({ type, contentId, siteId, params, queryClient, enabled, usePlaceholderData }); | ||
|
||
return useQuery<Playlist | undefined, ApiError>(queryOptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've gotta add usePlacehoderData and params inputs to usePlaylists, but then you avoid the getQueryOptions construct, which is a bit non-standard I think.
(We can do this later. I know you want to get the changes out, and the double playlist hooks wasn't added from this PR)
const queryClient = useQueryClient(); | |
const siteId = useConfigStore((state) => state.config.siteId); | |
const queryOptions = getPlaylistQueryOptions({ type, contentId, siteId, params, queryClient, enabled, usePlaceholderData }); | |
return useQuery<Playlist | undefined, ApiError>(queryOptions); | |
return usePlaylists([{contentId, type}], enabled ? 1 : 0, usePlaceholderData, params)[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to do it because of the different use case we have here. usePlaylists is intended to work with a list of shelves on the Landing Page. So it also covers the cases of Favorites and Continue Watching, while usePlaylist only supports content_list
and playlist
types which makes the purpose a bit different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 small comments. The one about the Routes and PlaylistScreenRouter component, I'd strongly suggest doing, but I'll approve as-is, because I know you're pressed for time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Description
Steps completed:
According to our definition of done, I have completed the following steps: