|
|
@@ -4,6 +4,7 @@ import PaginationService from 'App/Services/PaginationService'
|
|
|
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
|
import Series from 'App/Models/Series'
|
|
|
import Episode from 'App/Models/Episode'
|
|
|
+import Drive from '@ioc:Adonis/Core/Drive'
|
|
|
|
|
|
export default class PlayHistoriesController {
|
|
|
private paginationService = new PaginationService(PlayHistory)
|
|
|
@@ -21,6 +22,24 @@ export default class PlayHistoriesController {
|
|
|
.filter((id) => !!id)
|
|
|
)
|
|
|
const series = await Series.findMany(Array.from(seriesIds))
|
|
|
+ await Promise.all(
|
|
|
+ series.map(async (s) => {
|
|
|
+ try {
|
|
|
+ if (s.cover) {
|
|
|
+ const url = new URL(s.cover)
|
|
|
+ const filePath = url.pathname.replace(/^\//, '')
|
|
|
+ s.cover = await Drive.getSignedUrl(filePath)
|
|
|
+ }
|
|
|
+ } catch (e) {}
|
|
|
+ try {
|
|
|
+ if (s.landscapeCover) {
|
|
|
+ const url = new URL(s.landscapeCover)
|
|
|
+ const filePath = url.pathname.replace(/^\//, '')
|
|
|
+ s.landscapeCover = await Drive.getSignedUrl(filePath)
|
|
|
+ }
|
|
|
+ } catch (e) {}
|
|
|
+ })
|
|
|
+ )
|
|
|
const episodeIds = new Set(
|
|
|
page
|
|
|
.all()
|