Skip to content

Commit

Permalink
working on the new cool thing
Browse files Browse the repository at this point in the history
  • Loading branch information
jbilcke-hf committed Jul 21, 2024
1 parent 3138404 commit 7702570
Show file tree
Hide file tree
Showing 11 changed files with 820 additions and 509 deletions.
6 changes: 3 additions & 3 deletions forge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
packagerConfig: {
name: "Clapper",
asar: true,
icon: "./public/logos/CL.png",
icon: "./public/images/logos/CL.png",
osxSign: {},

// One or more files to be copied directly into the app's
Expand Down Expand Up @@ -62,15 +62,15 @@ module.exports = {
name: '@electron-forge/maker-deb',
config: {
options: {
icon: './public/logos/CL.png'
icon: './public/images/logos/CL.png'
}
},
},
{
name: '@electron-forge/maker-dmg',
config: {
options: {
icon: './public/logos/CL.icns'
icon: './public/images/logos/CL.icns'
}
},
},
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
},
"scripts": {
"dev": "npm i && npm run checks && next dev",
"build": "npm i && npm run checks && rm -Rf out && next build && npm run build:copyassets",
"build": "npm i && npm run prepare && npm run checks && rm -Rf out && next build && npm run build:copyassets",
"build:ci": "rm -Rf out && npm run prepare && next build && npm run build:copyassets",
"build:copyassets": "cp -R public .next/standalone/public && cp -R .next/static .next/standalone/.next/static",
"build:ci": "rm -Rf out && next build && npm run build:copyassets",
"prepare": "cp -R node_modules/mediainfo.js/dist/MediaInfoModule.wasm public/wasm/",
"start": "next start",
"start:prod": "node .next/standalone/server.js",
"checks": "npm run format:fix && npm run lint",
Expand Down
Binary file added public/wasm/MediaInfoModule.wasm
Binary file not shown.
12 changes: 12 additions & 0 deletions src/lib/utils/base64DataUriToFile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export function base64DataUriToFile(dataUrl: string, fileName: string) {
var arr = dataUrl.split(',')
const st = `${arr[0] || ''}`
const mime = `${st.match(/:(.*?);/)?.[1] || ''}`
const bstr = atob(arr[arr.length - 1])
let n = bstr.length
const u8arr = new Uint8Array(n)
while(n--){
u8arr[n] = bstr.charCodeAt(n);
}
return new File([u8arr], fileName, {type:mime});
}
Loading

0 comments on commit 7702570

Please sign in to comment.