diff --git a/docker-compose.yml b/docker-compose.yml index 57d3280..2cb1c73 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,6 +18,19 @@ services: options: max-size: "1m" max-file: "3" + + imgparser: + build: imgparser + restart: always + ports: + - "4503:4503" + volumes: + - ./imgparser:/imgparser + working_dir: /imgparser/projectDivaImgParser + logging: + options: + max-size: "1m" + max-file: "3" postgres: image: postgres:10.4 diff --git a/frontend/src/App.js b/frontend/src/App.js index bc25155..a25b0a4 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -1007,10 +1007,19 @@ function HoverSongName(p) { ) } -function HasSong(song,user) { - //console.log(JSON.stringify(song)+"/"+JSON.stringify(user)) - return (song.mega39s&&user.megamix)|| - (song.futuretone&&user.futuretone) +function HasSong(song,user,filter) { + //console.log(JSON.stringify(song)+"/"+JSON.stringify(user)+"/"+JSON.stringify(filter)) + //console.log(song.report.ehdcount+song.report.nhdcount+song.report.hhdcount+song.report.exhdcount+song.report.exexhdcount+song.report.ehscount+song.report.nhscount+song.report.hhscount+song.report.exhscount+song.report.exexhscount+song.report.esdcount+song.report.nsdcount+song.report.hsdcount+song.report.exsdcount+song.report.exexsdcount) + return ((song.mega39s&&user.megamix)|| + (song.futuretone&&user.futuretone)) + &&(filter==="All Songs"|| + (filter==="Cleared Songs"&&(Number(song.report.eclearcount)+Number(song.report.nclearcount)+Number(song.report.hclearcount)+Number(song.report.exclearcount)+Number(song.report.exexclearcount>0)))|| + (filter==="FCs"&&(Number(song.report.efccount)+Number(song.report.nfccount)+Number(song.report.hfccount)+Number(song.report.exfccount)+Number(song.report.exexfccount>0)))|| + (filter==="Perfect FCs"&&(Number(song.report.epfccount)+Number(song.report.npfccount)+Number(song.report.hpfccount)+Number(song.report.expfccount)+Number(song.report.exexpfccount>0)))|| + (filter==="Modded"&&(Number(song.report.ehdcount)+Number(song.report.nhdcount)+Number(song.report.hhdcount)+Number(song.report.exhdcount)+Number(song.report.exexhdcount)+Number(song.report.ehscount)+Number(song.report.nhscount)+Number(song.report.hhscount)+Number(song.report.exhscount)+Number(song.report.exexhscount)+Number(song.report.esdcount)+Number(song.report.nsdcount)+Number(song.report.hsdcount)+Number(song.report.exsdcount)+Number(song.report.exexsdcount>0)))|| + (filter==="In Progress"&&(Number(song.report.eclearcount)+Number(song.report.nclearcount)+Number(song.report.hclearcount)+Number(song.report.exclearcount)+Number(song.report.exexclearcount)===0))|| + (filter==="Not Cleared"&&(((song.report.eclearcount)?Number(song.report.eclearcount):0)+((song.report.nclearcount)?Number(song.report.nclearcount):0)+((song.report.hclearcount)?Number(song.report.hclearcount):0)+((song.report.exclearcount)?Number(song.report.exclearcount):0)+((song.report.exexclearcount)?Number(song.report.exexclearcount):0)===0)) + ) } function CompletionPanel(p) { @@ -1019,6 +1028,7 @@ function CompletionPanel(p) { const [filter,setFilter] = useState({}) const [style,setStyle] = useState(true) const [update,setUpdate] = useState(false) + const [songFilter,setSongFilter] = useState("All Songs") useEffect(()=>{ axios.get("http://projectdivar.com/completionreport/"+p.username) .then((data)=>{setReport(data.data)}) @@ -1037,6 +1047,22 @@ function CompletionPanel(p) { return ( <> +
+
+ + Filter + {setSongFilter(e.currentTarget.value)}}> + + + + + + + + + +
+
@@ -1061,7 +1087,7 @@ function CompletionPanel(p) { - {report.filter((report)=>Object.keys(filter).length==0||report.id in filter).map((song,i)=>{return (HasSong(song,p.user))?:<> + {report.filter((report)=>Object.keys(filter).length==0||report.id in filter).map((song,i)=>{return (HasSong(song,p.user,songFilter))?:<> })} @@ -1428,8 +1454,6 @@ function SongSearch(p) { })}:<>} - - More stuff goes here. ) } diff --git a/imgparser/Dockerfile b/imgparser/Dockerfile new file mode 100644 index 0000000..7e642ac --- /dev/null +++ b/imgparser/Dockerfile @@ -0,0 +1,4 @@ +# pull official base image +FROM openjdk:8-jdk-alpine + +CMD ["./gradlew", "bootRun"] \ No newline at end of file diff --git a/server/app.js b/server/app.js index b814d8b..296d0e6 100644 --- a/server/app.js +++ b/server/app.js @@ -498,7 +498,7 @@ app.get('/completionreport/:username',(req,res)=>{ .then((data)=>{ songs = data.rows; songs.forEach((song)=>{ - promises.push(db.query("select * from (select userid,count(*) filter(where difficulty='E' and mod='SD' and score>0) as ESDCount,count(*) filter(where difficulty='N' and mod='SD' and score>0) as NSDCount,count(*) filter(where difficulty='H' and mod='SD' and score>0) as HSDCount,count(*) filter(where difficulty='EX' and mod='SD' and score>0) as EXHDCount,count(*) filter(where difficulty='E' and mod='HD' and score>0) as EHDCount,count(*) filter(where difficulty='N' and mod='HD' and score>0) as NHDCount,count(*) filter(where difficulty='H' and mod='HD' and score>0) as HHDCount,count(*) filter(where difficulty='EX' and mod='HD' and score>0) as EXHDCount,count(*) filter(where difficulty='E' and mod='HS' and score>0) as EHSCount,count(*) filter(where difficulty='N' and mod='HS' and score>0) as NHSCount,count(*) filter(where difficulty='H' and mod='HS' and score>0) as HHSCount,count(*) filter(where difficulty='EX' and mod='HS' and score>0) as EXHSCount,count(*) filter(where difficulty='EXEX' and mod='HS' and score>0) as EXEXHSCount,Count(*) filter(where difficulty='E' and score>0) as EClearCount,Count(*) filter(where difficulty='N' and score>0) as NClearCount,Count(*) filter(where difficulty='H' and score>0) as HClearCount,Count(*) filter(where difficulty='EX' and score>0) as EXClearCount,Count(*) filter(where difficulty='EXEX' and score>0) as EXEXClearCount,count(*) filter(where difficulty='E') as ECount,count(*) filter(where difficulty='N') as NCount,count(*) filter(where difficulty='H') as HCount,count(*) filter(where difficulty='EX') as EXCount,count(*) filter(where difficulty='EXEX') as EXEXCount,Count(*) filter(where safe=0 and sad=0 and worst=0 and difficulty='E') as EFCCount,Count(*) filter(where safe=0 and sad=0 and worst=0 and difficulty='N') as NFCCount,Count(*) filter(where safe=0 and sad=0 and worst=0 and difficulty='H') as HFCCount,Count(*) filter(where safe=0 and sad=0 and worst=0 and difficulty='EX') as EXFCCount,Count(*) filter(where safe=0 and sad=0 and worst=0 and difficulty='EXEX') as EXEXFCCount,Count(*) filter(where fine=0 and safe=0 and sad=0 and worst=0 and difficulty='E') as EPFCCount,Count(*) filter(where fine=0 and safe=0 and sad=0 and worst=0 and difficulty='N') as NPFCCount,Count(*) filter(where fine=0 and safe=0 and sad=0 and worst=0 and difficulty='H') as HPFCCount,Count(*) filter(where fine=0 and safe=0 and sad=0 and worst=0 and difficulty='EX') as EXPFCCount,Count(*) filter(where fine=0 and safe=0 and sad=0 and worst=0 and difficulty='EXEX') as EXEXPFCCount from plays where userid=$1 and songid=$2 group by userid)t1 join (select rank,t.score,t.percent from (select row_number()over(order by score desc)rank,* from(select distinct on (userid) * from (select * from plays where songid=$2)t order by userid,score desc)t)t where userid=$1)t2 on t1.userid=t1.userid",[userId,song.id]) + promises.push(db.query("select * from (select userid,count(*) filter(where difficulty='E' and mod='SD' and score>0) as ESDCount,count(*) filter(where difficulty='N' and mod='SD' and score>0) as NSDCount,count(*) filter(where difficulty='H' and mod='SD' and score>0) as HSDCount,count(*) filter(where difficulty='EX' and mod='SD' and score>0) as EXSDCount,count(*) filter(where difficulty='EXEX' and mod='SD' and score>0) as EXEXSDCount,count(*) filter(where difficulty='E' and mod='HD' and score>0) as EHDCount,count(*) filter(where difficulty='N' and mod='HD' and score>0) as NHDCount,count(*) filter(where difficulty='H' and mod='HD' and score>0) as HHDCount,count(*) filter(where difficulty='EX' and mod='HD' and score>0) as EXHDCount,count(*) filter(where difficulty='EXEX' and mod='HD' and score>0) as EXEXHDCount,count(*) filter(where difficulty='E' and mod='HS' and score>0) as EHSCount,count(*) filter(where difficulty='N' and mod='HS' and score>0) as NHSCount,count(*) filter(where difficulty='H' and mod='HS' and score>0) as HHSCount,count(*) filter(where difficulty='EX' and mod='HS' and score>0) as EXHSCount,count(*) filter(where difficulty='EXEX' and mod='HS' and score>0) as EXEXHSCount,Count(*) filter(where difficulty='E' and score>0) as EClearCount,Count(*) filter(where difficulty='N' and score>0) as NClearCount,Count(*) filter(where difficulty='H' and score>0) as HClearCount,Count(*) filter(where difficulty='EX' and score>0) as EXClearCount,Count(*) filter(where difficulty='EXEX' and score>0) as EXEXClearCount,count(*) filter(where difficulty='E') as ECount,count(*) filter(where difficulty='N') as NCount,count(*) filter(where difficulty='H') as HCount,count(*) filter(where difficulty='EX') as EXCount,count(*) filter(where difficulty='EXEX') as EXEXCount,Count(*) filter(where safe=0 and sad=0 and worst=0 and difficulty='E') as EFCCount,Count(*) filter(where safe=0 and sad=0 and worst=0 and difficulty='N') as NFCCount,Count(*) filter(where safe=0 and sad=0 and worst=0 and difficulty='H') as HFCCount,Count(*) filter(where safe=0 and sad=0 and worst=0 and difficulty='EX') as EXFCCount,Count(*) filter(where safe=0 and sad=0 and worst=0 and difficulty='EXEX') as EXEXFCCount,Count(*) filter(where fine=0 and safe=0 and sad=0 and worst=0 and difficulty='E') as EPFCCount,Count(*) filter(where fine=0 and safe=0 and sad=0 and worst=0 and difficulty='N') as NPFCCount,Count(*) filter(where fine=0 and safe=0 and sad=0 and worst=0 and difficulty='H') as HPFCCount,Count(*) filter(where fine=0 and safe=0 and sad=0 and worst=0 and difficulty='EX') as EXPFCCount,Count(*) filter(where fine=0 and safe=0 and sad=0 and worst=0 and difficulty='EXEX') as EXEXPFCCount from plays where userid=$1 and songid=$2 group by userid)t1 join (select rank,t.score,t.percent from (select row_number()over(order by score desc)rank,* from(select distinct on (userid) * from (select * from plays where songid=$2)t order by userid,score desc)t)t where userid=$1)t2 on t1.userid=t1.userid",[userId,song.id]) .then((data)=>{ if (data.rows.length>0) { song.report=data.rows[0] diff --git a/server/files/unfuzedstream1.png b/server/files/unfuzedstream1.png new file mode 100644 index 0000000..d29fce2 Binary files /dev/null and b/server/files/unfuzedstream1.png differ diff --git a/server/files/unfuzedstream2.png b/server/files/unfuzedstream2.png new file mode 100644 index 0000000..f8f4923 Binary files /dev/null and b/server/files/unfuzedstream2.png differ diff --git a/server/invalidSongs b/server/invalidSongs index 1c9f8db..b179d17 100644 --- a/server/invalidSongs +++ b/server/invalidSongs @@ -771,3 +771,6 @@ {"song":"SING&SMILE","username":"Lian99","authentication_token":"51146-41911-16075","difficulty":"","cool":"-1","fine":"-1","safe":"-1","sad":"-1","worst":"-1","percent":"-1.0","fail":"false","combo":"-1","mod":"","gameScore":"-1","src":"http://pbs.twimg.com/media/EjFsiT9XYAY5kQE.jpg"} {"song":"その一秒 スローモーション","username":"Lian99","authentication_token":"51146-41911-16075","difficulty":"","cool":"-1","fine":"-1","safe":"-1","sad":"-1","worst":"-1","percent":"0.0","fail":"false","combo":"-1","mod":"","gameScore":"-1","src":"https://pbs.twimg.com/media/EjF2bs-XgAAVcG5.jpg"} {"song":"その一秒 スローモーション","username":"Lian99","authentication_token":"51146-41911-16075","difficulty":"","cool":"-1","fine":"-1","safe":"-1","sad":"-1","worst":"-1","percent":"0.0","fail":"false","combo":"-1","mod":"","gameScore":"-1","src":"https://pbs.twimg.com/media/EjF2bs-XgAAVcG5.jpg"} +{"song":"桜ノ雨","username":"Lian99","authentication_token":"51146-41911-16075","difficulty":"","cool":"-1","fine":"-1","safe":"-1","sad":"-1","worst":"-1","percent":"0.0","fail":"false","combo":"-1","mod":"","gameScore":"-1","src":"http://pbs.twimg.com/media/EjHwObQUwAAFz89.jpg"} +{"song":"桜ノ雨","username":"Lian99","authentication_token":"51146-41911-16075","difficulty":"","cool":"-1","fine":"-1","safe":"-1","sad":"-1","worst":"-1","percent":"0.0","fail":"false","combo":"-1","mod":"","gameScore":"-1","src":"http://pbs.twimg.com/media/EjHwObQUwAAFz89.jpg"} +{"song":"ドラマツルギー","username":"blahbleepblop","authentication_token":"49960-47012-40674","difficulty":"","cool":"-1","fine":"-1","safe":"-1","sad":"-1","worst":"-1","percent":"0.0","fail":"false","combo":"-1","mod":"","gameScore":"-1","src":"http://pbs.twimg.com/media/EjJSIt7U4AAU9P4.jpg"}