init: media-center v2

Rewrite of ESH-Media v1 with separated main/renderer/shared architecture
(vite-plugin-electron, React 18, react-router-dom). Includes NeDB storage,
electron-store config, proxy manager with FoxyProxy/uBlock extensions,
custom server-checked updater, NSIS installer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-11 23:49:43 +03:00
commit ecb5e7e49f
52 changed files with 11718 additions and 0 deletions

121
src/shared/types.ts Normal file
View File

@@ -0,0 +1,121 @@
// Site Configuration Types
export interface SiteConfig {
id: string;
name: string;
url: string;
logo: string;
enabled: boolean;
useProxy: boolean;
searchScript: string; // Path to custom search script file
}
export interface ConfigData {
version: string;
lastUpdated: string;
sites: SiteConfig[];
}
// Search Results
export interface SearchResult {
name: string; // Movie/Series name
url: string; // Link to the movie page
image?: string; // Poster image
year?: string;
description?: string;
rating?: string;
}
export interface SearchResultWithSource extends SearchResult {
source: string; // Site ID
sourceName: string; // Site Name
}
// Bookmark Types
export interface Bookmark {
id: string;
title: string;
url: string;
image?: string;
siteId: string;
siteName: string;
createdAt: string;
metadata?: {
year?: string;
description?: string;
rating?: string;
};
}
// Active Tab Types
export interface ActiveTab {
id: string;
title: string;
url: string;
favicon?: string;
isActive: boolean;
createdAt: string;
}
// Version Check Types
export interface VersionInfo {
latestVersion: string;
updateAvailable: boolean;
downloadUrl: string;
changelog: string;
releaseDate: string;
mandatory: boolean;
}
// Proxy Types
export interface ProxyStatus {
isRunning: boolean;
port?: number;
error?: string;
}
// Settings Types
export interface AppSettings {
configServerUrl: string;
lastConfigUpdate?: string;
proxyAutoStart: boolean;
theme: 'light' | 'dark';
language: 'ru' | 'en';
downloadFolder?: string;
}
// IPC Channels
export enum IPC_CHANNELS {
// Config
GET_CONFIG = 'config:get',
UPDATE_CONFIG = 'config:update',
SAVE_CONFIG = 'config:save',
// Search
SEARCH_ALL_SITES = 'search:all',
SEARCH_SITE = 'search:site',
// Bookmarks
GET_BOOKMARKS = 'bookmarks:get',
ADD_BOOKMARK = 'bookmarks:add',
REMOVE_BOOKMARK = 'bookmarks:remove',
// Tabs
GET_TABS = 'tabs:get',
CREATE_TAB = 'tabs:create',
CLOSE_TAB = 'tabs:close',
ACTIVATE_TAB = 'tabs:activate',
HIDE_ACTIVE_TAB = 'tabs:hide',
// Proxy
GET_PROXY_STATUS = 'proxy:status',
START_PROXY = 'proxy:start',
STOP_PROXY = 'proxy:stop',
// Version
CHECK_VERSION = 'version:check',
DOWNLOAD_UPDATE = 'version:download',
// Settings
GET_SETTINGS = 'settings:get',
SAVE_SETTINGS = 'settings:save',
}