AutoWeb Spotify Web API list all tracks

Discussion in 'AutoApps' started by Rich Wallace, Feb 9, 2017.

  1. Rich Wallace

    Rich Wallace Member

    Joined:
    Apr 10, 2015
    Messages:
    42
    Likes Received:
    1
    Is it possible to list all tracks in my own library?
    What im trying to achieve is creating a task to automatically create / update a playlist with tracks that I have downloaded.
    Possible?
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Yes, there's a "Get Library Tracks" action :) Check it out.
     
  3. Rich Wallace

    Rich Wallace Member

    Joined:
    Apr 10, 2015
    Messages:
    42
    Likes Received:
    1
    Yeah I see this but it's limited?
    And is it possible to see if a trackk has been downloaded?

    Sent from my SM-G920F using Tapatalk
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    How's it limited? And I don't think you can check if a track has been downloaded, no...
     
  5. Rich Wallace

    Rich Wallace Member

    Joined:
    Apr 10, 2015
    Messages:
    42
    Likes Received:
    1
    Ahh ok.
    Well when I run get tracks, it returns 20, obviously I have hundreds of tracks in my library. I can change get the limit to 50 max. Anything higher and it returns an error

    Sent from my SM-G920F using Tapatalk
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Oh, I see. Yeah, the problem is that it only supports 50 tracks at a time. You have to use pagination to get more tracks. Did you add that "limit" parameter to the API yourself?
     
  7. Rich Wallace

    Rich Wallace Member

    Joined:
    Apr 10, 2015
    Messages:
    42
    Likes Received:
    1
    Ah ok. I didn't add the limit no.
    How do I use pagination?
    Thanks

    Sent from my SM-G920F using Tapatalk
     
  8. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Ok, you have to change the "offset" input so that it starts the listing in a later entry.
    So for example:
    1. Set offset to 0 and limit to 50 to get the first 50 tracks
    2. Set offset to 50 and limit to 50 to get the next 50 tracks
    3. etc
    Hope this helps!
     
  9. Rich Wallace

    Rich Wallace Member

    Joined:
    Apr 10, 2015
    Messages:
    42
    Likes Received:
    1
    Ah ok, so I'd have to repeat the action so many times until the variable array isn't set?

    Sent from my SM-G920F using Tapatalk
     
  10. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    until the array has less than 50 items, is my guess :) Don't forget to clear the array before each get though, or else you'd keep the old values if new ones didn't exist.
     
    Rich Wallace likes this.
  11. Rich Wallace

    Rich Wallace Member

    Joined:
    Apr 10, 2015
    Messages:
    42
    Likes Received:
    1
    I'll give it a shot!
    Thanks!

    Sent from my SM-G920F using Tapatalk
     
: spotify, autoweb

Share This Page