From dd5f0a729b5efb9f43cd70b9907f2aa6930c036c Mon Sep 17 00:00:00 2001 From: Nexmoe <16796652+nexmoe@users.noreply.github.com> Date: Sat, 25 Oct 2025 11:06:40 +0800 Subject: [PATCH] feat: test for mac --- .github/workflows/release.yml | 10 ++++---- resources/tray-icon.png | Bin 0 -> 924 bytes src/main/tray.ts | 13 ++++++++-- src/renderer/src/App.tsx | 23 +++++++++++++++--- .../src/components/download/DownloadItem.tsx | 4 ++- 5 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 resources/tray-icon.png diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f56fa59..1fa01d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: - os: [windows-latest] + os: [windows-latest, macos-latest] steps: - 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 # 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 + 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 + # 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 diff --git a/resources/tray-icon.png b/resources/tray-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..37802ebf87f6fa3a5434f2a8ba945c7e6ab3b45c GIT binary patch literal 924 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBC{d9b;hE;^%b*2hb1<+l zN-=;;U<6`2MrkhpAQ46zUl4Ytk>aTKxpyyN>j=gn#= zt^HbBO*>q+TyQeb$lyBY+Tkm3CFCc2RK(3F*Q3{*1U6;y+*+}qcR}lVFN0Q&rtBDx zMX&ANC8zy4m-9}D-?}>eo#p-Vb3f0;IL=K_}nMOaI4hW0bee9>qyQ@pW z!tSMgxF6>h#Br$K=bMh;^9Tra8GI7r1f5uB$6u)gQ*v2-; zqOERqz12!~mR0Lzrq7ptAL)Km{PK3QkZZrAZOd)0OCHUgrqljyKI0Z=rTGfR*Iqw< zyjJ+k&t;d5E6W|En&xwJ!`Z2{Gcn}(bG~@MO|c{|20Ra6Sg@!}ds5@(E!`%KsDrq?1O54)6~UHUdtz1;F#_ycpsy)RU5`tNhN0d6QsU>a_dP=dLUwcJL*_%U) z-TVwP6ze~h)fI&YwyPU('home') + const [platform, setPlatform] = useState('') + + 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 */}
- {/* Custom Title Bar */} - + {/* Custom Title Bar - Hide on macOS */} + {platform !== 'darwin' && } { 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 {