Compare commits

..

6 Commits

Author SHA1 Message Date
Nexmoe
840a432b7f chore: release v0.2.0 2025-10-25 11:30:03 +08:00
Nexmoe
cc17e29fbe chore: macos icon 2025-10-25 11:25:22 +08:00
Nexmoe
dd5f0a729b feat: test for mac 2025-10-25 11:06:40 +08:00
Nexmoe
9d72caee44 chore: release v0.1.8 2025-10-24 22:07:15 +08:00
Nexmoe
661165bd65 chore: add script to check yt-dlp binary existence for cross-platform builds 2025-10-24 22:06:59 +08:00
Nexmoe
e8cd89d7e4 chore: update release workflow to download yt-dlp binaries for Windows and Linux 2025-10-24 22:03:48 +08:00
9 changed files with 102 additions and 16 deletions

View File

@@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
os: [windows-latest, macos-latest]
steps:
- name: Check out Git repository
@@ -30,8 +30,18 @@ jobs:
- name: Install Dependencies
run: pnpm install
- name: Type check
run: pnpm run typecheck
- name: Download yt-dlp binaries
run: |
# Download yt-dlp.exe for Windows
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe -o resources/yt-dlp.exe
# Download yt-dlp for macOS (for cross-platform builds)
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos -o resources/yt-dlp_macos
chmod +x resources/yt-dlp_macos
# Download yt-dlp for Linux (for cross-platform builds)
# curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o resources/yt-dlp_linux
# chmod +x resources/yt-dlp_linux
- name: Lint and format check
run: pnpm run check
@@ -40,9 +50,9 @@ jobs:
# if: matrix.os == 'ubuntu-latest'
# run: pnpm run build:linux
# - name: build-mac
# if: matrix.os == 'macos-latest'
# run: pnpm run build:mac
- name: build-mac
if: matrix.os == 'macos-latest'
run: pnpm run build:mac
- name: build-win
if: matrix.os == 'windows-latest'

Binary file not shown.

BIN
icon.icns

Binary file not shown.

View File

@@ -1,6 +1,6 @@
{
"name": "vidbee",
"version": "0.1.7",
"version": "0.2.0",
"description": "A modern Electron application for downloading videos and audios",
"main": "./out/main/index.js",
"author": "VidBee",
@@ -15,9 +15,9 @@
"build": "pnpm run typecheck && electron-vite build",
"postinstall": "electron-builder install-app-deps",
"build:unpack": "pnpm run build && electron-builder --dir",
"build:win": "pnpm run build && electron-builder --win",
"build:mac": "pnpm run build && electron-builder --mac",
"build:linux": "pnpm run build && electron-builder --linux",
"build:win": "node scripts/check-ytdlp.js win && pnpm run build && electron-builder --win",
"build:mac": "node scripts/check-ytdlp.js mac && pnpm run build && electron-builder --mac",
"build:linux": "node scripts/check-ytdlp.js linux && pnpm run build && electron-builder --linux",
"release": "pnpm run check && bumpp"
},
"dependencies": {

BIN
resources/tray-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

48
scripts/check-ytdlp.js Normal file
View File

@@ -0,0 +1,48 @@
#!/usr/bin/env node
const fs = require('node:fs')
const path = require('node:path')
/**
* Check if yt-dlp binary exists in resources directory
* Usage: node scripts/check-ytdlp.js [platform]
* Platform options: win, mac, linux
* Exit with error code 1 if not found
*/
function checkYtDlpExists(platform) {
const platformMap = {
win: 'yt-dlp.exe',
mac: 'yt-dlp_macos',
linux: 'yt-dlp_linux'
}
const filename = platformMap[platform]
if (!filename) {
console.error('❌ Error: Invalid platform specified!')
console.error('Usage: node scripts/check-ytdlp.js [win|mac|linux]')
process.exit(1)
}
const ytdlpPath = path.join(__dirname, '..', 'resources', filename)
if (!fs.existsSync(ytdlpPath)) {
console.error(`❌ Error: resources/${filename} not found!`)
console.error(`Please download ${filename} to the resources/ directory first.`)
console.error('You can download it from: https://github.com/yt-dlp/yt-dlp/releases/latest')
process.exit(1)
}
console.log(`${filename} found in resources/ directory`)
}
// Get platform from command line arguments
const platform = process.argv[2]
if (!platform) {
console.error('❌ Error: Platform argument is required!')
console.error('Usage: node scripts/check-ytdlp.js [win|mac|linux]')
process.exit(1)
}
// Run the check
checkYtDlpExists(platform)

View File

@@ -1,5 +1,6 @@
import { app, BrowserWindow, Menu, nativeImage, Tray } from 'electron'
import appIcon from '../../resources/icon.png?asset'
import trayIcon from '../../resources/tray-icon.png?asset'
import { settingsManager } from './settings'
let tray: Tray | null = null
@@ -85,9 +86,17 @@ export function createTray(): void {
return
}
const trayIcon = nativeImage.createFromPath(appIcon)
// Use 16x16 icon for macOS tray, fallback to app icon for other platforms
const iconPath = process.platform === 'darwin' ? trayIcon : appIcon
const trayIconImage = nativeImage.createFromPath(iconPath)
tray = new Tray(trayIcon)
// For macOS, ensure the icon is properly sized
if (process.platform === 'darwin') {
// Resize to 16x16 for macOS tray
trayIconImage.setTemplateImage(true)
}
tray = new Tray(trayIconImage)
// Set tooltip
tray.setToolTip('VidBee')

View File

@@ -3,7 +3,8 @@ import { Sidebar } from '@renderer/components/ui/sidebar'
import { Toaster } from '@renderer/components/ui/sonner'
import { TitleBar } from '@renderer/components/ui/title-bar'
import { ThemeProvider } from 'next-themes'
import { useState } from 'react'
import { useEffect, useState } from 'react'
import { ipcServices } from './lib/ipc'
import { About } from './pages/About'
import { Home } from './pages/Home'
import { Settings } from './pages/Settings'
@@ -13,6 +14,22 @@ type Page = 'home' | 'settings' | 'about' | 'sites'
function AppContent() {
const [currentPage, setCurrentPage] = useState<Page>('home')
const [platform, setPlatform] = useState<string>('')
useEffect(() => {
// Get platform info to determine if we should show title bar
const getPlatform = async () => {
try {
const platformInfo = await ipcServices.app.getPlatform()
setPlatform(platformInfo)
} catch (error) {
console.error('Failed to get platform info:', error)
// Default to showing title bar if platform detection fails
setPlatform('unknown')
}
}
getPlatform()
}, [])
const renderPage = () => {
switch (currentPage) {
@@ -36,8 +53,8 @@ function AppContent() {
{/* Main Content */}
<main className="flex flex-col flex-1 min-h-0 overflow-hidden bg-background">
{/* Custom Title Bar */}
<TitleBar />
{/* Custom Title Bar - Hide on macOS */}
{platform !== 'darwin' && <TitleBar />}
<ScrollArea
className="flex-1 w-full overflow-y-auto overflow-x-hidden"

View File

@@ -20,7 +20,9 @@ import { settingsAtom } from '../../store/settings'
const generateFilePath = (downloadPath: string, title: string, format: string): string => {
const fileName = `${title}.${format}`
// Use proper path joining for cross-platform compatibility
return `${downloadPath}/${fileName}`.replace(/\//g, '\\')
// Handle both forward and backward slashes for cross-platform compatibility
const normalizedDownloadPath = downloadPath.replace(/\\/g, '/')
return `${normalizedDownloadPath}/${fileName}`
}
interface DownloadItemProps {