소스 검색

[YoutubeBridge] Sort playlist items by publication date (#643)

Eugene Molotov 6 년 전
부모
커밋
cacbe90102
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      bridges/YoutubeBridge.php

+ 3 - 0
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;