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

[Feature Request] Add a setter method for track_time #11

Closed
deepjyoti30 opened this issue Jul 13, 2020 · 5 comments
Closed

[Feature Request] Add a setter method for track_time #11

deepjyoti30 opened this issue Jul 13, 2020 · 5 comments

Comments

@deepjyoti30
Copy link

Hey there, thanks for the nice project!

I am the developer of ytmdl and my project has been dependent on your library since the beginning.

It was later that I noticed that the track_time property of the songs are returned in miliseconds, however, my requirement was to get them in seconds, so I added a bit of code that updates the track_time value and then passed the whole results container along.

It was working all nice and well until the last release. You made the move to change track_time to a property and it turns out the property doesn't have a setter method which is why my code was unable to update the track_time value and so as a result a lot of users started facing the issue.

However, a few days ago a fellow user pointed out the issue to me and I found out about the latest release that broke my code.

I just wanted to request to please add a setter method for the track_time property so that I can go back to using all the latest releases as currently I have forced the version 1.5.5 in the setup.

Cheers! Thanks for the awesome library, really appreciate it.

@deepjyoti30 deepjyoti30 changed the title [Feature Request] Add a setter property for track_time [Feature Request] Add a setter method for track_time Jul 13, 2020
@sleepyfran
Copy link
Owner

Hey! Awesome to see that such an amazing project is using itunespy 😄

I understand the use case, however I think it'd be much better if instead of exposing a setter (I'd like to keep everything inside the objects as immutable as possible) the library could expose a method to return the time in a given time span (milliseconds, seconds, minutes, etc.), how does that sound?

@deepjyoti30
Copy link
Author

@sleepyfran That would be perfect. I'd be glad to have something like that, it'd save me a bit of extra code.

@sleepyfran sleepyfran self-assigned this Jul 14, 2020
@sleepyfran
Copy link
Owner

@deepjyoti30 Awesome! I'll take a look as soon as I have time 😄

@sleepyfran
Copy link
Owner

Hey @deepjyoti30! I've been looking into it and I just remembered that there's already a method in the track that might help you with it. All tracks expose a get_track_time_minutes and get_track_time_hours that I think should be exactly what you're looking for. Is there any reason why you're not using those? 😄

Sorry I didn't come up with it before, it's been a while since I've worked on the library.

@sleepyfran sleepyfran removed their assignment Jul 15, 2020
@deepjyoti30
Copy link
Author

@sleepyfran Wow, I was not aware that it was available.

I had also implemented the code that had itunespy a while back so I guess I never looked through the available methods. Thanks a lot for that, I'll close the issue.

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

No branches or pull requests

2 participants