From cacbe9010284cea0c06e51dfb95555afb5c8132b Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Tue, 13 Mar 2018 16:24:40 +0500 Subject: [PATCH] [YoutubeBridge] Sort playlist items by publication date (#643) --- bridges/YoutubeBridge.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bridges/YoutubeBridge.php b/bridges/YoutubeBridge.php index 321fb26..7239259 100644 --- a/bridges/YoutubeBridge.php +++ b/bridges/YoutubeBridge.php @@ -181,6 +181,9 @@ class YoutubeBridge extends BridgeAbstract { or returnServerError("Could not request YouTube. Tried:\n - $url_listing"); $this->ytBridgeParseHtmlListing($html, 'tr.pl-video', '.pl-video-title a'); $this->feedName = 'Playlist: ' . str_replace(' - YouTube', '', $html->find('title', 0)->plaintext); // feedName will be used by getName() + usort($this->items, function ($item1, $item2) { + return $item2['timestamp'] - $item1['timestamp']; + }); } elseif($this->getInput('s')) { /* search mode */ $this->request = $this->getInput('s'); $page = 1;