I'm having a problem with CocoaLibSpotify when trying to save my playlists for offline use.
So I install my app, log in for the first time, select a playlist and set it for offline use, immediately its offlineStatus changes to SP_PLAYLIST_OFFLINE_STATUS_DOWNLOADING, all the tracks in the playlist have their offlineStatus changed to SP_TRACK_OFFLINE_WAITING, they start downloading one at a time and eventually their offlineStatus changes to SP_TRACK_OFFLINE_DONE. I turn off my wifi and I can play the downloaded tracks offline.
When I close the app and log in again, the tracks that were previously available offline now have their offlineStatus changed to SP_TRACK_OFFLINE_WAITING and can no longer be played offline. CocoaLibSpotify stores the downloaded playlists in the NSCachesDirectory, if I check that folder I see that the content hasn't changed and the track data is still there.
Another strange thing, I assume that, even in online mode, CocoaLibSpotify will play the downloaded track from the device if it's available offline. If I turn on wifi and I start playing on of these previously downloaded SP_TRACK_OFFLINE_WAITING tracks, then quickly turn off wifi, it still continues to play the entire track.
So from the looks of it, I'm assuming the tracks still remain offline but for some reason their offlineStatus gets the wrong status when logging in. And that the session refuses to start playing the track because of its offlineStatus.
But how can I avoid the tracks having their offlineStatus reset or at the very least, correct the problem when I know the track has been downloaded. I've tried setting the offlineStatus to SP_TRACK_OFFLINE_DONE manually but that didn't work. I'm hoping someone can shed some light on this.
Thanks in advance.