Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getNext on pagingObject for PlaylistTracks failing #1

Closed
kinshukJ opened this issue Jul 10, 2017 · 5 comments
Closed

getNext on pagingObject for PlaylistTracks failing #1

kinshukJ opened this issue Jul 10, 2017 · 5 comments

Comments

@kinshukJ
Copy link

Thank you for creating such an awesome Spotify Client! There's a small issue with getNext being called on a pagingObject dealing with tracks fetched for a playlist. Spartan.getPlaylistTracks() works fine and loads 20 tracks. However after retrieving the pagingObject and calling getNext on it I get fatal error: unexpectedly found nil while unwrapping an Optional value 2017-07-09 19:55:16.220157-0500 Sink[12993:3968613] fatal error: unexpectedly found nil while unwrapping an Optional value. To confirm I called getNext right after fetching the pagingObject as follows ` let _ = Spartan.getPlaylistTracks(userId: userId, playlistId: playlistId, success: { (tracksPage) in

        if tracksPage.canMakeNextRequest {
            tracksPage.getNext(success: { (trackpage) in
                print("successfully fetched \(trackpage)")
            }, failure: { (error) in
                print(error.description)
                print(error.errorMessage)
            })
        }
         //completionHandler(tracksPage)
    }) { (error) in
        print(error.description)
        print(error.errorMessage)
    }

` and I get the error. I've also attached the stack trace below.

I am quite certain you'd be able to recreate the error if you fetch tracks for playlist that has number of songs over the the limit of 1 pagingObject and calling getNext on the pagingObject. Any fix or direction would be greatly appreciated!

screen shot 2017-07-09 at 7 56 24 pm

@kinshukJ kinshukJ changed the title getNext on paginObject for PlaylistTracks failing getNext on pagingObject for PlaylistTracks failing Jul 10, 2017
@Daltron
Copy link
Owner

Daltron commented Jul 10, 2017

Hi @kinshukJ! 😄 Thanks for providing such a detailed issue! I have fixed this in the v1.0.2 release! All you need to do is run pod update Spartan and you should be good to go! Thanks again! 👍

@Daltron Daltron closed this as completed Jul 10, 2017
@kinshukJ
Copy link
Author

Thanks for such a speedy fix Daltron!

@kinshukJ
Copy link
Author

Hi Daltron, it doesn't give an error, however it doesn't load more tracks either. The paging object I get after calling getNext on it returns the same set of the first 20 tracks. Any direction or update would be much appreciated!

@Daltron
Copy link
Owner

Daltron commented Jul 19, 2017

@kinshukJ I just tried to reproduce and am unable to. I have a playlist with a lot of tracks and getNext is returning the next set of tracks without any issues. Can you provide a code example that shows the error?

@Daltron Daltron reopened this Jul 19, 2017
@kinshukJ
Copy link
Author

My bad Daltron. It was a thread issue. It's all fixed and working :). Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants