chore: filter lists from movie data
This commit is contained in:
parent
42dbcb5d20
commit
1fbde02c99
2 changed files with 5 additions and 5 deletions
|
@ -9,7 +9,7 @@ module.exports = async function () {
|
|||
const res = await parser.parseURL(url).catch((error) => {
|
||||
console.log(error.message)
|
||||
})
|
||||
const data = res.items
|
||||
const movies = res.items
|
||||
.map((item) => {
|
||||
const images = item['content']?.match(/<img [^>]*src="[^"]*"[^>]*>/gm) || []
|
||||
return {
|
||||
|
@ -25,7 +25,7 @@ module.exports = async function () {
|
|||
id: item['guid'],
|
||||
}
|
||||
})
|
||||
.splice(0, 6)
|
||||
await asset.save(data, 'json')
|
||||
return data
|
||||
.filter((movie) => !movie.url.includes('/list/'))
|
||||
await asset.save(movies, 'json')
|
||||
return movies
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<div class="ml-1">Movies</div>
|
||||
</h2>
|
||||
<div class="grid grid-cols-3 gap-2 md:grid-cols-6 not-prose">
|
||||
{% for movie in movies %}
|
||||
{% for movie in movies limit: 6 %}
|
||||
<a href="{{movie.url}}" title="{{movie.name | escape}}">
|
||||
<div class="relative block" style="max-width:226px">
|
||||
<div class="absolute left-0 top-0 h-full w-full rounded-lg border border-purple-600 hover:border-pink-500 bg-cover-gradient dark:border-purple-400 dark:hover:border-pink-500 ease-in-out duration-300"></div>
|
||||
|
|
Reference in a new issue