Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
840a432b7f | ||
|
|
cc17e29fbe | ||
|
|
dd5f0a729b |
16
.github/workflows/release.yml
vendored
16
.github/workflows/release.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest]
|
os: [windows-latest, macos-latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out Git repository
|
- name: Check out Git repository
|
||||||
@@ -36,12 +36,12 @@ jobs:
|
|||||||
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe -o resources/yt-dlp.exe
|
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)
|
# 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
|
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
|
chmod +x resources/yt-dlp_macos
|
||||||
|
|
||||||
# Download yt-dlp for Linux (for cross-platform builds)
|
# 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
|
# 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
|
# chmod +x resources/yt-dlp_linux
|
||||||
|
|
||||||
- name: Lint and format check
|
- name: Lint and format check
|
||||||
run: pnpm run check
|
run: pnpm run check
|
||||||
@@ -50,9 +50,9 @@ jobs:
|
|||||||
# if: matrix.os == 'ubuntu-latest'
|
# if: matrix.os == 'ubuntu-latest'
|
||||||
# run: pnpm run build:linux
|
# run: pnpm run build:linux
|
||||||
|
|
||||||
# - name: build-mac
|
- name: build-mac
|
||||||
# if: matrix.os == 'macos-latest'
|
if: matrix.os == 'macos-latest'
|
||||||
# run: pnpm run build:mac
|
run: pnpm run build:mac
|
||||||
|
|
||||||
- name: build-win
|
- name: build-win
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
|
|||||||
BIN
build/icon.icns
BIN
build/icon.icns
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vidbee",
|
"name": "vidbee",
|
||||||
"version": "0.1.8",
|
"version": "0.2.0",
|
||||||
"description": "A modern Electron application for downloading videos and audios",
|
"description": "A modern Electron application for downloading videos and audios",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "VidBee",
|
"author": "VidBee",
|
||||||
|
|||||||
BIN
resources/tray-icon.png
Normal file
BIN
resources/tray-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 924 B |
@@ -1,5 +1,6 @@
|
|||||||
import { app, BrowserWindow, Menu, nativeImage, Tray } from 'electron'
|
import { app, BrowserWindow, Menu, nativeImage, Tray } from 'electron'
|
||||||
import appIcon from '../../resources/icon.png?asset'
|
import appIcon from '../../resources/icon.png?asset'
|
||||||
|
import trayIcon from '../../resources/tray-icon.png?asset'
|
||||||
import { settingsManager } from './settings'
|
import { settingsManager } from './settings'
|
||||||
|
|
||||||
let tray: Tray | null = null
|
let tray: Tray | null = null
|
||||||
@@ -85,9 +86,17 @@ export function createTray(): void {
|
|||||||
return
|
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
|
// Set tooltip
|
||||||
tray.setToolTip('VidBee')
|
tray.setToolTip('VidBee')
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import { Sidebar } from '@renderer/components/ui/sidebar'
|
|||||||
import { Toaster } from '@renderer/components/ui/sonner'
|
import { Toaster } from '@renderer/components/ui/sonner'
|
||||||
import { TitleBar } from '@renderer/components/ui/title-bar'
|
import { TitleBar } from '@renderer/components/ui/title-bar'
|
||||||
import { ThemeProvider } from 'next-themes'
|
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 { About } from './pages/About'
|
||||||
import { Home } from './pages/Home'
|
import { Home } from './pages/Home'
|
||||||
import { Settings } from './pages/Settings'
|
import { Settings } from './pages/Settings'
|
||||||
@@ -13,6 +14,22 @@ type Page = 'home' | 'settings' | 'about' | 'sites'
|
|||||||
|
|
||||||
function AppContent() {
|
function AppContent() {
|
||||||
const [currentPage, setCurrentPage] = useState<Page>('home')
|
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 = () => {
|
const renderPage = () => {
|
||||||
switch (currentPage) {
|
switch (currentPage) {
|
||||||
@@ -36,8 +53,8 @@ function AppContent() {
|
|||||||
|
|
||||||
{/* Main Content */}
|
{/* Main Content */}
|
||||||
<main className="flex flex-col flex-1 min-h-0 overflow-hidden bg-background">
|
<main className="flex flex-col flex-1 min-h-0 overflow-hidden bg-background">
|
||||||
{/* Custom Title Bar */}
|
{/* Custom Title Bar - Hide on macOS */}
|
||||||
<TitleBar />
|
{platform !== 'darwin' && <TitleBar />}
|
||||||
|
|
||||||
<ScrollArea
|
<ScrollArea
|
||||||
className="flex-1 w-full overflow-y-auto overflow-x-hidden"
|
className="flex-1 w-full overflow-y-auto overflow-x-hidden"
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ import { settingsAtom } from '../../store/settings'
|
|||||||
const generateFilePath = (downloadPath: string, title: string, format: string): string => {
|
const generateFilePath = (downloadPath: string, title: string, format: string): string => {
|
||||||
const fileName = `${title}.${format}`
|
const fileName = `${title}.${format}`
|
||||||
// Use proper path joining for cross-platform compatibility
|
// 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 {
|
interface DownloadItemProps {
|
||||||
|
|||||||
Reference in New Issue
Block a user