Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom IPFS node support #680

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 21 additions & 29 deletions src/bms/player/beatoraja/select/MusicSelectCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,37 +193,29 @@ public void execute(MusicSelector selector) {
DOWNLOAD_IPFS {
@Override
public void execute(MusicSelector selector) {
Queue<DirectoryBar> dir = selector.getBarRender().getDirectory();
String[] acceptdomain = {"lnt.softether.net","www.ribbit.xyz","rattoto10.jounin.jp","flowermaster.web.fc2.com",
"stellawingroad.web.fc2.com","pmsdifficulty.xxxxxxxx.jp","walkure.net","stellabms.xyz","dpbmsdelta.web.fc2.com",
"cgi.geocities.jp/asahi3jpn","nekokan.dyndns.info"};
boolean startdownload = false;
for (DirectoryBar d : dir) {
if (d instanceof TableBar) {
String selecturl = ((TableBar) d).getUrl();
if (selecturl == null)
break;
for (String url : acceptdomain) {
if (selecturl.startsWith("http://" + url) || selecturl.startsWith("https://" + url)) {
Bar current = selector.getBarRender().getSelected();
if (current instanceof SongBar) {
final SongData song = ((SongBar) current).getSongData();
if (song != null && song.getIpfs() != null) {
selector.main.getMusicDownloadProcessor().start(song);
startdownload = true;
}
}
break;
}
}
if (!startdownload) {
Logger.getGlobal().info("ダウンロードは開始されませんでした。");
}
break;
}
Queue<DirectoryBar> dir = selector.getBarRender().getDirectory();
boolean startdownload = false;
for (DirectoryBar d : dir) {
if (d instanceof TableBar) {
String selecturl = ((TableBar) d).getUrl();
if (selecturl == null)
break;

}
Bar current = selector.getBarRender().getSelected();
if (current instanceof SongBar) {
final SongData song = ((SongBar) current).getSongData();
if (song != null && song.getIpfs() != null) {
selector.main.getMusicDownloadProcessor().start(song);
startdownload = true;
}
}

if (!startdownload) {
Logger.getGlobal().info("ダウンロードは開始されませんでした。");
}
break;
}
}
}
},
/**
Expand Down