mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Store apps related to video as app links
This commit is contained in:
parent
d755c6485d
commit
e2b9ea8fef
1 changed files with 6 additions and 3 deletions
|
|
@ -140,13 +140,16 @@ async function handleFetchedVideo ( fetchedVideo, videoId, applist ) {
|
||||||
// Build video slug
|
// Build video slug
|
||||||
const slug = makeSlug( `${fetchedVideo.title}-i-${videoId}` )
|
const slug = makeSlug( `${fetchedVideo.title}-i-${videoId}` )
|
||||||
|
|
||||||
const apps = []
|
const appLinks = []
|
||||||
// Generate new tag set based on api data
|
// Generate new tag set based on api data
|
||||||
const tags = generateVideoTags(fetchedVideo)
|
const tags = generateVideoTags(fetchedVideo)
|
||||||
|
|
||||||
for ( const app of applist ) {
|
for ( const app of applist ) {
|
||||||
if (videoFeaturesApp(app, fetchedVideo)) {
|
if (videoFeaturesApp(app, fetchedVideo)) {
|
||||||
apps.push(app.slug)
|
appLinks.push({
|
||||||
|
name: app.name,
|
||||||
|
endpoint: app.endpoint
|
||||||
|
})
|
||||||
|
|
||||||
tags.add(app.category.slug)
|
tags.add(app.category.slug)
|
||||||
}
|
}
|
||||||
|
|
@ -165,7 +168,7 @@ async function handleFetchedVideo ( fetchedVideo, videoId, applist ) {
|
||||||
name: fetchedVideo.title,
|
name: fetchedVideo.title,
|
||||||
id: videoId,
|
id: videoId,
|
||||||
lastUpdated,
|
lastUpdated,
|
||||||
apps,
|
appLinks,
|
||||||
slug,
|
slug,
|
||||||
channel: {
|
channel: {
|
||||||
name: fetchedVideo.rawData.snippet.channelTitle,
|
name: fetchedVideo.rawData.snippet.channelTitle,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue