Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Feb 2014
    Posts
    8

    MusicCLient.SearchAsync problem

    Hi,
    I am almost finishing my app, and while clicking through pages, I noticed that there was a problem - I chose different genres, however it always was the same song. To get songs, i use SearchAsync like that:
    Code:
     var products = await Client.SearchAsync(category: Category.Track, genreId: genre.Id, startIndex: index, itemsPerPage: itemsPrePage);
    I thought that the problem was with genre.id - however i debugged it and it is always different. Maybe i am doing the Search wrongly?

    I would greatly appreciate any help on this problem

    Best regards,
    Roman

  2. #2
    Nokia Developer Expert
    Join Date
    Feb 2014
    Posts
    29

    Re: MusicCLient.SearchAsync problem

    Hi Roman,
    you're going to have to give me some more information for me to be able to help:
    1) What values are you passing as genre.If and itemsPerPage?
    2) What are you expecting to happen?
    Regards,
    Steve

  3. #3
    Registered User
    Join Date
    Feb 2014
    Posts
    8

    Re: MusicCLient.SearchAsync problem

    Well, on my GenrePickPage I have a list of genres that I get from calling the API:
    Code:
    this.Genres = await MusicHelper.GetGenres();
    So on the second page i want to get a list of 20 songs for the chosen genre. I store the selected genre object in my ViewModel, so the genre.Id is from there, itemsPerPage = 20 as I want a list of 20 songs.(BTW, can I set itemsPerPage = 60 or is too many?), and index is a random number below 10 000( I want to get different songs every time the user runs the app, as my app is sth like NameThatTune app). Btw, initially startIndex was 0 and still songs were the same for different genres.
    My goal is to create a list of 20 songs of the specific genre, and than to play them one by one.
    Could you also tell me what's the purpose of requestId parameter of Client.SearchAsync()?

    Thank You very much for Your repsonse

    Best regards,
    Roman

  4. #4
    Nokia Developer Expert
    Join Date
    Feb 2014
    Posts
    29

    Re: MusicCLient.SearchAsync problem

    Please let me know the actual values you have for "genre.Id".
    I have checked in our sample app showing drilldown for genres and our underlying REST API and they are working for this use case.
    Regards,
    Steve

  5. #5
    Registered User
    Join Date
    Feb 2014
    Posts
    8

    Re: MusicCLient.SearchAsync problem

    I am soooo sorry, I made a very stupid mistake - I was getting the results, but then when i was navigating back i wasn't clearing the ObservableCollection, so when I chose a new genre, those 20 songs were added to the end of the collection and I was always playing the first item.

    Thank You very much for Your help and sorry for flooding this forum with such stupid topics

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×