mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Use related videos helper on app pages
This commit is contained in:
parent
899bac2106
commit
afec75f482
1 changed files with 6 additions and 5 deletions
|
|
@ -76,17 +76,18 @@ export default {
|
||||||
async asyncData ({ params: { slug } }) {
|
async asyncData ({ params: { slug } }) {
|
||||||
|
|
||||||
const { default: videoList } = await import('~/static/video-list.json')
|
const { default: videoList } = await import('~/static/video-list.json')
|
||||||
|
const { videosRelatedToApp } = await import('~/helpers/related.js')
|
||||||
|
|
||||||
const app = appList.find(app => (app.slug === slug))
|
const app = appList.find(app => (app.slug === slug))
|
||||||
|
|
||||||
const relatedVideos = []
|
const relatedVideos = videosRelatedToApp(app)
|
||||||
|
|
||||||
// Find other videos that also feature this video's app
|
// Find other videos that also feature this video's app
|
||||||
for (const video of videoList) {
|
// for (const video of videoList) {
|
||||||
if (!video.apps.includes(app.slug)) continue
|
// if (!video.apps.includes(app.slug)) continue
|
||||||
|
|
||||||
relatedVideos.push(video)
|
// relatedVideos.push(video)
|
||||||
}
|
// }
|
||||||
|
|
||||||
return {
|
return {
|
||||||
slug,
|
slug,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue