Userrating

Developer
Nov 15, 2009 at 10:32 PM

Hi,

First I would like to say THANK YOU for building this wrapper, this has made my life WAY easier and has sped up a lot of my code for accessing the netflix info.

I have a question about the .userrating propertty. I have tried it with dim myrating as integer=user.InstantQueue.item(i).userrating and it always returns 0. I thought maybe I was doing something wrong, so I tried dim catsearch as catalogtitlecollection = user.connection.catalog.titlesearch(user.InstantQueue.item(i).title, 10) and then went through each of these looking at the catsearch.item(i).userrating and it also always returns 0.

So my question is 1) am i calling it correctly? Is it returning something other than an integer? the .averagerating property is working just fine, so I assume this is a code issue. 2) If this is broken, how would I retreive the userrating other than the examples i have above?

Thanks,

DH

Developer
Nov 16, 2009 at 3:12 AM

Sorry, me again. I figured out a way to do it, but the .userrating property would be much easier. The below method requires a separate call, but it does work.

Dim titleRefs As System.Collections.Generic.List(Of String) = New System.Collections.Generic.List(Of String)
Dim MyInstantQueue As Queue = user.InstantQueue
dim MyUserrate AS INTEGER
        For i = 0 To MyInstantQueue.Count - 1
            titleRefs.Add(MyInstantQueue.Item(i).TitleRef)
	    Dim myratings As RatingCollection = user.GetRatings(titleRefs)
            MyUserrate=myratings.Item(0).UserRating
        Next


 

 

Coordinator
Nov 16, 2009 at 3:44 AM
I haven't had a chance to look at it, so I'm not sure off-hand what's
wrong. Worst case scenario, we just detect the 0 and automatically
make that second call. I don't like doing it, but we have to work with
what we got.

Jonathan

On Sun, Nov 15, 2009 at 8:12 PM, [email removed] wrote:
> From: dhgb256
>
> Sorry, me again. I figured out a way to do it, but the .userrating property
> would be much easier. The below method requires a separate call, but it does
> work.
>
> Dim titleRefs As System.Collections.Generic.List(Of String) = New
> System.Collections.Generic.List(Of String)
> Dim MyInstantQueue As Queue = user.InstantQueue
> dim MyUserrate AS INTEGER
> For i = 0 To MyInstantQueue.Count - 1
> titleRefs.Add(MyInstantQueue.Item(i).TitleRef)
> Dim myratings As RatingCollection = user.GetRatings(titleRefs)
> MyUserrate=myratings.Item(0).UserRating
> Next
>
>
>
>
>
>
> Read the full discussion online.
>
> To add a post to this discussion, reply to this email
> ([email removed])
>
> To start a new discussion for this project, email
> [email removed]
>
> You are receiving this email because you subscribed to this discussion on
> CodePlex. You can unsubscribe or change your settings on codePlex.com.
>
> Please note: Images and attachments will be removed from emails. Any posts
> to this discussion will also be available online at codeplex.com
Developer
Nov 16, 2009 at 6:39 PM
Edited Nov 16, 2009 at 6:56 PM

Thanks for looking into it. I looked at the code and I compared it to the .averagerating call and nothing glaring stuck out at me. The only difference is that .userrating isn't readonly and has a get and set call instead of just a get. Not sure if that makes a difference. It is looking for the <user_rating> tag in the xml document, so I would think it should work properly.

But since I brought up the subject of calls, I had a question. If I set a variable like Dim MyInstantQueue As Queue = user.InstantQueue and then go through and make the calls:

For i = 0 To MyInstantQueue.Count - 1
            MyTitleRef= MyInstantQueue.Item(i).TitleRef
            MyTitle=MyInstantQueue.Item(i).Title
Next

Let's say I have 20 items in my instant queue, did I just make 40 queries against my 5,000 total, or is this one query, or is it 20?

