mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Sort videos newest first
This commit is contained in:
parent
8d954f76f0
commit
12a922b2ba
1 changed files with 15 additions and 2 deletions
|
|
@ -2,7 +2,8 @@
|
|||
import slugify from 'slugify'
|
||||
import axios from 'axios'
|
||||
|
||||
|
||||
import { byTimeThenNull } from './sort-list.js'
|
||||
import parseGithubDate from './parse-github-date'
|
||||
|
||||
const videoFeaturesApp = function (app, video) {
|
||||
const appFuzzyName = app.name.toLowerCase()
|
||||
|
|
@ -42,9 +43,19 @@ export default async function ( applist ) {
|
|||
}
|
||||
}
|
||||
|
||||
// console.log('fetchedVideos[videoId].rawData.snippet.publishedAt', fetchedVideos[videoId].rawData.snippet.publishedAt)
|
||||
|
||||
const lastUpdated = {
|
||||
raw: fetchedVideos[videoId].rawData.snippet.publishedAt,
|
||||
timestamp: parseGithubDate(fetchedVideos[videoId].rawData.snippet.publishedAt).timestamp,
|
||||
}
|
||||
|
||||
// console.log('lastUpdated', lastUpdated)
|
||||
|
||||
videos.push({
|
||||
name: fetchedVideos[videoId].title,
|
||||
id: videoId,
|
||||
lastUpdated,
|
||||
apps,
|
||||
slug,
|
||||
timestamps: fetchedVideos[videoId].timestamps,
|
||||
|
|
@ -54,5 +65,7 @@ export default async function ( applist ) {
|
|||
|
||||
// console.log('videos', videos)
|
||||
|
||||
return videos
|
||||
// publishedAt
|
||||
|
||||
return videos.sort(byTimeThenNull)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue