View Single Post
Old 24th August 2015, 23:22   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
as things currently stand you cannot assume that the id will persist (though it generally does) and is why there's that note in the documentation. especially as there's no guarantee that what you're trying to access (irrespective of the id aspect) is even broadcasting at the time as that is generally in the hands of the broadcasters.

this is primarily due to the 1.x DNAS and them not having a fixed way of look-up in the system which can cause the id to change over time (which 2.x DNAS do not have that basic issue) or due to stations not maintaining the same format and bitrate of the stream (happens a lot with 1.x and shared DJ setups) which leads to a different id being generated (as at that point, it's a different thing).

though in reality, you can generally cache things for a while (*) by id but also track the name, bitrate and format and use that as a means to try to find it again if the request using the id doesn't provide a valid tunein response.

(*) which should be done anyway as things don't change that much in the data responses over a few minutes.
DrO is offline   Reply With Quote