}, {
"attribute" : "全タイプ",
"name" : "EVERLASTING",
- "difficulty" : "MASTER+",
+ "difficulty" : "ⓁMASTER+",
"level" : 30,
"notes" : 939,
- "albumType" : "Not-implemented"
+ "albumType" : "ALBUM A"
}, {
"attribute" : "全タイプ",
"name" : "秋風に手を振って",
}, {
"attribute" : "パッション",
"name" : "トロピカルガール",
- "difficulty" : "MASTER+",
- "level" : 29,
- "notes" : 988,
- "albumType" : "Not-implemented"
- }, {
- "attribute" : "パッション",
- "name" : "スパイスパラダイス",
- "difficulty" : "WITCH",
- "level" : 27,
- "notes" : 566,
- "albumType" : "Not-Implemented"
- }, {
- "attribute" : "パッション",
- "name" : "トロピカルガール",
- "difficulty" : "DEBUT",
- "level" : 8,
- "notes" : 104,
- "albumType" : "Not-Implemented"
- }, {
- "attribute" : "パッション",
- "name" : "トロピカルガール",
- "difficulty" : "REGULAR",
- "level" : 14,
- "notes" : 203,
- "albumType" : "Not-Implemented"
- }, {
- "attribute" : "パッション",
- "name" : "トロピカルガール",
- "difficulty" : "PRO",
- "level" : 18,
- "notes" : 408,
- "albumType" : "Not-Implemented"
- }, {
- "attribute" : "パッション",
- "name" : "トロピカルガール",
- "difficulty" : "MASTER",
- "level" : 26,
- "notes" : 694,
- "albumType" : "Not-Implemented"
- }, {
- "attribute" : "パッション",
- "name" : "トロピカルガール",
- "difficulty" : "MASTER+",
+ "difficulty" : "ⓁMASTER+",
"level" : 29,
"notes" : 988,
- "albumType" : "Not-implemented"
+ "albumType" : "ALBUM C"
}, {
"attribute" : "クール",
"name" : "あこがれステッチ",
"level" : 30,
"notes" : 997,
"albumType" : "Not-implemented"
+ }, {
+ "attribute" : "パッション",
+ "name" : "トロピカルガール",
+ "difficulty" : "MASTER+",
+ "level" : 29,
+ "notes" : 988,
+ "albumType" : "ALBUM C"
+ }, {
+ "attribute" : "パッション",
+ "name" : "青空リレーション",
+ "difficulty" : "MASTER+",
+ "level" : 28,
+ "notes" : 919,
+ "albumType" : "ALBUM C"
+ }, {
+ "attribute" : "クール",
+ "name" : "#HE4DSHOT",
+ "difficulty" : "LIGHT",
+ "level" : 8,
+ "notes" : 184,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "クール",
+ "name" : "#HE4DSHOT",
+ "difficulty" : "TRICK",
+ "level" : 17,
+ "notes" : 381,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "パッション",
+ "name" : "Twin☆くるっ★テール",
+ "difficulty" : "LIGHT",
+ "level" : 7,
+ "notes" : 157,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "パッション",
+ "name" : "Twin☆くるっ★テール",
+ "difficulty" : "TRICK",
+ "level" : 16,
+ "notes" : 359,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "クール",
+ "name" : "ストリート・ランウェイ",
+ "difficulty" : "DEBUT",
+ "level" : 7,
+ "notes" : 115,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "クール",
+ "name" : "ストリート・ランウェイ",
+ "difficulty" : "REGULAR",
+ "level" : 13,
+ "notes" : 236,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "クール",
+ "name" : "ストリート・ランウェイ",
+ "difficulty" : "PRO",
+ "level" : 18,
+ "notes" : 465,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "クール",
+ "name" : "ストリート・ランウェイ",
+ "difficulty" : "MASTER",
+ "level" : 27,
+ "notes" : 802,
+ "albumType" : "Not-Implemented"
+ }, {
+ "attribute" : "クール",
+ "name" : "ストリート・ランウェイ",
+ "difficulty" : "MASTER+",
+ "level" : 30,
+ "notes" : 999,
+ "albumType" : "Not-implemented"
+ }, {
+ "attribute" : "全タイプ",
+ "name" : "EVERLASTING",
+ "difficulty" : "MASTER+",
+ "level" : 30,
+ "notes" : 941,
+ "albumType" : "ALBUM A"
+ }, {
+ "attribute" : "キュート",
+ "name" : "cherry*merry*cherry",
+ "difficulty" : "MASTER+",
+ "level" : 28,
+ "notes" : 914,
+ "albumType" : "ALBUM A"
} ]
}
\ No newline at end of file
List<JsonNode> listFutures = new ArrayList<>();
final AtomicInteger n = new AtomicInteger(0);
for(String songname : Arrays.asList(songnames)) {
- DelesteRandomSelector.progressTool.setValue(n.incrementAndGet());
DelesteRandomSelector.labelInfoProgressSongName.setText("<html><body>Processing : " + songname + "</body></html>");
Map<String, Object> data = fetchList(songname);
if(data.getOrDefault("error", "false").equals("true")) {
.addParameter(Music_Params.ID , String.valueOf(taxId))
.build();
logger.info("fetch data : {}", taxId);
+
try {
listFutures.add(impl.get());
} catch (NoSuchURIException | IOException | InterruptedException e) {
logger.error("Exception while processing json.", e);
+ } finally {
+ DelesteRandomSelector.progressTool.setValue(n.incrementAndGet());
}
}
DelesteRandomSelector.labelInfoProgressSongName.setText("");
LinkedHashMap<String, String> result = new LinkedHashMap<>();
result.put("songname", node.get("name").asText());
result.put("link", node.get("link").asText());
- String lyric = "",
- composer = "",
- arrange = "";
TypeReference<List<Map<String, Object>>> typeRef = new TypeReference<List<Map<String,Object>>>() {};
ObjectMapper mapper = new ObjectMapper();
List<Map<String, Object>> lyricList = mapper.readValue(node.get("lyrics").traverse(), typeRef),
composerList = mapper.readValue(node.get("composer").traverse(), typeRef),
arrangeList = mapper.readValue(node.get("arrange").traverse(), typeRef);
- List<CompletableFuture<String>> nameArraySupplyFutures = List.of(
- CompletableFuture.supplyAsync(() -> getArrayedNames(lyricList), localDispatcher),
- CompletableFuture.supplyAsync(() -> getArrayedNames(composerList), localDispatcher),
- CompletableFuture.supplyAsync(() -> getArrayedNames(arrangeList), localDispatcher)
+ List<CompletableFuture<Void>> nameArraySupplyFutures = List.of(
+ CompletableFuture.supplyAsync(() -> getArrayedNames(lyricList), localDispatcher).thenAcceptAsync(str -> result.put("lyric", str), localDispatcher),
+ CompletableFuture.supplyAsync(() -> getArrayedNames(composerList), localDispatcher).thenAcceptAsync(str -> result.put("composer", str), localDispatcher),
+ CompletableFuture.supplyAsync(() -> getArrayedNames(arrangeList), localDispatcher).thenAcceptAsync(str -> result.put("arrange", str), localDispatcher)
);
StringBuilder memberBuilder = new StringBuilder();
for(Member tmpMember : mapper.readValue(node.get("member").traverse(), new TypeReference<List<Member>>() {})) {
memberBuilder.deleteCharAt(memberBuilder.length() - 1);
result.put("member", memberBuilder.toString());
CompletableFuture.allOf(nameArraySupplyFutures.toArray(new CompletableFuture[] {})).join();
- lyric = nameArraySupplyFutures.get(0).join();
- composer = nameArraySupplyFutures.get(1).join();
- arrange = nameArraySupplyFutures.get(2).join();
- result.put("lyric", lyric);
- result.put("composer", composer);
- result.put("arrange", arrange);
resultList.add(result);
}
} catch(IOException | InterruptedException e) {
// asserts
assertEquals("開始!", Messages.MSGCalcStart.toString());
assertEquals("楽曲データベースが見つかりませんでした。自動的に作成されます…\n注意:初回起動ではなく、かつ、Jarファイルと同じ階層に\"database.json\"というファイルが存在するにも関わらず\nこのポップアップが出た場合、開発者までご一報ください。\nGithub URL: https://github.com/hizumiaoba/DelesteRandomSelector/issues", Messages.MSGDatabaseNotExist.toString());
- assertEquals(Messages.MSGAlbumTypeBeingCalculated.toString(), "計算中...");
- assertEquals(Messages.MSGNarrowingDownSongs.toString(), "<html><body>楽曲<br>絞り込み</body></html>");
- assertEquals(Messages.MSGTitle.toString(), "デレステ課題曲セレクター");
- assertEquals(Messages.MSGSelectDifficulty.toString(), "難易度選択");
- assertEquals(Messages.MSGNonSelected.toString(), "指定なし");
- assertEquals(Messages.MSGSongLevel.toString(), "楽曲Lv");
- assertTrue(Messages.MSGBelowSpecificLevel.toString().equals("指定Lv以下"));
- assertTrue(Messages.MSGOverSpecificLevel.toString().equals("指定Lv以上"));
- assertTrue(Messages.MSGLevelCheckboxInfo.toString().equals("<html><body>以下以上両方にチェックをつけることで指定レベルのみ絞り込むことができます</body></html>"));
- assertTrue(Messages.MSGUpdatingDatabase.toString().equals("<html><body>データベース<br>更新中…</body></html>"));
- assertTrue(Messages.MSGCompleteNarrowDown.toString().equals("絞り込み完了!「開始」をクリックすることで選曲できます!"));
- assertTrue(Messages.MSGNumberOfSongs.toString().equals("曲目:"));
- assertTrue(Messages.MSGThisPhrase.toString().equals("この"));
- assertTrue(Messages.MSGPlayPhrase.toString().equals("曲をプレイしましょう!!!"));
- assertTrue(Messages.MSGTwitterIntegration.toString().equals("Twitter連携"));
- assertTrue(Messages.MSGUsingThisAppPhrase.toString().equals("デレステ課題曲セレクターで\n"));
- assertTrue(Messages.MSGNotPlayYet.toString().equals("ちひろ「まだプレイを始めていないみたいですね」"));
- assertTrue(Messages.MSGTwitterPlayOtherwisePhrase.toString().equals("…その他数曲\nをプレイしました!\n"));
- assertTrue(Messages.MSGTwitterPlayOnlyPhrase.toString().equals("をプレイしました!"));
- assertTrue(Messages.MSGTwitterIntegrationConfirm.toString().equals("Twitterへ以下の内容を投稿します。よろしいですか?\n\n"));
- assertTrue(Messages.MSGStringLength.toString().equals("\n\n文字数:"));
- assertTrue(Messages.MSGCompletePost.toString().equals("投稿が完了しました。"));
- assertTrue(Messages.MSGTerminate.toString().equals("終了"));
- assertTrue(Messages.MSGInternalYpdateNotDoneYet.toString().equals("内部更新処理が完了していません。少し待ってからやり直してください。"));
- assertTrue(Messages.MSGNarrowDownProcedure.toString().equals("楽曲選択の手順\r\n1.難易度、属性、レベルを選択する\r\n2.「楽曲取り込み」ボタンを押す!\r\n3.「開始」ボタンを押す!\r\n4.選択された楽曲がここに表示されます!\r\n現在設定されている楽曲選択の最大数:"));
- assertTrue(Messages.MSGCurrentAlbumType.toString().equals("\n現在のMASTER+アルバム周期(推定):"));
- assertTrue(Messages.MSGManualUpdate.toString().equals("<html><body>手動更新</body></html>"));
- assertTrue(Messages.MSGManualUpdateNotCompleteYet.toString().equals("手動更新が完了していません。もうしばらくお待ちください。"));
+ assertEquals("計算中...", Messages.MSGAlbumTypeBeingCalculated.toString());
+ assertEquals("<html><body>楽曲<br>絞り込み</body></html>", Messages.MSGNarrowingDownSongs.toString());
+ assertEquals("デレステ課題曲セレクター", Messages.MSGTitle.toString());
+ assertEquals("難易度選択", Messages.MSGSelectDifficulty.toString());
+ assertEquals("指定なし", Messages.MSGNonSelected.toString());
+ assertEquals("楽曲Lv", Messages.MSGSongLevel.toString());
+ assertEquals("指定Lv以下", Messages.MSGBelowSpecificLevel.toString());
+ assertEquals("指定Lv以上", Messages.MSGOverSpecificLevel.toString());
+ assertEquals("<html><body>以下以上両方にチェックをつけることで指定レベルのみ絞り込むことができます</body></html>", Messages.MSGLevelCheckboxInfo.toString());
+ assertEquals("<html><body>データベース<br>更新中…</body></html>", Messages.MSGUpdatingDatabase.toString());
+ assertEquals("絞り込み完了!「開始」をクリックすることで選曲できます!", Messages.MSGCompleteNarrowDown.toString());
+ assertEquals("曲目:", Messages.MSGNumberOfSongs.toString());
+ assertEquals("この", Messages.MSGThisPhrase.toString());
+ assertEquals("曲をプレイしましょう!!!", Messages.MSGPlayPhrase.toString());
+ assertEquals("Twitter連携", Messages.MSGTwitterIntegration.toString());
+ assertEquals("デレステ課題曲セレクターで\n", Messages.MSGUsingThisAppPhrase.toString());
+ assertEquals("ちひろ「まだプレイを始めていないみたいですね」", Messages.MSGNotPlayYet.toString());
+ assertEquals("…その他数曲\nをプレイしました!\n", Messages.MSGTwitterPlayOtherwisePhrase.toString());
+ assertEquals("をプレイしました!", Messages.MSGTwitterPlayOnlyPhrase.toString());
+ assertEquals("Twitterへ以下の内容を投稿します。よろしいですか?\n\n", Messages.MSGTwitterIntegrationConfirm.toString());
+ assertEquals("\n\n文字数:", Messages.MSGStringLength.toString());
+ assertEquals("投稿が完了しました。", Messages.MSGCompletePost.toString());
+ assertEquals("終了", Messages.MSGTerminate.toString());
+ assertEquals("内部更新処理が完了していません。少し待ってからやり直してください。", Messages.MSGInternalYpdateNotDoneYet.toString());
+ assertEquals("楽曲選択の手順\r\n1.難易度、属性、レベルを選択する\r\n2.「楽曲取り込み」ボタンを押す!\r\n3.「開始」ボタンを押す!\r\n4.選択された楽曲がここに表示されます!\r\n現在設定されている楽曲選択の最大数:", Messages.MSGNarrowDownProcedure.toString());
+ assertEquals("\n現在のMASTER+アルバム周期(推定):", Messages.MSGCurrentAlbumType.toString());
+ assertEquals("<html><body>手動更新</body></html>", Messages.MSGManualUpdate.toString());
+ assertEquals("手動更新が完了していません。もうしばらくお待ちください。", Messages.MSGManualUpdateNotCompleteYet.toString());
assertEquals("設定", Messages.MSGConfigurations.toString());
+ assertEquals("楽曲情報APIより取得中です。\nしばらくお待ちください。", Messages.MSGAPIWaitAPIFetch.toString());
+ assertEquals("今回プレイした楽曲", Messages.MSGInfoPlayedSongs.toString());
+ assertEquals("しばらくお待ちください…", Messages.MSGInfoWait.toString());
+ assertEquals("曲名", Messages.MSGInfoSongName.toString());
+ assertEquals("作詞者", Messages.MSGInfoLyricsBy.toString());
+ assertEquals("曲タイプ", Messages.MSGInfoSongAttribute.toString());
+ assertEquals("作曲者", Messages.MSGInfoComposedBy.toString());
+ assertEquals("難易度", Messages.MSGInfoSongDifficulty.toString());
+ assertEquals("編曲者", Messages.MSGInfoArrangedBy.toString());
+ assertEquals("レベル", Messages.MSGInfoSongLevel.toString());
+ assertEquals("登場メンバー", Messages.MSGInfoMember.toString());
+ assertEquals("ノート数", Messages.MSGInfoSongNotes.toString());
+ assertEquals("更に詳しい情報を見る", Messages.MSGInfoOpenBrowser.toString());
}
@Test
Locale.setDefault(this.us);
// asserts
- assertTrue(Messages.MSGCalcStart.toString().equals("Start!"));
- assertTrue(Messages.MSGDatabaseNotExist.toString().equals("Music database does not exist.\nIt will be automatically created.\nATTENTION:There is the JSON file named \"database.json\" in the same directory which executable is contained and you see this pop up,\nPlease contact the Developer.\nGithub URL: https://github.com/hizumiaoba/DelesteRandomSelector/issues"));
- assertTrue(Messages.MSGAlbumTypeBeingCalculated.toString().equals("Simulating..."));
- assertTrue(Messages.MSGNarrowingDownSongs.toString().equals("<html><body>Narrow down<br>songs</body></html>"));
- assertTrue(Messages.MSGTitle.toString().equals("DelesteRandomSelector"));
- assertTrue(Messages.MSGSelectDifficulty.toString().equals("Difficulty"));
- assertTrue(Messages.MSGNonSelected.toString().equals("Non-Select"));
- assertTrue(Messages.MSGSongLevel.toString().equals("Level"));
- assertTrue(Messages.MSGBelowSpecificLevel.toString().equals("Below Lv"));
- assertTrue(Messages.MSGOverSpecificLevel.toString().equals("Above Lv"));
- assertTrue(Messages.MSGLevelCheckboxInfo.toString().equals("<html><body>Only specified level songs will be selected if you mark both checkbox.</body></html>"));
- assertTrue(Messages.MSGUpdatingDatabase.toString().equals("<html><body>Updating<br>database</body></html>"));
- assertTrue(Messages.MSGCompleteNarrowDown.toString().equals("Narrowing down complete! Click \"Start!\" to play!"));
- assertTrue(Messages.MSGNumberOfSongs.toString().equals("tracks:"));
- assertTrue(Messages.MSGThisPhrase.toString().equals("Let's play these"));
- assertTrue(Messages.MSGPlayPhrase.toString().equals("songs!"));
- assertTrue(Messages.MSGTwitterIntegration.toString().equals("<html><body>Post to Twitter</body></html>"));
- assertTrue(Messages.MSGUsingThisAppPhrase.toString().equals("I played\n"));
- assertTrue(Messages.MSGNotPlayYet.toString().equals("It seems that you don't start playing yet?"));
- assertTrue(Messages.MSGTwitterPlayOtherwisePhrase.toString().equals("...and some songs!\n"));
- assertTrue(Messages.MSGTwitterPlayOnlyPhrase.toString().equals("songs!"));
- assertTrue(Messages.MSGTwitterIntegrationConfirm.toString().equals("Are you sure you want to post this?\n\n"));
- assertTrue(Messages.MSGStringLength.toString().equals("\n\nNumber of Characters"));
- assertTrue(Messages.MSGCompletePost.toString().equals("Complete to post."));
- assertTrue(Messages.MSGTerminate.toString().equals("End"));
- assertTrue(Messages.MSGInternalYpdateNotDoneYet.toString().equals("Internal update in progress. Please wait a moment."));
- assertTrue(Messages.MSGNarrowDownProcedure.toString().equals("How to select songs\r\n1.Select difficulty, attribute, and level.\r\n2.Click [Narrow down songs] button.\r\n3.Click [start!] button.\r\n4.Selected songs will be shown here!\r\nThe maximum number of selected songs:"));
- assertTrue(Messages.MSGCurrentAlbumType.toString().equals("\nCurrent MASTER+ ALBUM type(based on simulation):"));
- assertTrue(Messages.MSGManualUpdate.toString().equals("<html><body>Manual<br>Update</body></html>"));
- assertTrue(Messages.MSGManualUpdateNotCompleteYet.toString().equals("Manual Update has not been finished yet. Please wait a moment."));
+ assertEquals("Start!", Messages.MSGCalcStart.toString());
+ assertEquals("Music database does not exist.\nIt will be automatically created.\nATTENTION:There is the JSON file named \"database.json\" in the same directory which executable is contained and you see this pop up,\nPlease contact the Developer.\nGithub URL: https://github.com/hizumiaoba/DelesteRandomSelector/issues", Messages.MSGDatabaseNotExist.toString());
+ assertEquals("Simulating...", Messages.MSGAlbumTypeBeingCalculated.toString());
+ assertEquals("<html><body>Narrow down<br>songs</body></html>", Messages.MSGNarrowingDownSongs.toString());
+ assertEquals("DelesteRandomSelector", Messages.MSGTitle.toString());
+ assertEquals("Difficulty", Messages.MSGSelectDifficulty.toString());
+ assertEquals("Non-Select", Messages.MSGNonSelected.toString());
+ assertEquals("Level", Messages.MSGSongLevel.toString());
+ assertEquals("Below Lv", Messages.MSGBelowSpecificLevel.toString());
+ assertEquals("Above Lv", Messages.MSGOverSpecificLevel.toString());
+ assertEquals("<html><body>Only specified level songs will be selected if you mark both checkbox.</body></html>", Messages.MSGLevelCheckboxInfo.toString());
+ assertEquals("<html><body>Updating<br>database</body></html>", Messages.MSGUpdatingDatabase.toString());
+ assertEquals("Narrowing down complete! Click \"Start!\" to play!", Messages.MSGCompleteNarrowDown.toString());
+ assertEquals("tracks:", Messages.MSGNumberOfSongs.toString());
+ assertEquals("Let's play these", Messages.MSGThisPhrase.toString());
+ assertEquals("songs!", Messages.MSGPlayPhrase.toString());
+ assertEquals("<html><body>Post to Twitter</body></html>", Messages.MSGTwitterIntegration.toString());
+ assertEquals("I played\n", Messages.MSGUsingThisAppPhrase.toString());
+ assertEquals("It seems that you don't start playing yet?", Messages.MSGNotPlayYet.toString());
+ assertEquals("...and some songs!\n", Messages.MSGTwitterPlayOtherwisePhrase.toString());
+ assertEquals("songs!", Messages.MSGTwitterPlayOnlyPhrase.toString());
+ assertEquals("Are you sure you want to post this?\n\n", Messages.MSGTwitterIntegrationConfirm.toString());
+ assertEquals("\n\nNumber of Characters", Messages.MSGStringLength.toString());
+ assertEquals("Complete to post.", Messages.MSGCompletePost.toString());
+ assertEquals("End", Messages.MSGTerminate.toString());
+ assertEquals("Internal update in progress. Please wait a moment.", Messages.MSGInternalYpdateNotDoneYet.toString());
+ assertEquals("How to select songs\r\n1.Select difficulty, attribute, and level.\r\n2.Click [Narrow down songs] button.\r\n3.Click [start!] button.\r\n4.Selected songs will be shown here!\r\nThe maximum number of selected songs:", Messages.MSGNarrowDownProcedure.toString());
+ assertEquals("\nCurrent MASTER+ ALBUM type(based on simulation):", Messages.MSGCurrentAlbumType.toString());
+ assertEquals("<html><body>Manual<br>Update</body></html>", Messages.MSGManualUpdate.toString());
+ assertEquals("Manual Update has not been finished yet. Please wait a moment.", Messages.MSGManualUpdateNotCompleteYet.toString());
assertEquals("Config", Messages.MSGConfigurations.toString());
+ assertEquals("Getting informations from API. Please wait.", Messages.MSGAPIWaitAPIFetch.toString());
+ assertEquals("The songs you played", Messages.MSGInfoPlayedSongs.toString());
+ assertEquals("Please wait...", Messages.MSGInfoWait.toString());
+ assertEquals("Song Name", Messages.MSGInfoSongName.toString());
+ assertEquals("Lyrics By", Messages.MSGInfoLyricsBy.toString());
+ assertEquals("Song Attribute", Messages.MSGInfoSongAttribute.toString());
+ assertEquals("Composed By", Messages.MSGInfoComposedBy.toString());
+ assertEquals("Difficulty", Messages.MSGInfoSongDifficulty.toString());
+ assertEquals("Arranged By", Messages.MSGInfoArrangedBy.toString());
+ assertEquals("Song Level", Messages.MSGInfoSongLevel.toString());
+ assertEquals("Member", Messages.MSGInfoMember.toString());
+ assertEquals("Notes", Messages.MSGInfoSongNotes.toString());
+ assertEquals("More Information", Messages.MSGInfoOpenBrowser.toString());
}
@After