What we listened to at the dawn of the UNIX era...

Support for the WordPress Last.fm plugin
hkingman
Posts: 2
Joined: Mon Apr 15, 2019 3:28 am

What we listened to at the dawn of the UNIX era...

Unread post by hkingman » Mon Apr 15, 2019 3:45 am

Hello there,

Thanks for making this cool plugin.

I had an issue where the currently playing song was displaying a time of "Jan 1, 1970, 00:00", the dawn of the so-called UNIX era, because Last.FM was not sending along a date element for currently spinning tunes. This seemed to fix things up:

Code: Select all

218,219c218,223
<             $local_timestamp = $timestamp + $offset;
<             $date_time = date_i18n( 'd M Y, H:i', $local_timestamp ); // Format the same as last.fm original
---
> 	    if ($timestamp > 0) {
>             	$local_timestamp = $timestamp + $offset;
>             	$date_time = date_i18n( 'd M Y, H:i', $local_timestamp ); // Format the same as last.fm original
> 	    } else {
> 		$date_time = "Playing now...";
> 	    }
Cheers,

-Henry
Attachments
keiran.jpg
keiran.jpg (34.57 KiB) Viewed 380 times

User avatar
Kieran
Posts: 2058
Joined: Sat May 26, 2007 1:55 pm
Location: London
Contact:

Re: What we listened to at the dawn of the UNIX era...

Unread post by Kieran » Sat Apr 27, 2019 8:55 pm

Glad you like the plugin and thanks for spotting this and for providing a fix. I'll get this released out this evening!

hkingman
Posts: 2
Joined: Mon Apr 15, 2019 3:28 am

Re: What we listened to at the dawn of the UNIX era...

Unread post by hkingman » Mon Apr 29, 2019 4:53 pm

Update installed this morning and working fine. Goodonya... Thanks for the pull!

Post Reply