lots of progress on apple music integration

This commit is contained in:
2023-11-14 20:19:36 +01:00
parent 83303be8e9
commit 2b3af0de24
10 changed files with 119 additions and 54 deletions

View File

@@ -10,6 +10,7 @@ const indexer = require( './indexer.js' );
const axios = require( 'axios' );
const ip = require( 'ip' );
const jwt = require( 'jsonwebtoken' );
const shell = require( 'electron' ).shell;
app.use( bodyParser.urlencoded( { extended: false } ) );
@@ -64,6 +65,8 @@ let currentDetails = {
let connectedMain = {};
// TODO: Add backend integration
require( './appleMusicRoutes.js' )( app );
app.get( '/', ( request, response ) => {
response.sendFile( path.join( __dirname + '/client/showcase.html' ) );
} );
@@ -72,6 +75,11 @@ app.get( '/getLocalIP', ( req, res ) => {
res.send( ip.address() );
} );
app.get( '/useAppleMusic', ( req, res ) => {
shell.openExternal( 'http://localhost:8081/apple-music' );
res.send( 'ok' );
} );
app.get( '/openSongs', ( req, res ) => {
// res.send( '{ "data": [ "/home/janis/Music/KB2022" ] }' );
res.send( '{ "data": [ "/mnt/storage/SORTED/Music/audio/KB2022" ] }' );