{"comment":{"url":"https://api.github.com/repos/mcrute/pydora/comments/11948053","html_url":"https://github.com/mcrute/pydora/commit/525b035810267d4085c274f18b774785c94e54cc#commitcomment-11948053","id":11948053,"user":{"login":"jcass77","id":10268911,"avatar_url":"https://avatars.githubusercontent.com/u/10268911?v=3","gravatar_id":"","url":"https://api.github.com/users/jcass77","html_url":"https://github.com/jcass77","followers_url":"https://api.github.com/users/jcass77/followers","following_url":"https://api.github.com/users/jcass77/following{/other_user}","gists_url":"https://api.github.com/users/jcass77/gists{/gist_id}","starred_url":"https://api.github.com/users/jcass77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcass77/subscriptions","organizations_url":"https://api.github.com/users/jcass77/orgs","repos_url":"https://api.github.com/users/jcass77/repos","events_url":"https://api.github.com/users/jcass77/events{/privacy}","received_events_url":"https://api.github.com/users/jcass77/received_events","type":"User","site_admin":false},"position":7,"line":312,"path":"pandora/__init__.py","commit_id":"525b035810267d4085c274f18b774785c94e54cc","created_at":"2015-07-01T08:19:04Z","updated_at":"2015-07-01T08:19:04Z","body":"I think the fact that Pandora generates unique tokens for stations and playlist items is something that we can leverage to make lookups easier. The usecase can be something like this:\r\n\r\n1. consumer calls ```client.get_station_list()```, and potentially caches the result for use later on\r\n2. the user then selects a station to listen to, either using a numbered list (as is done here: https://github.com/mcrute/pydora/blob/5ab0a04eb9c4e51e33f11f3433a84f968f098f26/pydora/player.py#L60-62), or clicking on a link in a web interface (in which case the station token will probably be embedded in the URL as a way to identify the station uniquely)\r\n3. the way the API is written now, one needs to either (a) know the position of the station in the list or, (b) iterate through the list and compare tokens one by one or (c) request the station from the Pandora server using ```client.get_station(station_token)```.\r\n\r\nI agree that it is less relevant for the play list as the default behaviour is just to iterate through the list in the order that Pandora provides. I wonder however if there may not be a general expectation by consumers to be able to retrieve model items using their unique token identifiers whenever they form part of a collection."}}