feat: Overseerr to Jellyseerr migration (#2019)
* feat: add Overseerr migration * refactor: rename to Seerr * refactor: more rename to Seerr * feat: update the value of the MediaStatus.DELETED enum * fix: add more details in migration logs * fix: replace .update by .save for TypeORM hooks * fix: add fake migration to skip the duplicated UpdateWebPush migration * fix: rewrite the AddUserAvatarCacheFields migration for Overseerr merge * fix: replace jellyseerr migrations with a dedicated one for overseerr * fix: update overseerr migration * fix: update overseerr migration * fix: remove irrelevant changes * fix: typos * docs: update jsdoc comment * docs: update seerr description * docs: fix the contributing.md link * fix: remove unwanterd change on postgres dev datasource * docs: add latest tag to docker image * fix: migrate old deleted status for 4k media * fix: update Seerr version check
This commit is contained in:
79
gen-docs/src/components/SeerrVersion/index.tsx
Normal file
79
gen-docs/src/components/SeerrVersion/index.tsx
Normal file
@@ -0,0 +1,79 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
export const SeerrVersion = () => {
|
||||
const [version, setVersion] = useState<string | null>('0.0.0');
|
||||
|
||||
useEffect(() => {
|
||||
async function fetchVersion() {
|
||||
try {
|
||||
const response = await fetch(
|
||||
'https://raw.githubusercontent.com/seerr-team/seerr/main/package.json'
|
||||
);
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
setVersion(data.version);
|
||||
console.log(data.version);
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch version', error);
|
||||
setVersion('Error fetching version');
|
||||
}
|
||||
}
|
||||
fetchVersion();
|
||||
}, []);
|
||||
|
||||
return version;
|
||||
};
|
||||
|
||||
export const NixpkgVersion = () => {
|
||||
const [versions, setVersions] = useState(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchVersion = async () => {
|
||||
try {
|
||||
const unstableUrl =
|
||||
'https://raw.githubusercontent.com/NixOS/nixpkgs/refs/heads/nixos-unstable/pkgs/by-name/je/jellyseerr/package.nix';
|
||||
const stableUrl =
|
||||
'https://raw.githubusercontent.com/NixOS/nixpkgs/refs/heads/nixos-25.05/pkgs/by-name/je/jellyseerr/package.nix';
|
||||
|
||||
const [unstableResponse, stableResponse] = await Promise.all([
|
||||
fetch(unstableUrl),
|
||||
fetch(stableUrl),
|
||||
]);
|
||||
|
||||
const unstableData = await unstableResponse.text();
|
||||
const stableData = await stableResponse.text();
|
||||
|
||||
const versionRegex = /version\s*=\s*"([^"]+)"/;
|
||||
|
||||
const unstableMatch = unstableData.match(versionRegex);
|
||||
const stableMatch = stableData.match(versionRegex);
|
||||
|
||||
const unstableVersion =
|
||||
unstableMatch && unstableMatch[1] ? unstableMatch[1] : '0.0.0';
|
||||
const stableVersion =
|
||||
stableMatch && stableMatch[1] ? stableMatch[1] : '0.0.0';
|
||||
|
||||
setVersions({ unstable: unstableVersion, stable: stableVersion });
|
||||
setLoading(false);
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
fetchVersion();
|
||||
}, []);
|
||||
|
||||
if (loading) {
|
||||
return 'Loading...';
|
||||
}
|
||||
|
||||
if (error) {
|
||||
return { error };
|
||||
}
|
||||
|
||||
return versions;
|
||||
};
|
||||
Reference in New Issue
Block a user