mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-24 02:39:18 -05:00
* fix(avatar): fix avatar cache busting by using avatarVersion Previously, avatar caching did not update the avatar when the remote image changed. This commit adds logic to check if the avatar was modified remotely by comparing aremote last-modified timestamp with a locally stored version (avatarVersion). If a change is detected, the cache is cleared, a new image is fetched, and avatarVersionis updated. Otherwise, the cached image is retained. * chore(db): add db migrations * refactor: refactor imagehelpers util to where its used * refactor: remove remnants from previous cache busting versions
22 lines
690 B
TypeScript
22 lines
690 B
TypeScript
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class AddUserAvatarCacheFields1743107707465
|
|
implements MigrationInterface
|
|
{
|
|
name = 'AddUserAvatarCacheFields1743107707465';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`ALTER TABLE "user" ADD "avatarETag" character varying`
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "user" ADD "avatarVersion" character varying`
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarVersion"`);
|
|
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarETag"`);
|
|
}
|
|
}
|