mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-13 16:40:01 +00:00
Release 2.1.1
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gameyfin",
|
"name": "gameyfin",
|
||||||
"version": "2.1.0",
|
"version": "2.1.1-preview",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@heroui/react": "2.7.9",
|
"@heroui/react": "2.7.9",
|
||||||
@@ -265,4 +265,4 @@
|
|||||||
"disableUsageStatistics": true,
|
"disableUsageStatistics": true,
|
||||||
"hash": "dba97848bdace60924f9cee496353baae70cfa4fccc7bacaf827807c51908866"
|
"hash": "dba97848bdace60924f9cee496353baae70cfa4fccc7bacaf827807c51908866"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import {Button, Link, Popover, PopoverContent, PopoverTrigger} from "@heroui/react";
|
||||||
|
import {Warning} from "@phosphor-icons/react";
|
||||||
|
|
||||||
|
// TODO: Remove this component before the release of version 2.2.0
|
||||||
|
export default function DockerHubDeprecationPopover() {
|
||||||
|
return (
|
||||||
|
<Popover placement="bottom-end" showArrow={true} color="warning">
|
||||||
|
<PopoverTrigger>
|
||||||
|
<Button isIconOnly color="warning" variant="flat">
|
||||||
|
<Warning/>
|
||||||
|
</Button>
|
||||||
|
</PopoverTrigger>
|
||||||
|
<PopoverContent>
|
||||||
|
<div className="m-4 text-sm leading-relaxed">
|
||||||
|
<h3 className="mb-2 font-bold">Image deprecation notice</h3>
|
||||||
|
<p>
|
||||||
|
Starting with version
|
||||||
|
<code className="font-semibold"> 2.2.0 </code>
|
||||||
|
the image{' '}
|
||||||
|
<Link href="https://hub.docker.com/r/grimsi/gameyfin"
|
||||||
|
isExternal
|
||||||
|
underline="always"
|
||||||
|
size="sm"
|
||||||
|
className="text-warning-contrast">
|
||||||
|
grimsi/gameyfin
|
||||||
|
</Link>
|
||||||
|
{' '}will no longer be published to Docker Hub.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Please switch to{' '}
|
||||||
|
<Link href="https://github.com/gameyfin/gameyfin/pkgs/container/gameyfin"
|
||||||
|
isExternal
|
||||||
|
underline="always"
|
||||||
|
size="sm"
|
||||||
|
className="text-warning-contrast">
|
||||||
|
ghcr.io/gameyfin/gameyfin
|
||||||
|
</Link>
|
||||||
|
{' '}if you are currently using the Docker Hub image.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</PopoverContent>
|
||||||
|
</Popover>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -14,6 +14,7 @@ import {useSnapshot} from "valtio/react";
|
|||||||
import {gameState} from "Frontend/state/GameState";
|
import {gameState} from "Frontend/state/GameState";
|
||||||
import ScanProgressPopover from "Frontend/components/general/ScanProgressPopover";
|
import ScanProgressPopover from "Frontend/components/general/ScanProgressPopover";
|
||||||
import {isAdmin} from "Frontend/util/utils";
|
import {isAdmin} from "Frontend/util/utils";
|
||||||
|
import DockerHubDeprecationPopover from "Frontend/components/temp/DockerHubDeprecationPopover";
|
||||||
|
|
||||||
export default function MainLayout() {
|
export default function MainLayout() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -105,13 +106,22 @@ export default function MainLayout() {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</NavbarItem>
|
</NavbarItem>
|
||||||
{isAdmin(auth) &&
|
{isAdmin(auth) &&
|
||||||
<NavbarItem>
|
<div className="flex flex-row">
|
||||||
<Tooltip content="View library scan results" placement="bottom">
|
<NavbarItem>
|
||||||
<div>
|
<Tooltip content="Important information" placement="bottom">
|
||||||
<ScanProgressPopover/>
|
<div>
|
||||||
</div>
|
<DockerHubDeprecationPopover/>
|
||||||
</Tooltip>
|
</div>
|
||||||
</NavbarItem>
|
</Tooltip>
|
||||||
|
</NavbarItem>
|
||||||
|
<NavbarItem>
|
||||||
|
<Tooltip content="View library scan results" placement="bottom">
|
||||||
|
<div>
|
||||||
|
<ScanProgressPopover/>
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
|
</NavbarItem>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
{auth.state.user &&
|
{auth.state.user &&
|
||||||
<NavbarItem>
|
<NavbarItem>
|
||||||
|
|||||||
@@ -85,17 +85,26 @@ function SetupView() {
|
|||||||
initialValues={{username: '', email: '', password: '', passwordRepeat: ''}}
|
initialValues={{username: '', email: '', password: '', passwordRepeat: ''}}
|
||||||
onSubmit={
|
onSubmit={
|
||||||
async (values: any) => {
|
async (values: any) => {
|
||||||
await SetupEndpoint.registerSuperAdmin({
|
try {
|
||||||
username: values.username,
|
await SetupEndpoint.registerSuperAdmin({
|
||||||
password: values.password,
|
username: values.username,
|
||||||
email: values.email
|
password: values.password,
|
||||||
});
|
email: values.email
|
||||||
addToast({
|
});
|
||||||
title: "Setup finished",
|
addToast({
|
||||||
description: "Have fun with Gameyfin!",
|
title: "Setup finished",
|
||||||
color: "success"
|
description: "Have fun with Gameyfin!",
|
||||||
})
|
color: "success"
|
||||||
navigate('/login');
|
});
|
||||||
|
} catch (e) {
|
||||||
|
addToast({
|
||||||
|
title: "Could not register super admin user",
|
||||||
|
description: "Maybe Gameyfin is already set up?",
|
||||||
|
color: "warning"
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
navigate('/login');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class GameRequestService(
|
|||||||
listOf(GameRequestStatus.PENDING)
|
listOf(GameRequestStatus.PENDING)
|
||||||
)
|
)
|
||||||
val maxRequestsPerUser = config.get(ConfigProperties.Requests.Games.MaxOpenRequestsPerUser) ?: 0
|
val maxRequestsPerUser = config.get(ConfigProperties.Requests.Games.MaxOpenRequestsPerUser) ?: 0
|
||||||
if (maxRequestsPerUser == 0 || (auth?.isAdmin() != true && pendingRequestsForUser.size >= maxRequestsPerUser)) {
|
if (maxRequestsPerUser != 0 && auth?.isAdmin() != true && pendingRequestsForUser.size >= maxRequestsPerUser) {
|
||||||
throw EndpointException("You have reached the maximum number of pending requests (${maxRequestsPerUser})")
|
throw EndpointException("You have reached the maximum number of pending requests (${maxRequestsPerUser})")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+70
@@ -0,0 +1,70 @@
|
|||||||
|
-- Flyway Migration: V2.1.1
|
||||||
|
-- Purpose: Fully eliminate unintended uniqueness on GAME.COVER_IMAGE_ID / HEADER_IMAGE_ID
|
||||||
|
-- by dropping and recreating foreign keys and removing lingering unique indexes
|
||||||
|
-- Context:
|
||||||
|
-- * Original schema created UNIQUE constraints (UK52... cover, UK30... header).
|
||||||
|
-- * V2.1.0.1 dropped those constraints but H2 left behind unique indexes (UK52..._INDEX_n etc.).
|
||||||
|
-- Strategy:
|
||||||
|
-- 1. Drop the foreign keys (idempotent).
|
||||||
|
-- 2. Drop any remaining unique constraints (defensive repeat) and their indexes.
|
||||||
|
-- 3. Recreate NON-UNIQUE supporting indexes explicitly (optional but good for lookups).
|
||||||
|
-- 4. Recreate the foreign keys cleanly without reintroducing uniqueness.
|
||||||
|
-- 5. All steps are idempotent / tolerant so reruns don't fail.
|
||||||
|
|
||||||
|
/******************************************************************************************
|
||||||
|
* 1. Drop foreign keys so their backing indexes can be dropped safely
|
||||||
|
******************************************************************************************/
|
||||||
|
ALTER TABLE GAME
|
||||||
|
DROP CONSTRAINT IF EXISTS FK_GAME_COVER_IMAGE;
|
||||||
|
ALTER TABLE GAME
|
||||||
|
DROP CONSTRAINT IF EXISTS FK_GAME_HEADER_IMAGE;
|
||||||
|
|
||||||
|
-- Also attempt legacy hashed names (in case rename earlier never ran)
|
||||||
|
ALTER TABLE GAME
|
||||||
|
DROP CONSTRAINT IF EXISTS FK6CVB43REAYSNYPI0XDY6HQTVF; -- old cover FK
|
||||||
|
ALTER TABLE GAME
|
||||||
|
DROP CONSTRAINT IF EXISTS FK8N86NDPGKMOO7YOLX6HL8N84G;
|
||||||
|
-- old header FK
|
||||||
|
|
||||||
|
/******************************************************************************************
|
||||||
|
* 2. Drop any lingering UNIQUE constraints again (defensive) and their indexes
|
||||||
|
******************************************************************************************/
|
||||||
|
ALTER TABLE GAME
|
||||||
|
DROP CONSTRAINT IF EXISTS UK52RQ62FLPBNTI77BYKM7UAHKQ; -- old unique cover
|
||||||
|
ALTER TABLE GAME
|
||||||
|
DROP CONSTRAINT IF EXISTS UK30B16LLQV54H40XIOGP7T9P35; -- old unique header
|
||||||
|
ALTER TABLE GAME
|
||||||
|
DROP CONSTRAINT IF EXISTS UQ_GAME_COVER_IMAGE_ID; -- friendly (future) name
|
||||||
|
ALTER TABLE GAME
|
||||||
|
DROP CONSTRAINT IF EXISTS UQ_GAME_HEADER_IMAGE_ID;
|
||||||
|
-- friendly (future) name
|
||||||
|
|
||||||
|
-- Drop possible leftover unique indexes (multiple variants tried)
|
||||||
|
DROP INDEX IF EXISTS UK52RQ62FLPBNTI77BYKM7UAHKQ_INDEX_2;
|
||||||
|
DROP INDEX IF EXISTS UK52RQ62FLPBNTI77BYKM7UAHKQ_INDEX_1;
|
||||||
|
DROP INDEX IF EXISTS UK30B16LLQV54H40XIOGP7T9P35_INDEX_2;
|
||||||
|
DROP INDEX IF EXISTS UK30B16LLQV54H40XIOGP7T9P35_INDEX_1;
|
||||||
|
|
||||||
|
/******************************************************************************************
|
||||||
|
* 3. Create explicit NON-UNIQUE indexes (only if missing)
|
||||||
|
******************************************************************************************/
|
||||||
|
CREATE INDEX IF NOT EXISTS IDX_GAME_COVER_IMAGE ON GAME (COVER_IMAGE_ID);
|
||||||
|
CREATE INDEX IF NOT EXISTS IDX_GAME_HEADER_IMAGE ON GAME (HEADER_IMAGE_ID);
|
||||||
|
|
||||||
|
/******************************************************************************************
|
||||||
|
* 4. Recreate foreign keys (non-unique by definition)
|
||||||
|
******************************************************************************************/
|
||||||
|
ALTER TABLE GAME
|
||||||
|
ADD CONSTRAINT FK_GAME_COVER_IMAGE FOREIGN KEY (COVER_IMAGE_ID) REFERENCES IMAGE (ID);
|
||||||
|
ALTER TABLE GAME
|
||||||
|
ADD CONSTRAINT FK_GAME_HEADER_IMAGE FOREIGN KEY (HEADER_IMAGE_ID) REFERENCES IMAGE (ID);
|
||||||
|
|
||||||
|
/******************************************************************************************
|
||||||
|
* 5. (Optional manual verification after migration)
|
||||||
|
* -- SELECT INDEX_NAME, NON_UNIQUE, COLUMN_NAME FROM INFORMATION_SCHEMA.INDEXES
|
||||||
|
* -- WHERE TABLE_NAME='GAME' AND COLUMN_NAME IN ('COVER_IMAGE_ID','HEADER_IMAGE_ID');
|
||||||
|
* Expected: ONLY non-unique indexes (NON_UNIQUE=TRUE) for those columns.
|
||||||
|
******************************************************************************************/
|
||||||
|
|
||||||
|
-- End of migration.
|
||||||
|
|
||||||
+1
-1
@@ -6,7 +6,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
|||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
|
|
||||||
group = "org.gameyfin"
|
group = "org.gameyfin"
|
||||||
version = "2.1.0"
|
version = "2.1.1-preview"
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
Reference in New Issue
Block a user