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$VtiGONn`LF}N`> cFmf<3FmO%I6Fah*UE&+dW)4vy+S_#y0Lf`dp8x;= delta 175 zcmZp1XmOa}&&a9tn1A{D-hEj|vo4JHnGqSS$|IffMSzb(I^CJ;m t#>wx+yto*H7#J8i7#JAXCOeBCnb>f3GrPn$mdQQ>t0vD8Eyk+k5&-)XCQtwX diff --git a/app/.DS_Store b/app/.DS_Store index ac01df1445ea500babb46a57e2b6a555d4c6409f..8a91b0dbae1f1017011ec1b882addc55ecba8cf3 100644 GIT binary patch delta 973 zcmZp1XbF&DU|?W$DortDU{GLSVBlbY&;mRY3&ketDKg4!4A{-jC^wl$;58%1<{tui zj4BKa4DA2^Gk^dOLmopuLkdGGLp(z+m{rPG^C_g7B zAip@XBr`uRG6rmYNouZVURr*x( zV{;OdQgi(CobpRb@^d3Hlk@X}Gpka;b_N$DCTHfQE8Bkn1w8`;r?P_vgeAbB3}G-Z zC_7Af0A_OtFoxvi=cRHgI|MK=Fw`@E4w3{`MCuk<2bIVf1mtc zM1wCk-^C@Rv?Q5<;kw!xbyn)T?9 delta 138 zcmZn(XmOBWU|?W$DortDU;r^W7$CF&_ryZ6iF%5R;u`~Y^D~N1<`HoRQOwfq^N4fq{W-^Ix$@#?5Au510g*8Nfh-n}LDBm4QKkdt>2u=E?jj cfgFqs3?M5QCdczkV>~vQQCwrQndDt20JS_IW&i*H 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でアルバムアートワークを添付する