From a8e0133edbd6ccd2a727750eeb1ea8ec4e515f80 Mon Sep 17 00:00:00 2001 From: Cutls P Date: Tue, 12 Jun 2018 01:41:11 +0900 Subject: [PATCH] TheDesk Mio (15.6.0) macOS --- .DS_Store | Bin 8196 -> 8196 bytes app/.DS_Store | Bin 8196 -> 10244 bytes app/js/ui/spotify.js | 10 +++++++++- app/main.js | 2 +- .../itunes-nowplaying-mac/dist/itunes.js | 1 + app/setting.html | 2 +- 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.DS_Store b/.DS_Store index 8a014b9f622998ec70b89a141ade5d0a42e92999..efa4e3a330b440538e5f2af179e63da7b1d3a788 100644 GIT binary patch delta 310 zcmZp1XmOa}&nUbxU^hRb@MInVMMloedIB1ZjGHHi3o3Dnii(MgN=QmcZf+8kWt_Z1 z$Vtgnv3~6gDjMWQj95^xrA3Uva2BN1K3 r$?wIyxEO;N7#KN#>ewbbiyxWTaCI}g#5b17J_4&I&k-%gs^k&?`x7Qm diff --git a/app/.DS_Store b/app/.DS_Store index ac01df1445ea500babb46a57e2b6a555d4c6409f..8a91b0dbae1f1017011ec1b882addc55ecba8cf3 100644 GIT binary patch delta 973 zcmcgr&rcIU6n?K&+e*uBe<4O7XpNu{Q&gfiYsC=Mq%9@d2DE8+r_09e%(A-$;ZhD< zJ&-l=YT_SYnw|`aiFZTvqDM(MdeMWyc&W47CMc*!4>R-4_rCYu%$qkGsf}zu0ARW< zPXG*a=;y;(#o*>r-{!^BIMmE;2{>d2#n0$(eHSU7I&1ZlhP+%YfffCeQR0oak zO#4UlmH*PUHr@EERF#(XipDDZ9Iq?7rkYkV`AHPf<2`cpn9mRLgAh8e7^IRA%{J-Zzn?X9t?DYB<=fj_x_2`cP delta 138 zcmZn(XmOBWU|?W$DortDU;r^WfEYvza8E20o2aMAD84aZH$S8JWFCRnjEtLq2;?zx z{09RDhRt(D!x=f<7#Nr$fI8SV{}qd5+-xTKfJu-U$Oi%mZXn?bGHhevcjn3bDuEn~ W5Gxoa$MZ~MJT{q8Tmz`%E)xK?JRoKO diff --git a/app/js/ui/spotify.js b/app/js/ui/spotify.js index f798529f..ae447527 100644 --- a/app/js/ui/spotify.js +++ b/app/js/ui/spotify.js @@ -104,6 +104,10 @@ function nowplaying(mode){ content = content.replace(regExp, ""); var regExp = new RegExp("{hz}", "g"); content = content.replace(regExp, ""); + var regExp = new RegExp("{bitRate}", "g"); + content = content.replace(regExp, ""); + var regExp = new RegExp("{genre}", "g"); + content = content.replace(regExp, ""); $("#textarea").val(content); }); }else{ @@ -122,7 +126,7 @@ function nowplaying(mode){ var regExp = new RegExp("{song}", "g"); content = content.replace(regExp, arg.name); var regExp = new RegExp("{album}", "g"); - content = content.replace(regExp, arg.album.name); + content = content.replace(regExp, arg.album); var regExp = new RegExp("{artist}", "g"); content = content.replace(regExp, arg.artist); var regExp = new RegExp("{url}", "g"); @@ -131,6 +135,10 @@ function nowplaying(mode){ content = content.replace(regExp, arg.composer); var regExp = new RegExp("{hz}", "g"); content = content.replace(regExp, arg.sampleRate/1000+"kHz"); + var regExp = new RegExp("{bitRate}", "g"); + content = content.replace(regExp, arg.bitRate+"kbps"); + var regExp = new RegExp("{genre}", "g"); + content = content.replace(regExp, arg.genre); $("#textarea").val(content); }) } diff --git a/app/main.js b/app/main.js index f7954c7d..672eac94 100644 --- a/app/main.js +++ b/app/main.js @@ -401,7 +401,7 @@ ipc.on('itunes', (e, args) => { if(platform=="darwin"){ const nowplaying = require("itunes-nowplaying-mac") -nowplaying().then(function (value) { +nowplaying.getRawData().then(function (value) { mainWindow.webContents.send('itunes-np', value); }).catch(function (error) { // 非同期処理失敗。呼ばれない diff --git a/app/node_modules/itunes-nowplaying-mac/dist/itunes.js b/app/node_modules/itunes-nowplaying-mac/dist/itunes.js index b2f799a5..4499bf88 100644 --- a/app/node_modules/itunes-nowplaying-mac/dist/itunes.js +++ b/app/node_modules/itunes-nowplaying-mac/dist/itunes.js @@ -1,6 +1,7 @@ "use strict"; var itunes = Application("iTunes"); var track = itunes.currentTrack; + function run(argv) { var state = itunes.playerState() if (state != "playing" && state != "paused") { diff --git a/app/setting.html b/app/setting.html index d8f1b1af..5e47b9ec 100644 --- a/app/setting.html +++ b/app/setting.html @@ -244,7 +244,7 @@
テンプレート:{song}:曲名/{album}:アルバム名/{artist}:アーティスト名/{url}:各曲のSpotifyのURL
- iTunes NowPlayingでも{url}以外のテンプレートに従ってトゥートされます。また、作曲家{composer}/サンプルレート{hz}が有効です。
+ iTunes NowPlayingでも{url}以外のテンプレートに従ってトゥートされます。また、作曲家{composer}/サンプルレート{hz}/ビットレート{bitRate}/ジャンル{genre}が有効です。
Spotifyでアルバムアートワークを添付する