enhance(server): videoThumbnailGenerator config (#9845)
* enhance(server): videoThumbnailGenerator config
* ✌️
* fix
* 相対url
* サムネイルのproxyRemoteFilesは直接プロキシを指定する
* メディアプロキシ
This commit is contained in:
parent
3c7e1ff92e
commit
ee03ab8d2c
6 changed files with 82 additions and 14 deletions
|
|
@ -6,6 +6,7 @@ import { ImageProcessingService } from '@/core/ImageProcessingService.js';
|
|||
import type { IImage } from '@/core/ImageProcessingService.js';
|
||||
import { createTempDir } from '@/misc/create-temp.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { appendQuery, query } from '@/misc/prelude/url.js';
|
||||
|
||||
@Injectable()
|
||||
export class VideoProcessingService {
|
||||
|
|
@ -41,5 +42,18 @@ export class VideoProcessingService {
|
|||
cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public getExternalVideoThumbnailUrl(url: string): string | null {
|
||||
if (this.config.videoThumbnailGenerator == null) return null;
|
||||
|
||||
return appendQuery(
|
||||
`${this.config.videoThumbnailGenerator}/thumbnail.webp`,
|
||||
query({
|
||||
thumbnail: '1',
|
||||
url,
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue