Skip to content

Commit

Permalink
refactor: Optimize variable
Browse files Browse the repository at this point in the history
  • Loading branch information
TyxTang committed Nov 11, 2024
1 parent 8437847 commit 87de472
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/api/routers/media-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const mediaRequestsRouter = createTRPCRouter({
const versionResponse = await fetch(`${app.url}/api/v1/status`, { headers });
const versionBody = await versionResponse.json();
const version = versionBody.version || '0.0.0';
const isVersionValid = compareVersions(version, '2.0.1') >= 0;
const shouldUseV2ApiCall = compareVersions(version, '2.0.1') >= 0;
return fetch(`${app.url}/api/v1/user?take=25&skip=0&sort=requests`, {
headers,
})
Expand All @@ -129,7 +129,7 @@ export const mediaRequestsRouter = createTRPCRouter({
app: app.integration?.type ?? 'overseerr',
id: user.id,
userName: user.displayName,
userProfilePicture: constructAvatarUrl(appUrl, user.avatar, isVersionValid),
userProfilePicture: constructAvatarUrl(appUrl, user.avatar, shouldUseV2ApiCall),
userLink: `${appUrl}/users/${user.id}`,
userRequestCount: user.requestCount,
};
Expand Down

0 comments on commit 87de472

Please sign in to comment.