mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-09 01:16:15 -08:00
Add comprehensive download functionality for Xtream and Stalker portals: Backend (Electron): - Add downloads table schema with foreign key to playlists - Create downloads.events.ts with IPC handlers for download operations - Support download start, cancel, retry, remove, and status queries - Auto-create playlist entries for Stalker portals to satisfy FK constraints - Add download folder selection and file reveal/play functionality Frontend (Angular): - Create DownloadsService with reactive signal-based state management - Add DownloadsComponent with queue management UI - Implement download buttons with three states: download, downloading, play local - Support both Xtream and Stalker modes with proper playlist ID handling - Add download progress indicators and status badges UI Components: - Update VodDetailsComponent with download/play-local buttons - Update SeasonContainerComponent with episode download buttons - Add navigation link to downloads page - Style download buttons and progress indicators Stalker Portal Support: - Resolve stream URLs via fetchLinkToPlay API before downloading - Handle both vod-series and regular-series episode types - Use playlist._id for Stalker (vs portalId for Xtream) - Pass playlist info for auto-creation in database Translations: - Add download-related strings for en, de, es, fr Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Database
Shared database library for IPTVnator providing Drizzle ORM schema and connection utilities.
Usage
// Full access (electron-backend)
import { getDatabase, initDatabase } from 'database';
// Read-only access (agent-backend)
import { getReadOnlyDatabase } from 'database';
// Schema and types
import { content, categories, playlists, type Content } from 'database';
Exports
Schema (schema.ts)
- Tables:
playlists,categories,content,recentlyViewed,favorites - Types:
Playlist,Category,Content,RecentlyViewed,Favorite(andNew*variants)
Connection (connection.ts)
getDatabase(options?)- Full read-write accessgetReadOnlyDatabase()- Read-only access for agent queriesinitDatabase(options?)- Initialize with custom optionscloseDatabase()- Close connectiongetDatabasePath()- Get database file path
Database Location
The SQLite database is stored at: ~/.iptvnator/databases/iptvnator.db