rename detectResponseType
This commit is contained in:
parent
13b50028d8
commit
88b41f86a9
|
@ -344,7 +344,7 @@ export class FileInfoService {
|
||||||
* Detect MIME Type and extension by stream and path for performance
|
* Detect MIME Type and extension by stream and path for performance
|
||||||
*/
|
*/
|
||||||
@bindThis
|
@bindThis
|
||||||
public async detectRequestType(_response: Response, path?: string, fileSavingPromise: Promise<any> = Promise.resolve()): Promise<{
|
public async detectResponseType(_response: Response, path?: string, fileSavingPromise: Promise<any> = Promise.resolve()): Promise<{
|
||||||
mime: string;
|
mime: string;
|
||||||
ext: string | null;
|
ext: string | null;
|
||||||
}> {
|
}> {
|
||||||
|
|
|
@ -111,7 +111,7 @@ export class FileServerService {
|
||||||
const response = await this.downloadService.fetchUrl(file.uri);
|
const response = await this.downloadService.fetchUrl(file.uri);
|
||||||
const fileSaving = this.downloadService.pipeRequestToFile(response, path);
|
const fileSaving = this.downloadService.pipeRequestToFile(response, path);
|
||||||
|
|
||||||
const { mime, ext } = await this.fileInfoService.detectRequestType(response, path, fileSaving);
|
const { mime, ext } = await this.fileInfoService.detectResponseType(response, path, fileSaving);
|
||||||
|
|
||||||
const convertFile = async () => {
|
const convertFile = async () => {
|
||||||
if (isThumbnail) {
|
if (isThumbnail) {
|
||||||
|
|
|
@ -77,7 +77,7 @@ export class MediaProxyServerService {
|
||||||
const response = await this.downloadService.fetchUrl(url);
|
const response = await this.downloadService.fetchUrl(url);
|
||||||
const fileSaving = this.downloadService.pipeRequestToFile(response, path);
|
const fileSaving = this.downloadService.pipeRequestToFile(response, path);
|
||||||
|
|
||||||
const { mime, ext } = await this.fileInfoService.detectRequestType(response, path, fileSaving);
|
const { mime, ext } = await this.fileInfoService.detectResponseType(response, path, fileSaving);
|
||||||
const isConvertibleImage = isMimeImage(mime, 'sharp-convertible-image');
|
const isConvertibleImage = isMimeImage(mime, 'sharp-convertible-image');
|
||||||
const isAnimationConvertibleImage = isMimeImage(mime, 'sharp-animation-convertible-image');
|
const isAnimationConvertibleImage = isMimeImage(mime, 'sharp-animation-convertible-image');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue