Skip to content

Commit

Permalink
v0.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
yadPe committed Sep 11, 2019
1 parent 7fc5aaf commit caddb1f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "beatconnect_client",
"productName": "Beatconnect Client",
"version": "0.1.4",
"version": "0.1.5",
"description": "Beatconnect power for osu irc",
"author": "yadpe <petitot.py@gmail.com>",
"license": "GPL-3.0",
Expand Down Expand Up @@ -49,7 +49,7 @@
"buildResources": "assets"
},
"extraMetadata": {
"main": "./build/electron.js",
"main": "./build/electron/electron.js",
"prune": true
},
"dmg": {
Expand Down
6 changes: 2 additions & 4 deletions public/electron/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ const path = require('path');
const url = require('url');
require('./ipcMessages');


autoUpdater.on('error', (error) => {
log.warn(`Error: \n ${error == null ? "unknown" : (error.stack || error).toString()}`);
});
log.transports.file.level = "debug";
autoUpdater.logger = log;
autoUpdater.checkForUpdatesAndNotify()
DownloadManager.register({
downloadFolder: app.getPath("downloads") + "/beatconnect"
Expand Down
6 changes: 3 additions & 3 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Beatconnect",
"name": "Beatconnect Client",
"icons": [
{
"src": "favicon.ico",
Expand All @@ -11,5 +11,5 @@
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
"background_color": "#121212"
}
4 changes: 2 additions & 2 deletions src/App/components/Bot/Matchs/MatchListItem.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import MatchDetails from './MatchDetails'
import injectSheet from 'react-jss';
import Cover from '../../common/Beatmap/Cover';

const styles = {
MatchListItem: {
height: '60px',
width: '80%',
margin: '10px auto',
padding: 0,
Expand All @@ -28,7 +28,7 @@ const MatchListItem = ({ classes, match, theme, setSelected }) => {
return ( // setSelected(<MatchDetails match={match} theme={theme} close={() => setSelected(null)} />)
<ul className={classes.MatchListItem} onClick={() => setSelected(match.id)}>
<li>
<Cover url={`https://b.ppy.sh/thumb/${match.beatmapset_id}.jpg`} height='5vmin' width='10vmin' />
<Cover url={`https://b.ppy.sh/thumb/${match.beatmapset_id}.jpg`} height='60px' width='10vmin' />
</li>
<li className={classes.matchName}>
{match.matchName}
Expand Down
2 changes: 1 addition & 1 deletion src/App/components/common/Beatmap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Badge from '../Badge';
const reqImgAssets = require.context('../../../../assets/img', true, /\.png$/);

const Beatmap = ({ theme, beatmap, width, noFade }) => {
// console.log(beatmap.id, 'updated')
// console.log('updated', beatmap)
const getDownloadUrl = ({ id, unique_id }) => {
return `https://beatconnect.io/b/${id}/${unique_id}`
}
Expand Down
20 changes: 10 additions & 10 deletions src/Bot/Bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Bot {

sendMapById(beatmapSetId, to, extra) {
this.beatconnect.getBeatmapById(beatmapSetId)
.then(response => getDlLink(...response, true, extra))
.then(response => getDlLink(response, true, extra))
.then(link => this.irc.pm(to, link))
.catch(err => {
console.error(err);
Expand All @@ -45,7 +45,7 @@ class Bot {
newMatch(id, matchName, ircRoom, creator, playerList) {
console.log(`New match created : ${id} ${matchName} ${ircRoom} ${creator}`);
let alreadyExist = false;
this.matchs.map(match => {
this.matchs.forEach(match => {
if (match.id === id)
alreadyExist = true
})
Expand All @@ -68,14 +68,14 @@ class Bot {

newBeatmap(beatmapId, matchId) {
this.osuApi.getSetId(beatmapId)
.then(beatmap => this.matchs.map(match => {
.then(beatmap => this.matchs.forEach(match => {
if (match.id === matchId) {
this.beatconnect.getBeatmapById(beatmap.beatmapset_id)
.then(response => {
console.log('Beatconnect', response)
beatmap = { ...beatmap, ...response }
match.updateBeatmap(beatmap).then(store.dispatch({ type: 'UPDATE_MATCHS_LIST', newMatchs: this.matchs }))
console.log('osu', beatmap)
console.log('osu', beatmap, this.matchs)
return
})
}
Expand Down Expand Up @@ -145,36 +145,36 @@ class Bot {
if (channel.startsWith('#mp')) fromMp = channel;

switch (command) {
case this.commandsList[2]: //get
case this.commandsList[2]: // get
if (!parseInt(params[0])) { this.irc.pm(fromMp || from, `${fromMp ? from : ''} You need to specify a beatmapSet id`); break; }
this.sendMapById(params[0], from)
break;
case this.commandsList[5]: //infos
case this.commandsList[5]: // infos
this.irc.pm(fromMp || from, this.conf.commands
.map(cmd => `[https://github.com/yadpe/beatconnect_irc_bot#readme ${cmd.command}] - ${cmd.description}`).join('\n'));
break;
case this.commandsList[0]: //createroom
case this.commandsList[0]: // createroom
this.irc.makeMatch(params[0], from)
.then(({ matchId, name, matchRoom, creator }) => this.newMatch(matchId, name, matchRoom, creator))
.catch(err => {
console.error(err);
this.irc.pm(from, 'Unable to create the match, maybe you already have too many matchs currently open');
});
break;
case this.commandsList[1]: //search
case this.commandsList[1]: // search
this.beatconnect.searchBeatmap(params)
.then(result => this.irc.pm(fromMp || from, result))
.catch(err => console.error(err));
break;
case this.commandsList[4]: //beat
case this.commandsList[4]: // beat
if (!fromMp) { this.irc.pm(from, `You need to be in a multiplayer match to use this`); break; }
const matchId = fromMp.split('_').pop();
this.matchs.map(match => {
if (match.id === matchId)
this.sendMapById(match.beatmapset_id, fromMp, match.fullBeatmapData);
});
break;
case 'join':
case this.commandsList[6]: // join
if (!parseInt(params[0])) {
this.irc.pm(from, 'You need to provide a valid match id')
break;
Expand Down

0 comments on commit caddb1f

Please sign in to comment.