fix: Incorrect tmdb account details
This commit is contained in:
@@ -14,6 +14,13 @@ Contributions are welcome! See [contributing](#Contributing) for more informatio
|
||||
|
||||

|
||||
|
||||
## Reiverr 1.0
|
||||
|
||||
This is the page for Reiverr 2.0, which is a rewrite of the project with TVs in mind.
|
||||
It still lacks many features of the previous version. If you want a more stable experience,
|
||||
or only care about the web app, you might want to check out the
|
||||
[1.0 branch](https://github.com/aleksilassila/reiverr/tree/reiverr-1.0) for now.
|
||||
|
||||
# List of major features
|
||||
|
||||
TMDB Discovery:
|
||||
|
||||
@@ -72,6 +72,17 @@ export class TmdbApi implements Api<paths> {
|
||||
});
|
||||
}
|
||||
|
||||
static getClient4l() {
|
||||
const sessionId = get(appState)?.user?.settings.tmdb.sessionId;
|
||||
|
||||
return createClient<paths4>({
|
||||
baseUrl: 'https://api.themoviedb.org',
|
||||
headers: {
|
||||
Authorization: `Bearer ${sessionId}`
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getClient() {
|
||||
return TmdbApi.getClient();
|
||||
}
|
||||
@@ -80,6 +91,10 @@ export class TmdbApi implements Api<paths> {
|
||||
return TmdbApi.getClient4();
|
||||
}
|
||||
|
||||
getClient4l() {
|
||||
return TmdbApi.getClient4l();
|
||||
}
|
||||
|
||||
getSessionId() {
|
||||
return get(appState)?.user?.settings.tmdb.sessionId;
|
||||
}
|
||||
@@ -316,7 +331,7 @@ export class TmdbApi implements Api<paths> {
|
||||
|
||||
const top100: TmdbMovieSmall[] = await Promise.all(
|
||||
[...Array(5).keys()].map((i) =>
|
||||
this.getClient4()
|
||||
this.getClient4l()
|
||||
?.GET('/4/account/{account_object_id}/movie/recommendations', {
|
||||
params: {
|
||||
path: {
|
||||
@@ -391,7 +406,7 @@ export class TmdbApi implements Api<paths> {
|
||||
|
||||
const top100: TmdbSeriesSmall[] = await Promise.all(
|
||||
[...Array(5).keys()].map((i) =>
|
||||
this.getClient4()
|
||||
this.getClient4l()
|
||||
?.GET('/4/account/{account_object_id}/tv/recommendations', {
|
||||
params: {
|
||||
path: {
|
||||
@@ -463,15 +478,18 @@ export class TmdbApi implements Api<paths> {
|
||||
const userId = this.getUserId();
|
||||
if (!userId) return undefined;
|
||||
|
||||
return this.getClient()
|
||||
?.GET('/3/account/{account_id}', {
|
||||
return (
|
||||
this.getClient4l()
|
||||
// @ts-ignore
|
||||
?.GET('/4/account/{account_object_id}', {
|
||||
params: {
|
||||
path: {
|
||||
account_id: Number(userId)
|
||||
account_object_id: userId
|
||||
}
|
||||
}
|
||||
})
|
||||
.then((res) => res.data);
|
||||
.then((res) => res.data)
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user