feat: reverse publishAt sort

This commit is contained in:
VC
2023-10-03 15:46:07 +02:00
parent c51d9adb49
commit 8bdfdae1aa

View File

@@ -37,7 +37,7 @@ pub struct PeerTubeVideoStreamingPlaylistsFilesResolution {
/// This gets the last video uploaded to the PeerTube server /// This gets the last video uploaded to the PeerTube server
pub fn get_latest_video(u: &str) -> Result<PeerTubeVideo, Box<dyn Error>> { pub fn get_latest_video(u: &str) -> Result<PeerTubeVideo, Box<dyn Error>> {
let body = reqwest::blocking::get(format!("{}/api/v1/videos?count=1&sort=publishedAt", u))? let body = reqwest::blocking::get(format!("{}/api/v1/videos?count=1&sort=-publishedAt", u))?
.json::<PeerTubeVideos>()?; .json::<PeerTubeVideos>()?;
let vid = get_video_detail(u, &body.data[0].uuid)?; let vid = get_video_detail(u, &body.data[0].uuid)?;