mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
fix(metadata): adjust timeouts
This commit is contained in:
@@ -271,7 +271,7 @@ export class MetadataService {
|
||||
};
|
||||
},
|
||||
{
|
||||
timeout: 2500, // metadata does not take long to fetch so keep it low
|
||||
timeout: 5000,
|
||||
ttl: 5000,
|
||||
retryInterval: 100,
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ export class TMDBMetadata {
|
||||
url.searchParams.set('external_source', `${IdTypeMap[parsedId.type]}`);
|
||||
this.addSearchParams(url);
|
||||
const response = await makeRequest(url.toString(), {
|
||||
timeout: 10000,
|
||||
timeout: 2000,
|
||||
headers: this.getHeaders(),
|
||||
});
|
||||
|
||||
@@ -222,7 +222,7 @@ export class TMDBMetadata {
|
||||
);
|
||||
this.addSearchParams(detailsUrl);
|
||||
const detailsResponse = await makeRequest(detailsUrl.toString(), {
|
||||
timeout: 10000,
|
||||
timeout: 2000,
|
||||
headers: this.getHeaders(),
|
||||
});
|
||||
|
||||
@@ -278,7 +278,7 @@ export class TMDBMetadata {
|
||||
|
||||
const [altTitlesResult, translationsResult] = await Promise.allSettled([
|
||||
makeRequest(altTitlesUrl.toString(), {
|
||||
timeout: 10000,
|
||||
timeout: 2000,
|
||||
headers: this.getHeaders(),
|
||||
}).then(async (response) => {
|
||||
if (!response.ok) {
|
||||
@@ -300,7 +300,7 @@ export class TMDBMetadata {
|
||||
);
|
||||
}),
|
||||
makeRequest(translatedTitlesUrl.toString(), {
|
||||
timeout: 10000,
|
||||
timeout: 2000,
|
||||
headers: this.getHeaders(),
|
||||
}).then(async (response) => {
|
||||
if (!response.ok) {
|
||||
@@ -379,7 +379,7 @@ export class TMDBMetadata {
|
||||
const url = new URL(API_BASE_URL + '/authentication');
|
||||
this.addSearchParams(url);
|
||||
const validationResponse = await makeRequest(url.toString(), {
|
||||
timeout: 10000,
|
||||
timeout: 2000,
|
||||
headers: this.getHeaders(),
|
||||
});
|
||||
if (!validationResponse.ok) {
|
||||
|
||||
@@ -49,7 +49,7 @@ export async function getTraktAliases(
|
||||
const data = await makeRequest(
|
||||
`${TRAKT_API_BASE_URL}/${parsedId.mediaType === 'movie' ? 'movies' : 'shows'}/${imdbId}/aliases`,
|
||||
{
|
||||
timeout: 1000,
|
||||
timeout: 2000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'trakt-api-version': '1',
|
||||
|
||||
@@ -283,6 +283,7 @@ class TVDBApi {
|
||||
{
|
||||
schema: AuthTokenSchema,
|
||||
method: 'POST',
|
||||
timeout: 2000,
|
||||
body: {
|
||||
apikey: this.apiKey,
|
||||
},
|
||||
@@ -314,6 +315,7 @@ class TVDBApi {
|
||||
`/search/remoteid/${remoteId}`,
|
||||
{
|
||||
schema: RemoteIdSearchResponseSchema,
|
||||
timeout: 2000,
|
||||
}
|
||||
);
|
||||
},
|
||||
@@ -332,6 +334,7 @@ class TVDBApi {
|
||||
`/series/${id}`,
|
||||
{
|
||||
schema: SeriesResponseSchema,
|
||||
timeout: 2000,
|
||||
}
|
||||
);
|
||||
},
|
||||
@@ -350,6 +353,7 @@ class TVDBApi {
|
||||
`/movies/${id}`,
|
||||
{
|
||||
schema: MovieResponseSchema,
|
||||
timeout: 2000,
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user