File tree 2 files changed +8
-7
lines changed
packages/gatsby-transformer-video/src
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -106,15 +106,16 @@ export default class FFMPEG {
106
106
}
107
107
108
108
if ( type === `ContentfulAsset` ) {
109
- path = await cacheContentfulVideo ( {
110
- video,
111
- cacheDir : this . cacheDirOriginal ,
112
- } )
113
109
contentDigest = createContentDigest ( [
114
110
video . contentful_id ,
115
111
video . file . url ,
116
112
video . file . details . size ,
117
113
] )
114
+ path = await cacheContentfulVideo ( {
115
+ video,
116
+ contentDigest,
117
+ cacheDir : this . cacheDirOriginal ,
118
+ } )
118
119
}
119
120
120
121
if ( ! path ) {
Original file line number Diff line number Diff line change 1
1
import fs from "fs"
2
2
import { access } from "fs-extra"
3
- import { resolve } from "path"
3
+ import { resolve , extname } from "path"
4
4
5
5
import PQueue from "p-queue"
6
6
import axios from "axios"
@@ -18,12 +18,12 @@ const downloadCache = {}
18
18
* Retry is currently broken: https://github.com/gatsbyjs/gatsby/issues/22010
19
19
* Downloaded files are not cached properly: https://github.com/gatsbyjs/gatsby/issues/8324 & https://github.com/gatsbyjs/gatsby/pull/8379
20
20
*/
21
- export async function cacheContentfulVideo ( { video, cacheDir } ) {
21
+ export async function cacheContentfulVideo ( { video, cacheDir, contentDigest } ) {
22
22
const {
23
23
file : { url, fileName } ,
24
24
} = video
25
25
26
- const path = resolve ( cacheDir , fileName )
26
+ const path = resolve ( cacheDir , ` ${ contentDigest } . ${ extname ( fileName ) } ` )
27
27
28
28
try {
29
29
await access ( path , fs . constants . R_OK )
You can’t perform that action at this time.
0 commit comments