libpytunes icon indicating copy to clipboard operation
libpytunes copied to clipboard

Are length and total_time same or different?

Open shacker opened this issue 7 years ago • 3 comments

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?

shacker avatar May 18 '17 05:05 shacker

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 [email protected] 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.

NathanDotTo avatar May 18 '17 06:05 NathanDotTo

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

shacker avatar May 18 '17 06:05 shacker

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.

serv-inc avatar Sep 30 '17 08:09 serv-inc