python-tidal icon indicating copy to clipboard operation
python-tidal copied to clipboard

[Question] session.user.favorites.tracks -> track.id is int instead of str?

Open GioF71 opened this issue 1 year ago • 2 comments

Hello, while implementing a feature which allows the user to add/remove a single track to/from the favorites in my tidal plugin for upmpdcli, I struggled to verify whether a track was actually in favorites or not. After adding a few debug information in the log (unfortunately debugging the plugin is almost impossible AFAIK), I ended up finding that the field "id" of a Track coming from session.user.favorites.tracks is of type int while I assumed it would be of type str. After that, I have been able to implement the functionality correctly, so I am out of trouble already.

It looks to me that generally those id fields should be of type str, am I wrong?

Thank you

GioF71 avatar May 02 '24 08:05 GioF71

Yes, also related to this issue. It seems the id usage is not consistent. Generally, it is assumed that a str is used throughout tidalapi.

https://github.com/tamland/python-tidal/issues/227

tehkillerbee avatar May 05 '24 15:05 tehkillerbee

Thank you!

GioF71 avatar May 06 '24 05:05 GioF71