Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2010 GetMovieReleases from The Movie Database API/WatTMDb Library

$
0
0
I am trying to figure out how to declare the following that its asking for:


Not sure what type of list its looking for me to define for my mpaa??

The definition for **GetMovieReleases** is this:


The way the data is called back is this
Code:

    {
      "countries": [{
          "certification": "PG",
          "iso_3166_1": "US",
          "release_date": "1977-05-25"
      },
      {
          "certification": "U",
          "iso_3166_1": "GB",
          "release_date": "1977-12-27"
      },
      {
    etc etc...

And it looks like the raw code for the call is:
Code:

    Public Sub GetMovieReleases(MovieID As Integer, UserState As Object, callback As Action(Of TmdbAsyncResult(Of TmdbMovieReleases)))
            'ProcessAsyncRequest<TmdbMovieReleases>(BuildGetMovieReleasesRequest(MovieID, UserState), callback);
            ProcessAsyncRequest(Of TmdbMovieReleases)(Generator.GetMovieReleases(MovieID, UserState), callback)
    End Sub

Code:

    Private Sub ProcessAsyncRequest(Of T As New)(request As RestRequest, callback As Action(Of TmdbAsyncResult(Of T)))
            Dim client = New RestClient(BASE_URL)
            client.[AddHandler]("application/json", New WatJsonDeserializer())
            If Timeout.HasValue Then
                    client.Timeout = Timeout.Value
            End If

            AsyncCount += 1
            Dim asyncHandle = client.ExecuteAsync(Of T)(request, Function(resp)
            AsyncCount -= 1
            Dim result = New TmdbAsyncResult(Of T)() With { _
                    Key .Data = If(resp.Data IsNot Nothing, resp.Data, Nothing), _
                    Key .UserState = request.UserState _
            }
   
            ResponseContent = resp.Content
            ResponseHeaders = resp.Headers.ToDictionary(Function(k) k.Name, Function(v) v.Value)
   
            If resp.ResponseStatus <> ResponseStatus.Completed Then
                    If resp.Content.Contains("status_message") Then
                            result.[Error] = Deserializer.Deserialize(Of TmdbError)(resp)
                    ElseIf resp.ErrorException IsNot Nothing Then
                            Throw resp.ErrorException
                    Else
                            result.[Error] = New TmdbError() With { _
                                    Key .status_message = resp.Content _
                            }
                    End If
            End If
   
            [Error] = result.[Error]
   
            callback(result)
   
    End Function)
    End Sub

The dll of the program and source can be found http://wattmdb.codeplex.com/SourceCo...w/23597#303861

Any help would be great! :)

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>