liamks / libpytunes

Python Itunes Library parser
https://github.com/liamks/pyitunes
MIT License
220 stars 88 forks source link

Are length and total_time same or different? #43

Open shacker opened 7 years ago

shacker commented 7 years ago

Spot-checking my library, these two fields seem to yield the same results. Is there any case where they're different? If not, should we drop one of them? Which one?

NathanDotTo commented 7 years ago

Which two fields please?

I can’t tell from your comment in the issue.

Thanks

Nathan

On 18 May 2017, at 07:54, Scot Hacker notifications@github.com wrote:

Spot-checking my library, these two fields seem to yield the same results. Is there any case where they're different? If not, should we drop one of them? Which one?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

shacker commented 7 years ago

Per the ticket title - length and total_time (song.length and song.total_time)

serv-inc commented 7 years ago

They seem to be the same (modulo conversion to int): https://github.com/liamks/libpytunes/blob/master/libpytunes/Library.py#L82 says:

s.length = int(attributes.get('Total Time')) if attributes.get('Total Time') else None

The XML calls it Total Time.