mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
fix(frontend): allow more special characters in search input
fixes #430
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import axios, { AxiosInstance } from 'axios';
|
||||
import logger from '../logger';
|
||||
|
||||
export const ANIME_KEYWORD_ID = 210024;
|
||||
|
||||
@@ -374,7 +375,16 @@ class TheMovieDb {
|
||||
|
||||
return response.data;
|
||||
} catch (e) {
|
||||
throw new Error(`[TMDB] Failed to search multi: ${e.message}`);
|
||||
logger.error('Failed to search multi', {
|
||||
label: 'TMDB',
|
||||
errorMessage: e.message,
|
||||
});
|
||||
return {
|
||||
page: 1,
|
||||
results: [],
|
||||
total_pages: 1,
|
||||
total_results: 0,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -7,8 +7,20 @@ import type { Nullable } from '../utils/typeHelpers';
|
||||
|
||||
type Url = string | UrlObject;
|
||||
|
||||
const extraEncodes: [RegExp, string][] = [
|
||||
[/\(/g, '%28'],
|
||||
[/\)/g, '%29'],
|
||||
[/!/g, '%21'],
|
||||
];
|
||||
|
||||
const encodeURIExtraParams = (string: string): string => {
|
||||
return encodeURIComponent(string).replace(/!/g, '%21');
|
||||
let finalString = encodeURIComponent(string);
|
||||
|
||||
extraEncodes.forEach((encode) => {
|
||||
finalString = finalString.replace(encode[0], encode[1]);
|
||||
});
|
||||
|
||||
return finalString;
|
||||
};
|
||||
|
||||
interface SearchObject {
|
||||
|
Reference in New Issue
Block a user