summaryrefslogtreecommitdiff
path: root/nowplaying/playing.js
diff options
context:
space:
mode:
authornavewindre <boneyaard@gmail.com>2024-11-23 20:40:33 +0100
committernavewindre <boneyaard@gmail.com>2024-11-23 20:40:33 +0100
commit2dfbb5b499cd809f936da74b7c9d9ee6a8809808 (patch)
tree49cb7e9361726cdf7264e7f478575406e034fe1e /nowplaying/playing.js
parentd00967dd8bca3881a64cb0bf156bf4de276ac3ee (diff)
sda
Diffstat (limited to 'nowplaying/playing.js')
-rwxr-xr-xnowplaying/playing.js19
1 files changed, 5 insertions, 14 deletions
diff --git a/nowplaying/playing.js b/nowplaying/playing.js
index cef25fb..e7a50b9 100755
--- a/nowplaying/playing.js
+++ b/nowplaying/playing.js
@@ -2,13 +2,8 @@
const WebSocket = require( "ws" );
-process.on( "uncaughtException", () => {
- console.log();
-} );
-
-process.on( "unhandledRejection", () => {
- console.log();
-} );
+process.on( "uncaughtException", () => { console.log(); } );
+process.on( "unhandledRejection", () => { console.log(); } );
let ws = null;
let idc = 1;
@@ -46,10 +41,8 @@ const setupws = () => {
ret += ' - ';
}
- const homedir = require( "os" ).homedir();
- if( title.startsWith( homedir ) ) {
- const path = title.substring( homedir.length + 1 );
- const file = path.split( "/" ).pop();
+ if( title.startsWith( '/' ) ) {
+ const file = title.split( "/" ).pop();
ret += file;
}
else ret += title;
@@ -73,6 +66,4 @@ const sendreq = () => {
ws.send( JSON.stringify( obj ) );
}
-try {
- setupws();
-} catch ( e ) {}
+setupws();