brianhorakh / vita

vita source
0 stars 0 forks source link

Unable to check, user has liked(bumped) particular media or not in eventlist api. #18

Open inder243 opened 8 years ago

inder243 commented 8 years ago

We cannot judge that which user has like the media. We now get only total number of bumps in the API.

Please refer : EventlistApi

SeanGuerrero commented 8 years ago

I don't think that we need to note which users have liked the media. Total Number of bumps is good for now.

inder243 commented 8 years ago

It ok if you want us to show total number of bumps, but if you consider instagram or facebook Like functionalities, What these big SOCIAL GUNS do is that they make user either like or unlike a particular media thereby increasing/decreasing the like count.

Moreover, now we are able to like a particular media at our end but unable to fetch whether particular user has liked or not liked that media. We must have a parameter that indicates a particular user has liked particular media.

SeanGuerrero commented 8 years ago

It is supposed to function like instagram where it counts likes(high fives) and increases or decreases the like count.

brianhorakh commented 8 years ago

I have added a 'bumpedBy' in the EventList 'thumbs' array. The 'bumpedby' response parameter contains an array of uid's to the EventList api call. Please confirm this will resolve this issue.

inder243 commented 8 years ago

Thank you for adding bumpedBy in the API. I would recommend that if you can provide UIDs for each bumped made.

thumbs = ( { bumps = 0; created = "2016-06-05 22:43:08"; evid = "274208AC-2BAB-11E6-9ECF-88D178BD133F"; "media_url" = "http://www.vitatheapp.com/files/2016-06-06/05/274208AC-2BAB-11E6-9ECF-88D178BD133F.503.mp4"; mediaid = 503; "thumb_url" = "http://www.vitatheapp.com/files/2016-06-06/05/274208AC-2BAB-11E6-9ECF-88D178BD133F-thumb.503.jpg"; uid = 100; url = "http://www.vitatheapp.com/files/2016-06-06/05/274208AC-2BAB-11E6-9ECF-88D178BD133F.503.mp4"; } In Above You can add bumps as main array which has data corresponding to each media and all UID added. (We need to display all users ID who have bumped the particular media)

Example thumbs { bumpedby { UID:20,100,100 } }

SeanGuerrero commented 8 years ago

Brian, is this a recommendation for you to take a look at?

brianhorakh commented 8 years ago

Thanks Sean!!! (and inter243, please make sure to re-add me to issue if you respond -- I won't see the response otherwise.)

bumpedBy is already an array of uid's.

I am currently returning a 'Users' node in the EventList response. For every uid returned in 'bumpedBy' there will be a corresponding array-row in the the 'Users' section. The 'Users' section contains the uid, Username, ProfilePic.

If a single user bumps 10 pieces of media on an Event, then they will appear in 'bumpedBy' on each 10 media, and will have only ONE entry in the 'Users' section (trying to minimize the size of a response)

SeanGuerrero commented 8 years ago

Hey Brian, I am not quite following your comment about a user needing to bump 10 different pieces of media in order to appear on all ten as a way to note an accolade. Can you please clarify?

brianhorakh commented 8 years ago

Sorry, the "10" was just a number, it could be 2,3,4,5,6,7,8,9,etc. it's not an accolade, I'm just trying to avoid embedding the User data on each piece of media, it's a bandwidth optimization.

So no matter how many bumps a user has done, they'll only appear in the "Users" section of the API response once. I'm assuming it'll be fairly normal for a single user to bump most/all of the media in an Event.

So if an event has 10 pieces of media in the same event and then uid 12345 bumps all 10, then their uid (12345) will appear in the "bumpedBy":[ 12345 ] section of each media, and the user 12345 will have one entry with their Username, and ProfilePic in the "Users" response.

Expected API Response:

"Users":[ { "uid":12345, "Username":"LikesTOBumpStuff", "ProfilePicURL":"http://www.vitatheapp.com/path/to/image.jpg" } ]

Users is outside of the Events section of the response, so in theory if a single user bumps media across multiple events in the same EventList response (which I assume will be fairly common given the local nature of this app) then they will still only appear once in the "Users" section .. thereby saving bandwidth.

I had originally designed the system so that Vakul would need to retrieve the User data separately in another request, and that it would be cached on the phone. He's said that takes too long and that I need to return it in the EventList response. I still kinda think it's a mistake, but not worth debating at this point.

inder243 commented 8 years ago

We completely understand you and will require you to make a little adjustment. It will be great if you can provide us UID for particular media(not particular event). It will be form of array.

For Bumped by: We need UID For User who Post data: UID For Comments: UID

You can Append the userinfo In UserArray as a whole, that can provide us information and will be easier for you too.

SeanGuerrero commented 8 years ago

I just added Brian to this so that he can see your comments Vakul. Hopefully he can get you those UID's that you need soon.

brianhorakh commented 8 years ago

We do not/display return the list of users who bumped specific media -- that is not required (per Sean), only the total number of bumps.

If I execute this url: www.vitatheapp.com/vita-api/EventList you will see that Users array contains uid's for users who post or comment.