ShelbyTV / shelby-gt-web

the new shelby web front end for rolls <over />
shelby.tv
3 stars 0 forks source link

Issues with showing video recommendations. #874

Open hsztul opened 11 years ago

hsztul commented 11 years ago

Hey @iceberg901:

Issue at hand: 1) Load localhost.shelby.tv:3000 and you will see the app load with your stream containing DBEs in the correct order (time ordered) and there should be "recommended videos" dispersed in your stream (also in the correct order). One or two recommended videos should be showing right after the video they "come from." Logging in the console will tell you that the frame being looked at with a rec. is (or is not a dbe) and will tell you the length of the displayCollection that is being used to place the rec. in the stream ( i have 77 items in the collection). It will also tell you where the rec is being placed in the collection (it says "matched at: ")

2) Click on "community" (wait for it to load), then click back to "Stream"

3) The videos that load in the stream now are: a) in a different order b) the length of that display collection is now 108 rather than 77 and the recommended videos are being matched at different locations in the collection.

one thing i can think of is that there are duplicates recs being added to the collection possibly which i'm looking into but that doesn't explain the ordering issue. this is the main area that i could use those @iceberg901 eyes in!

Let me know in the am if I can clarify anything in here! Happy to get on another call (easier for you with the code in front of you :)

I guess best place to start in here is this commit: https://github.com/ShelbyTV/shelby-gt-web/commit/bd9d435649d987c32fa955fef79d30eca27b646a

hsztul commented 11 years ago

I forgot to mention that when you come back to "stream" from "community" the recs are actually in the right order, its all the other frame that are not (although there are some extras tagged to the bottom).

Also, we had talked about using something called _associatedDisplayCollection, but i think we need to also set new frames in the MasterCollection of the frame group paging list view.

Not going to lie, this is a little tangled up at this point!

iceberg901 commented 11 years ago

Making some progress here but still a little tangled. I changed the code around a bit to something that I'm more happy with, but the things still come back out of order when you return to stream from community. I've managed to determine that when the new list view gets created, it gets its display collection reset with all the models that were sitting around from last time, and the models are in the right order at that point, but nothing seems to render. Then later they show up in the wrong order. Will keep digging tomorrow.

iceberg901 commented 11 years ago

There's still a lot of cleanup to do here and many edge cases to check but:

Your ordering problems are solved. Try it out.

iceberg901 commented 11 years ago

There were a lot of small issues, but the biggest ones were:

  1. What we wanted was to insert the new recommendation as a dbe the same way any other dbe would get inserted and then just let the list view take care of the rest. We weren't doing that. Inserting it in the master collection directly wasn't the right thing (because it wouldn't trigger the correct event handlers), and neither was simply reinserting it in the display collection. We needed to insert it as if it had arrived from the bound collection (the DashboardModel's dashboard_entries collection), which then in turn inserts it in the master collection and the display collection because of list view event handling.
  2. Even once I inserted it in the right fashion, we were using the { at: n } option to insert it at a specific location in the collections right after the frame that the recommendation was based on. All of the list view stuff handled that fine, but the frame groups collection (because it was developed in a short sighted manner and without proper regard to our existing framework, as previously noted) ignored that {at:n} option and just inserted it at the end. So I fixed that too, but had to do so in a very circular way because of the nature of the frame groups collection.