Fixed video request

pull/57/head v4.1.4
Jesús María 4 years ago
parent 033b35aee9
commit 6912a2eddd

@ -1,4 +1,4 @@
# **Aruppi API** (v4.1.3) # **Aruppi API** (v4.1.4)
> This API has everything about Japan, from anime, music, radio, images, videos ... to japanese culture > This API has everything about Japan, from anime, music, radio, images, videos ... to japanese culture
> >

@ -1,6 +1,6 @@
{ {
"name": "aruppi", "name": "aruppi",
"version": "4.1.3", "version": "4.1.4",
"description": "Aruppi is a custom API to obtain data from the Japanese culture for the mobile app", "description": "Aruppi is a custom API to obtain data from the Japanese culture for the mobile app",
"main": "./src/api/api.ts", "main": "./src/api/api.ts",
"scripts": { "scripts": {

@ -339,7 +339,7 @@ export default class UtilsController {
if (redisClient.connected) { if (redisClient.connected) {
const resultQueryRedis: any = redisClient.get( const resultQueryRedis: any = redisClient.get(
`playlist_videos_${hashStringMd5(playlistId)}`, `videos_${hashStringMd5(playlistId)}`,
); );
if (resultQueryRedis) { if (resultQueryRedis) {
@ -371,14 +371,14 @@ export default class UtilsController {
/!* Set the key in the redis cache. *!/ /!* Set the key in the redis cache. *!/
redisClient.set( redisClient.set(
`playlist_videos_${hashStringMd5(playlistId)}`, `videos_${hashStringMd5(playlistId)}`,
JSON.stringify({ videos: results }), JSON.stringify({ videos: results }),
); );
/!* After 24hrs expire the key. *!/ /!* After 24hrs expire the key. *!/
redisClient.expireat( redisClient.expireat(
`playlist_videos_${hashStringMd5(playlistId)}`, `videos_${hashStringMd5(playlistId)}`,
parseInt(`${+new Date() / 1000}`, 10) + 7200, parseInt(`${+new Date() / 1000}`, 10) + 7200,
); );
} }

@ -26,7 +26,7 @@ routes.get('/api/v4/', (req: Request, res: Response) => {
res.json({ res.json({
message: 'Aruppi /api - 🎏', message: 'Aruppi /api - 🎏',
author: 'Jéluchu', author: 'Jéluchu',
version: '4.1.2', version: '4.1.4',
credits: 'The bitch loves /apis that offers data to Aruppi App', credits: 'The bitch loves /apis that offers data to Aruppi App',
entries: [ entries: [
{ {

Loading…
Cancel
Save