mirror of
https://github.com/janishutz/MusicPlayerV2.git
synced 2025-11-25 13:04:23 +00:00
fix polyfills
This commit is contained in:
1390
MusicPlayerV2-GUI/package-lock.json
generated
1390
MusicPlayerV2-GUI/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,6 @@
|
|||||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
|
|
||||||
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
||||||
"@jridgewell/sourcemap-codec": "^1.4.15",
|
"@jridgewell/sourcemap-codec": "^1.4.15",
|
||||||
"@melloware/coloris": "^0.24.0",
|
"@melloware/coloris": "^0.24.0",
|
||||||
@@ -23,6 +22,7 @@
|
|||||||
"musickit-typescript": "^1.2.4",
|
"musickit-typescript": "^1.2.4",
|
||||||
"pinia": "^2.1.7",
|
"pinia": "^2.1.7",
|
||||||
"socket.io-client": "^4.7.5",
|
"socket.io-client": "^4.7.5",
|
||||||
|
"vite-plugin-node-polyfills": "^0.22.0",
|
||||||
"vue": "^3.4.15",
|
"vue": "^3.4.15",
|
||||||
"vue-router": "^4.2.5"
|
"vue-router": "^4.2.5"
|
||||||
},
|
},
|
||||||
@@ -38,6 +38,6 @@
|
|||||||
"npm-run-all2": "^6.1.1",
|
"npm-run-all2": "^6.1.1",
|
||||||
"typescript": "~5.3.0",
|
"typescript": "~5.3.0",
|
||||||
"vite": "^5.0.11",
|
"vite": "^5.0.11",
|
||||||
"vue-tsc": "^1.8.27"
|
"vue-tsc": "^2.0.29"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -315,6 +315,7 @@
|
|||||||
if ( res.status === 200 ) {
|
if ( res.status === 200 ) {
|
||||||
res.blob().then( blob => {
|
res.blob().then( blob => {
|
||||||
parseBlob( blob ).then( data => {
|
parseBlob( blob ).then( data => {
|
||||||
|
try {
|
||||||
player.findSongOnAppleMusic( data.common.title ?? songDetails.filename.split( '.' )[ 0 ] ).then( d => {
|
player.findSongOnAppleMusic( data.common.title ?? songDetails.filename.split( '.' )[ 0 ] ).then( d => {
|
||||||
let url = d.data.results.songs.data[ 0 ].attributes.artwork.url;
|
let url = d.data.results.songs.data[ 0 ].attributes.artwork.url;
|
||||||
url = url.replace( '{w}', String( d.data.results.songs.data[ 0 ].attributes.artwork.width ) );
|
url = url.replace( '{w}', String( d.data.results.songs.data[ 0 ].attributes.artwork.width ) );
|
||||||
@@ -329,16 +330,38 @@
|
|||||||
}
|
}
|
||||||
resolve( song );
|
resolve( song );
|
||||||
} ).catch( e => {
|
} ).catch( e => {
|
||||||
reject( e );
|
console.error( e );
|
||||||
} );
|
const song: Song = {
|
||||||
} ).catch( e => {
|
artist: data.common.artist ?? 'Unknown artist',
|
||||||
reject( e );
|
title: data.common.title ?? 'Unknown song title',
|
||||||
} );
|
duration: data.format.duration ?? 1000,
|
||||||
} ).catch( e => {
|
id: songDetails.url,
|
||||||
reject( e );
|
origin: 'disk',
|
||||||
|
cover: ''
|
||||||
|
}
|
||||||
|
resolve( song );
|
||||||
} );
|
} );
|
||||||
|
} catch ( err ) {
|
||||||
|
console.error( err );
|
||||||
|
alert( 'One of your songs was not loadable. (finalization-error)' )
|
||||||
}
|
}
|
||||||
} ).catch( e => {
|
} ).catch( e => {
|
||||||
|
console.error( e );
|
||||||
|
alert( 'One of your songs was not loadable. (parser-error)' );
|
||||||
|
reject( e );
|
||||||
|
} );
|
||||||
|
} ).catch( e => {
|
||||||
|
console.error( e );
|
||||||
|
alert( 'One of your songs was not loadable. (converter-error)' );
|
||||||
|
reject( e );
|
||||||
|
} );
|
||||||
|
} else {
|
||||||
|
console.error( res.status );
|
||||||
|
alert( 'One of your songs was not loadable. (invalid-response-code)' );
|
||||||
|
}
|
||||||
|
} ).catch( e => {
|
||||||
|
console.error( e );
|
||||||
|
alert( 'One of your songs was not loadable. (could-not-connect)' );
|
||||||
reject( e );
|
reject( e );
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
|||||||
@@ -2,30 +2,19 @@ import { fileURLToPath, URL } from 'node:url'
|
|||||||
|
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
|
import { nodePolyfills } from 'vite-plugin-node-polyfills'
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
|
nodePolyfills(),
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
optimizeDeps: {
|
|
||||||
esbuildOptions: {
|
|
||||||
define: {
|
|
||||||
global: 'globalThis',
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
NodeGlobalsPolyfillPlugin({
|
|
||||||
buffer: true,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
server: {
|
server: {
|
||||||
port: 8081
|
port: 8081
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user