mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 22:06:17 +00:00
fix: empty block
This commit is contained in:
@@ -8,7 +8,6 @@ import { gameAchievementsSublevel, levelKeys, db } from "@main/level";
|
||||
import { logger } from "@main/services/logger";
|
||||
import type { GameShop, User } from "@types";
|
||||
|
||||
|
||||
const uploadImageToCDN = async (imagePath: string): Promise<string> => {
|
||||
const stat = fs.statSync(imagePath);
|
||||
const fileBuffer = fs.readFileSync(imagePath);
|
||||
@@ -33,7 +32,6 @@ const uploadImageToCDN = async (imagePath: string): Promise<string> => {
|
||||
return response.achievementImageUrl;
|
||||
};
|
||||
|
||||
|
||||
const storeImageLocally = async (imagePath: string): Promise<string> => {
|
||||
const fileBuffer = fs.readFileSync(imagePath);
|
||||
const base64Image = fileBuffer.toString("base64");
|
||||
@@ -42,7 +40,6 @@ const storeImageLocally = async (imagePath: string): Promise<string> => {
|
||||
return `data:${mimeType?.mime || "image/jpeg"};base64,${base64Image}`;
|
||||
};
|
||||
|
||||
|
||||
const updateAchievementWithImageUrl = async (
|
||||
shop: GameShop,
|
||||
gameId: string,
|
||||
@@ -55,7 +52,6 @@ const updateAchievementWithImageUrl = async (
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
export const uploadAchievementImage = async (
|
||||
gameId: string,
|
||||
achievementName: string,
|
||||
@@ -103,7 +99,6 @@ export const uploadAchievementImage = async (
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const uploadAchievementImageEvent = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
params: {
|
||||
|
||||
@@ -5,11 +5,10 @@ import { app } from "electron";
|
||||
import { logger } from "./logger";
|
||||
|
||||
export class ScreenshotService {
|
||||
private static readonly SCREENSHOT_QUALITY = 80;
|
||||
private static readonly SCREENSHOT_QUALITY = 80;
|
||||
private static readonly SCREENSHOT_FORMAT = "jpeg";
|
||||
private static readonly MAX_WIDTH = 1280;
|
||||
private static readonly MAX_HEIGHT = 720;
|
||||
|
||||
private static readonly MAX_WIDTH = 1280;
|
||||
private static readonly MAX_HEIGHT = 720;
|
||||
|
||||
private static compressImage(
|
||||
image: Electron.NativeImage
|
||||
@@ -147,7 +146,7 @@ export class ScreenshotService {
|
||||
}
|
||||
|
||||
const cleanupEmptyDirs = (dir: string) => {
|
||||
if (dir === screenshotsDir) return;
|
||||
if (dir === screenshotsDir) return;
|
||||
|
||||
try {
|
||||
const items = fs.readdirSync(dir);
|
||||
@@ -156,6 +155,7 @@ export class ScreenshotService {
|
||||
logger.log(`Cleaned up empty directory: ${dir}`);
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error(`Failed to read directory ${dir}:`, error);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user