diff --git a/common/lkt.js b/common/lkt.js index 6783ba8790ac495ee7ef692b11abddf2c5e6b7d7..515a33c9476fff4c17572dff1763c6d67848fd3e 100644 --- a/common/lkt.js +++ b/common/lkt.js @@ -362,11 +362,11 @@ class LktClient { } static commandQueueDelPos(position) { - return LktClient.__execSimple(`del ${position}`); + return LktClient.__execSimple(`delete ${position}`); } static commandQueueDelId(id) { - return LktClient.__execSimple(`delid ${id}`); + return LktClient.__execSimple(`deleteid ${id}`); } static commandPlaylistAddId(playlist, id) { @@ -391,11 +391,15 @@ class LktClient { static commandPlaylistDelete(playlist) { return LktClient.__execSimple(`playlistdelete ${playlist}`); } + static commandUpdateDatabase() { + return LktClient.__execSimple(`password hashire\nupdate`) + } static commandQueueAddMulId(IdList) { var command; var promize = new Promise(()=>null); - var size = 10; var arrayOfArrays = []; + var size = 4; + var arrayOfArrays = []; for (var i=0; i<IdList.length; i+=size) { arrayOfArrays.push(IdList.slice(i,i+size)); } @@ -405,7 +409,7 @@ class LktClient { idbatch.forEach(id => { command = command + " " + id; }); - promize = promize.then(LktClient.__execSimple(command)); + promize = promize.then(resolve => setTimeout(resolve, 200)).then(LktClient.__execSimple(command)); } }); return null; diff --git a/instance/index.js b/instance/index.js index e04546c661ba11feeab7a46e650e370399d6497b..bbb10aeb51cb471e8b9a8e650a719dad8384f4ba 100644 --- a/instance/index.js +++ b/instance/index.js @@ -98,12 +98,13 @@ window.onload = () => { addIpcToButton('selectAdvence', ['select-advence']); addIpcToButton('selectDatabase', ['select-database', 'reload-db-request']); addIpcToButton('selectPlaylist', ['select-playlist']); - addIpcToButton('selectPool', ['select-pool']); + addIpcToButton('updateDB', ['update-database']); addIpcToButton('open-kurisu-view', ['toggle-kurisu']); addIpcToButton('open-user-view', ['toggle-client-view']); addIpcToButton('open-log-view', ['toggle-log-view']); addIpcToButton('newPlaylist',['new-playlist']); + var switchQP = document.getElementById('switchQueuePlaylist'); switchQP.innerText = "View playlist"; diff --git a/instance/views/menubar.ejs b/instance/views/menubar.ejs index e29c320c4ae0d83f3f65280a3d71fc50e491050a..242e6c7acfd382f9ce9a91a423badeeaba3b01db 100644 --- a/instance/views/menubar.ejs +++ b/instance/views/menubar.ejs @@ -10,7 +10,7 @@ {id: 'selectAdvence', tooltip: 'Advence search', name: 'search'}, {id: 'selectDatabase', tooltip: 'Database search', name: 'database'}, {id: 'selectPlaylist', tooltip: 'Playlist search', name: 'tag'}, - {id: 'selectPool', tooltip: "Kurisu's pool search", name: 'bookmark'}, + {id: 'updateDB', tooltip: "Update kara Database", name: 'arrow-circle-down'}, {id: 'addResearchToQueue', tooltip: "Add research result to queue", name: 'upload'}, ]}); %></div> <div class="p-1 bd-highlight mb-1 mr-auto ml-auto" style="width: 40%;-webkit-app-region: no-drag;"> diff --git a/main.js b/main.js index fa7219a8ffa32299ba9a5836bfcc66db4452ca52..5b4868f182c7c9a73b89f792de6759e256d9935a 100644 --- a/main.js +++ b/main.js @@ -226,6 +226,7 @@ ipcMain.on('cmd-unpause', () => lkt.commandUnpause().then(arg => logger.debug('m ipcMain.on('cmd-shuffle', () => lkt.commandShuffle().then(arg => logger.debug('main', 'Returned from cmd-shuffle'))); ipcMain.on('cmd-stop', () => lkt.commandStop().then(arg => logger.debug('main', 'Returned from cmd-stop'))); ipcMain.on('cmd-clear', () => lkt.commandClear().then(arg => logger.debug('main', 'Cleared queue with cmd-clear'))); +ipcMain.on('update-database',()=>lkt.commandUpdateDatabase()); /* Fill the pannel with the content of the DB. * The `arg` is the HTML object of the pannel */