Coordinator
Nov 16, 2009 at 11:05 PM
Do you have the source code? If not, I suggest downloading it and
stepping through the code yourself. I haven't even looked at that
library in nearly a year and with my current work schedule I don't
think I will have the time to give it the love and attention it needs.

Off hand, I think it would only make 1 call. For you to even know you
have 20 items in your queue it must have downloaded them all in a
single XML request. So in theory you are just iterating through what's
already in memory.

Jonathan

On Mon, Nov 16, 2009 at 11:39 AM, dhgb256 <notifications@codeplex.com> wrote:
> From: dhgb256
>
> Thanks for looking into it. I looked at the code and I compared it to the
> .averagerating call and nothing glaring stuck out at me. The only difference
> is that .userrating isn't readonly and has a get and set call instead of
> just a get. Not sure if that makes a difference. It is looking for the
> <user_rating> tag in the xml document, so I would think it should work
> properly.
>
> But since I brought up the subject of calls, I had a question. If I set a
> variable like Dim MyInstantQueue As Queue = user.InstantQueue and then go
> through and make the calls:
>
> For i = 0 To MyInstantQueue.Count - 1
>             MyTitleRef= MyInstantQueue.Item(i).TitleRef
>             MyTitle=MyInstantQueue.Item(i).Title
> Next
>
> Let's say I have 20 items in my instant queue, did I just make 40 calls
> against my total, or is this one call, or is it 20?
>
> Read the full discussion online.
>
> To add a post to this discussion, reply to this email
> ([email removed])
>
> To start a new discussion for this project, email
> [email removed]
>
> You are receiving this email because you subscribed to this discussion on
> CodePlex. You can unsubscribe or change your settings on codePlex.com.
>
> Please note: Images and attachments will be removed from emails. Any posts
> to this discussion will also be available online at codeplex.com
Coordinator
Nov 16, 2009 at 11:06 PM
P.S. I have granted you edit rights on the source code. Feel free to
make changes in the DEV branch as you see fit.

Jonathan

On Mon, Nov 16, 2009 at 4:05 PM, Jonathan Allen <grauenwolf@gmail.com> wrote:
> Do you have the source code? If not, I suggest downloading it and
> stepping through the code yourself. I haven't even looked at that
> library in nearly a year and with my current work schedule I don't
> think I will have the time to give it the love and attention it needs.
>
> Off hand, I think it would only make 1 call. For you to even know you
> have 20 items in your queue it must have downloaded them all in a
> single XML request. So in theory you are just iterating through what's
> already in memory.
>
> Jonathan
>
> On Mon, Nov 16, 2009 at 11:39 AM, dhgb256 <notifications@codeplex.com> wrote:
>> From: dhgb256
>>
>> Thanks for looking into it. I looked at the code and I compared it to the
>> .averagerating call and nothing glaring stuck out at me. The only difference
>> is that .userrating isn't readonly and has a get and set call instead of
>> just a get. Not sure if that makes a difference. It is looking for the
>> <user_rating> tag in the xml document, so I would think it should work
>> properly.
>>
>> But since I brought up the subject of calls, I had a question. If I set a
>> variable like Dim MyInstantQueue As Queue = user.InstantQueue and then go
>> through and make the calls:
>>
>> For i = 0 To MyInstantQueue.Count - 1
>>             MyTitleRef= MyInstantQueue.Item(i).TitleRef
>>             MyTitle=MyInstantQueue.Item(i).Title
>> Next
>>
>> Let's say I have 20 items in my instant queue, did I just make 40 calls
>> against my total, or is this one call, or is it 20?
>>
>> Read the full discussion online.
>>
>> To add a post to this discussion, reply to this email
>> ([email removed])
>>
>> To start a new discussion for this project, email
>> [email removed]
>>
>> You are receiving this email because you subscribed to this discussion on
>> CodePlex. You can unsubscribe or change your settings on codePlex.com.
>>
>> Please note: Images and attachments will be removed from emails. Any posts
>> to this discussion will also be available online at codeplex.com
>