From 4e6df0beb6f9e51a770c07a8cefd61180f6fe50f Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sun, 9 Aug 2020 10:31:36 -0500 Subject: [PATCH] Implement info tables for individual song completions. Fixed bugs with uploading songs that were considered invalid --- docker-compose.yml | 12 + frontend/src/App.css | 19 + frontend/src/App.js | 383 +++++++-- frontend/src/setupProxy.js | 14 + server/app.js | 179 ++++- .../express-fileupload/lib/processNested.js | 12 +- .../express-fileupload/package.json | 26 +- .../test/processNested.spec.js | 11 + server/package-lock.json | 6 +- server/package.json | 2 +- updateNoteCounts.sql | 753 ++++++++++++++++++ 11 files changed, 1307 insertions(+), 110 deletions(-) create mode 100644 updateNoteCounts.sql diff --git a/docker-compose.yml b/docker-compose.yml index 535f33c..3d3e712 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,10 @@ services: - ./server:/server env_file: - ./server/.env.twitter + logging: + options: + max-size: "1m" + max-file: "3" postgres: image: postgres:10.4 @@ -24,6 +28,10 @@ services: environment: POSTGRES_USER: postgres POSTGRES_DB: divar + logging: + options: + max-size: "1m" + max-file: "3" frontend: build: @@ -42,6 +50,10 @@ services: volumes: - /app/node_modules - ./frontend:/frontend + logging: + options: + max-size: "1m" + max-file: "3" # prod-frontend: diff --git a/frontend/src/App.css b/frontend/src/App.css index 91c8292..5790987 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -4,6 +4,10 @@ badge-success {hard} badge-warning {ex} badge-danger {exex}*/ +.highest{ + z-index:1000001; +} + .display-tooltip{ position:absolute; z-index:1000000; @@ -11,6 +15,12 @@ badge-danger {exex}*/ font-size:12px; } +.display-tooltipside{ + position:absolute; + z-index:1000000; + font-size:12px; + top:-6px; +} .easy-background{ background-color:#d6f1ff; } @@ -48,6 +58,15 @@ body { 0 0 8px #999 } +.nostyle{ + color: #333; +} +.nostyle:hover{ + color: #333; + text-decoration:none; + background: #eef; +} + table th { position: -webkit-sticky; /* this is for all Safari (Desktop & iOS), not for Chrome*/ position: sticky; diff --git a/frontend/src/App.js b/frontend/src/App.js index 0c2a990..83081a8 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -302,81 +302,141 @@ function Difficulty(p) { function Play(p) { + function GetModifiedDiff(name) { + switch (name) { + case "E":{ + return "easy"; + } + case "N":{ + return "normal"; + } + case "H":{ + return "hard"; + } + case "EX":{ + return "ex"; + } + case "EXEX":{ + return "exex"; + } + } + } + function GetDateDiff() { var hours = Math.floor((Date.now()-new Date(p.play.date))/1000/60/60); var days = Math.floor(hours/24) if (hours<24) {return <>{hours} {"hour"+((hours!==1)?"s":"")} ago} return <>{days} {"day"+((days!==1)?"s":"")} ago } - return ( - <> -
- {(p.index!==undefined)?
{p.index+1}{((p.play.fine==0&&p.play.safe==0&&p.play.sad==0&&p.play.worst==0)?PFC:(p.play.safe==0&&p.play.sad==0&&p.play.worst==0)?FC:<>)}
:<>} -
{GetDateDiff()}
-
{Math.floor(p.play.score)} pts
-
-
-
-
-
- -
-
- {p.play.cool} -
+ function GetDateDisplay() { + var date = new Date(p.play.date); + var months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"] + return <>{months[date.getMonth()]+" "+date.getDate()+" "+date.getFullYear()+" "+date.getHours()+":"+((date.getMinutes()<10)?"0"+date.getMinutes():date.getMinutes())}{GetDateDiff()} + } + if (p.mini) { + return ( + <> +
+
{Math.floor(p.play.score)} pts
{((p.play.fine==0&&p.play.safe==0&&p.play.sad==0&&p.play.worst==0)?✪PFC:(p.play.safe==0&&p.play.sad==0&&p.play.worst==0)?★FC:<>)}
+
{GetDateDisplay()}
+
+
+
+ {p.play.cool+"/"+p.play.fine+"/"+p.play.safe+"/"+p.play.sad+"/"+p.play.worst} +
+
+ {(p.play.mod!==null&&p.play.mod.length>0)? + + :<> + } +
+
+ {p.play.percent}%
-
-
-
- -
-
- {p.play.safe} -
-
-
-
-
- -
-
- {p.play.worst} -
-
-
-
-
- -
-
- {p.play.fine} -
-
-
-
-
- -
-
- {p.play.sad} +
+
+ + ); + } else { + return ( + <> +
+ {(p.index!==undefined)?
{p.index+1}{((p.play.fine==0&&p.play.safe==0&&p.play.sad==0&&p.play.worst==0)?✪PFC:(p.play.safe==0&&p.play.sad==0&&p.play.worst==0)?★FC:<>)}
:<>} +
{GetDateDiff()}
+
{Math.floor(p.play.score)} pts
+
+
+
+
+
+ +
+
+ {p.play.cool} +
-
-
{p.play.percent}%
+
+
+
+
+ +
+
+ {p.play.safe} +
+
+
+
+
+ +
+
+ {p.play.worst} +
+
+
+
+
+ +
+
+ {p.play.fine} +
+
+
+
+
+ +
+
+ {p.play.sad} +
+
+
{p.play.percent}%
+
-
- - ); + + ); + } } function BestPlaysPanel(p) { + var [bestPlays,setBestPlays] = useState([]) + + useEffect(()=>{ + axios.get("http://www.projectdivar.com/bestplays/"+p.username+"?fails=false&limit=5&offset=0") + .then((data)=>{setBestPlays(data.data);}) + }) + return ( <>
    - {p.bestplays.map((play,i)=>{return
  • + {bestPlays.map((play,i)=>{return
  • })}
@@ -385,7 +445,7 @@ function BestPlaysPanel(p) {
    - {p.bestplays.map((play,i)=>{return
  • + {bestPlays.map((play,i)=>{return
  • })}
@@ -404,7 +464,7 @@ function ModDisplay(p) { {(p.hs>0)?{setTooltip("High Speed - "+p.diff.toUpperCase());setVisibility(true)}} onMouseOut={()=>{setVisibility(false)}}>⬣:<>} {(p.hd>0)?{setTooltip("Hidden - "+p.diff.toUpperCase());setVisibility(true)}} onMouseOut={()=>{setVisibility(false)}} style={{color:"#968a0e"}}>⬣:<>} {(p.sd>0)?{setTooltip("Sudden - "+p.diff.toUpperCase());setVisibility(true)}} onMouseOut={()=>{setVisibility(false)}} style={{color:"#49b"}}>⬣:<>} - {(visibility)?{tooltip}:<>} + {(visibility)?{tooltip}:<>} ) } @@ -426,11 +486,11 @@ function PlayDetail(p) { {(p.song.report.rank>0)?<>{p.song.report.percent}%:""} - {p.song.report.ecount>0?{setTooltip(p.song.report.eclearcount+" / "+p.song.report.ecount+" ("+(Math.floor(p.song.report.eclearcount/p.song.report.ecount)*100)+"% pass rate)");setStyle("easy");setVisibility(true)}} onMouseOut={()=>{setVisibility(false)}}>{p.song.report.epfccount>0?"✪":p.song.report.efccount>0?"★":""}{p.song.report.ecount}:<>} - {p.song.report.ncount>0?{setTooltip(p.song.report.nclearcount+" / "+p.song.report.ncount+" ("+(Math.floor(p.song.report.nclearcount/p.song.report.ncount)*100)+"% pass rate)");setStyle("normal");setVisibility(true)}} onMouseOut={()=>{setVisibility(false)}}>{p.song.report.npfccount>0?"✪":p.song.report.nfccount>0?"★":""}{p.song.report.ncount}:<>} - {p.song.report.hcount>0?{setTooltip(p.song.report.hclearcount+" / "+p.song.report.hcount+" ("+(Math.floor(p.song.report.hclearcount/p.song.report.hcount)*100)+"% pass rate)");setStyle("hard");setVisibility(true)}} onMouseOut={()=>{setVisibility(false)}}>{p.song.report.hpfccount>0?"✪":p.song.report.hfccount>0?"★":""}{p.song.report.hcount}:<>} - {p.song.report.excount>0?{setTooltip(p.song.report.exclearcount+" / "+p.song.report.excount+" ("+(Math.floor((p.song.report.exclearcount/p.song.report.excount)*100))+"% pass rate)");setStyle("ex");setVisibility(true)}} onMouseOut={()=>{setVisibility(false)}}>{p.song.report.expfccount>0?"✪":p.song.report.exfccount>0?"★":""}{p.song.report.excount}:<>} - {p.song.report.exexcount>0?{setTooltip(p.song.report.exexclearcount+" / "+p.song.report.exexcount+" ("+(Math.floor(p.song.report.exexclearcount/p.song.report.exexcount)*100)+"% pass rate)");setStyle("exex");setVisibility(true)}} onMouseOut={()=>{setVisibility(false)}}>{p.song.report.exexpfccount>0?"✪":p.song.report.exexfccount>0?"★":""}{p.song.report.exexcount}:<>} + {p.song.report.ecount>0?{setTooltip(<>{p.song.report.eclearcount+" / "+p.song.report.ecount+" ("+(Math.floor((p.song.report.eclearcount/p.song.report.ecount)*100))+"% pass rate)"}{(p.song.report.efccount>0)?<>
{"★FC'd "+p.song.report.efccount+" time"+(p.song.report.efccount!=1?"s":"")}:<>}{(p.song.report.epfccount>0)?<>
{"✪Perfected "+p.song.report.epfccount+" time"+(p.song.report.epfccount!=1?"s":"")}:<>});setStyle("easy");setVisibility(true)}} onMouseOut={()=>{setVisibility(false)}}>{p.song.report.epfccount>0?"✪":p.song.report.efccount>0?"★":""}{p.song.report.ecount}
:<>} + {p.song.report.ncount>0?{setTooltip(<>{p.song.report.nclearcount+" / "+p.song.report.ncount+" ("+(Math.floor((p.song.report.nclearcount/p.song.report.ncount)*100))+"% pass rate)"}{(p.song.report.nfccount>0)?<>
{"★FC'd "+p.song.report.nfccount+" time"+(p.song.report.nfccount!=1?"s":"")}:<>}{(p.song.report.npfccount>0)?<>
{"✪Perfected "+p.song.report.npfccount+" time"+(p.song.report.npfccount!=1?"s":"")}:<>});setStyle("normal");setVisibility(true)}} onMouseOut={()=>{setVisibility(false)}}>{p.song.report.npfccount>0?"✪":p.song.report.nfccount>0?"★":""}{p.song.report.ncount}
:<>} + {p.song.report.hcount>0?{setTooltip(<>{p.song.report.hclearcount+" / "+p.song.report.hcount+" ("+(Math.floor((p.song.report.hclearcount/p.song.report.hcount)*100))+"% pass rate)"}{(p.song.report.hfccount>0)?<>
{"★FC'd "+p.song.report.hfccount+" time"+(p.song.report.hfccount!=1?"s":"")}:<>}{(p.song.report.hpfccount>0)?<>
{"✪Perfected "+p.song.report.hpfccount+" time"+(p.song.report.hpfccount!=1?"s":"")}:<>});setStyle("hard");setVisibility(true)}} onMouseOut={()=>{setVisibility(false)}}>{p.song.report.hpfccount>0?"✪":p.song.report.hfccount>0?"★":""}{p.song.report.hcount}
:<>} + {p.song.report.excount>0?{setTooltip(<>{p.song.report.exclearcount+" / "+p.song.report.excount+" ("+(Math.floor((p.song.report.exclearcount/p.song.report.excount)*100))+"% pass rate)"}{(p.song.report.exfccount>0)?<>
{"★FC'd "+p.song.report.exfccount+" time"+(p.song.report.exfccount!=1?"s":"")}:<>}{(p.song.report.expfccount>0)?<>
{"✪Perfected "+p.song.report.expfccount+" time"+(p.song.report.expfccount!=1?"s":"")}:<>});setStyle("ex");setVisibility(true)}} onMouseOut={()=>{setVisibility(false)}}>{p.song.report.expfccount>0?"✪":p.song.report.exfccount>0?"★":""}{p.song.report.excount}
:<>} + {p.song.report.exexcount>0?{setTooltip(<>{p.song.report.exexclearcount+" / "+p.song.report.exexcount+" ("+(Math.floor((p.song.report.exexclearcount/p.song.report.exexcount)*100))+"% pass rate)"}{(p.song.report.exexfccount>0)?<>
{"★FC'd "+p.song.report.exexfccount+" time"+(p.song.report.exexfccount!=1?"s":"")}:<>}{(p.song.report.exexpfccount>0)?<>
{"✪Perfected "+p.song.report.exexpfccount+" time"+(p.song.report.exexpfccount!=1?"s":"")}:<>});setStyle("exex");setVisibility(true)}} onMouseOut={()=>{setVisibility(false)}}>{p.song.report.exexpfccount>0?"✪":p.song.report.exexfccount>0?"★":""}{p.song.report.exexcount}
:<>} {(visibility)?{tooltip}:<>} @@ -464,15 +524,49 @@ function PlayDetail(p) { ); } +function PlayData(p) { + var [data,setData] = useState([]) + var [update,setUpdate] = useState(false) + + useEffect(()=>{ + axios.get("http://projectdivar.com/plays/"+p.username+"/"+p.song.id) + .then((data)=>{setData(data.data)}) + },[update]) + + return ( + <> +
+ {data.map((play,i)=>)} +
+ + ) +} + function HoverSongName(p) { - const [name,setName] = useState(p.song.name) + var [name,setName] = useState(p.song.name) + var [expand,setExpand] = useState(<>) + var [toggle,setToggle] = useState(false) return ( - {setName((p.song.romanized_name.length>0)?p.song.romanized_name:p.song.english_name)}} onMouseOut={()=>{setName(p.song.name)}}> - - {name} - - - + <> + {setName((p.song.romanized_name.length>0)?p.song.romanized_name:p.song.english_name)}} onMouseOut={()=>{setName(p.song.name)}} + data-toggle="collapse" data-target={"#collapse"+p.song.id} aria-expanded="false" aria-controls="collapseExample" onClick={()=>{ + if (!toggle) { + setExpand() + setToggle(true) + } else { + setToggle(false) + } + } + }> + + {name} + + + + + {expand} + + ) } @@ -511,7 +605,7 @@ function CompletionPanel(p) { - {report.map((song,i)=>{return + {report.map((song,i)=>{return })} @@ -538,6 +632,24 @@ const CalculateAccuracy=(cool,fine,safe,sad,worst)=>{ return Math.round((sum/noteCount)*10000)/100+"%"; } +function ClearBadge(p) { + var [display,setDisplay] = useState(<>) + + /*{easy}/{diffs.E} + {(fcdata&&fcdata.E>0)?<>
★{fcdata.E}:<>} + {(pfcdata&&pfcdata.E>0)?<>
✪{pfcdata.E}:<>}
*/ + return( + <> + { + setDisplay(<>{((p.fcdata&&p.fcdata[p.diff]>0)?<>
★{p.fcdata[p.diff]}:<>)} + {((p.pfcdata&&p.pfcdata[p.diff]>0)?<>
✪{p.pfcdata[p.diff]}:<>)}) + }} onMouseOut={()=>{ + setDisplay(<>) + }}>{p.count}/{p.diffs[p.diff]}{display}
+ + ) +} + function Profile(p){ let { username } = useParams(); let match = useRouteMatch(); @@ -551,11 +663,16 @@ function Profile(p){ var [update,setUpdate] = useState(false); var [diffs,setDiffs] = useState({}); var [user,setUserData] = useState({}); - var [bestPlays,setBestPlays] = useState([]); var [render,setRender] = useState(false); - function CalculateClear(easy,normal,hard,ex,exex) { - return <>{easy}/{diffs.E}{normal}/{diffs.N}{hard}/{diffs.H}{ex}/{diffs.EX}{exex}/{diffs.EXEX}; + function CalculateClear(easy,normal,hard,ex,exex,fcdata,pfcdata) { + return <> + + + + + + } useEffect(()=>{ @@ -563,17 +680,17 @@ function Profile(p){ .then((data)=>{setUserData(data.data);setPlayCount(data.data.playcount);setFCCount(data.data.fccount);setRating(data.data.rating);setLastPlayed(data.data.last_played);setAccuracy(CalculateAccuracy(data.data.cool,data.data.fine,data.data.safe,data.data.sad,data.data.worst))}); axios.get("http://projectdivar.com:4501/songdiffs") .then((data)=>{setDiffs(data.data)}) - axios.get("http://www.projectdivar.com/bestplays/"+username+"?fails=false") - .then((data)=>{setBestPlays(data.data);}) },[update]) useEffect(()=>{ - setClear(CalculateClear(user.eclear,user.nclear,user.hclear,user.exclear,user.exexclear)) + if (user!={}) { + setClear(CalculateClear(user.eclear,user.nclear,user.hclear,user.exclear,user.exexclear,user.fcdata,user.pfcdata)) + } },[diffs,user]) useEffect(()=>{ - setRender(user&&playcount&&fccount&&rating&&lastPlayed&&accuracy&&diffs&&bestPlays&&cleared) - },[user,playcount,fccount,rating,lastPlayed,accuracy,diffs,bestPlays,cleared]) + setRender(user&&playcount&&fccount&&rating&&lastPlayed&&accuracy&&diffs&&cleared) + },[user,playcount,fccount,rating,lastPlayed,accuracy,diffs,cleared]) return ( <> @@ -581,7 +698,7 @@ function Profile(p){ {(render)?<> - + @@ -632,7 +749,7 @@ function Rankings(){ ); } -function Submit(p) { +function ImageUpload(p) { var [file,setFile] = useState(null); var [fileProcess,setFileProcess] = useState(0); var [error,setError] = useState(null); @@ -654,7 +771,7 @@ function Submit(p) { } const data = new FormData() data.append('file', file) - data.append("username","sigonasr2"); + data.append("username","The Internet"); data.append("authentication_token","sig"); if (!data.has("username") || !data.has("authentication_token")) {setError("Authentication failed!");return;} @@ -704,6 +821,104 @@ function Submit(p) { } } +function SongSearch(p) { + //Requires: p.song / p.setSong + const [song,setSong] = useState("") + const [focused,setFocused] = useState(false) + + return ( + <> + {setFocused(true)}} onChange={(e)=>{ + setSong(e.target.value) + } + }/> + {(focused)? +
{Object.keys(p.songs).filter((key)=> + { + var s = p.songs[key] + return s.name.toLowerCase().includes(song.toLowerCase())||s.romanized_name.toLowerCase().includes(song.toLowerCase())||s.english_name.toLowerCase().includes(song.toLowerCase())||s.artist.toLowerCase().includes(song.toLowerCase())||s.vocaloid.toLowerCase().includes(song.toLowerCase()) + }).map((key)=>
{setSong(p.songs[key].name);setFocused(false)}}>

{p.songs[key].name}

{(p.songs[key].romanized_name)?p.songs[key].romanized_name:p.songs[key].english_name}
)}
:<>} + + More stuff goes here. + + ) +} + +function SimpleUpload(p){ + const [song,setSong] = useState("Catch the Wave") + + return ( + <> + + + ) +} + +function Submit(p) { + return ( +
+
+ + + + + + Detailed + + + Switch + + + + + +

Select a submission method

+
+ +
+
Simple Submit
+

Submit your plays by entering the clear % of a song

+

The simplest way to submit plays, it won't be entirely accurate, but it lets you submit plays very quickly.

+
+ +
+
+
+ +
+
Detailed Submit
+

Submit your plays by entering all the information about a play

+

You can submit as many songs as you like, but you will have to provide details for each play.

+
+ +
+
+
+ +
+
Image Upload
+

Upload images from your Nintendo Switch for automatic processing/scoring!

+

Put up to 50 images in a zip file to mass-upload your screenshotted plays to your profile. You will need to extract them from your microSD card from your Nintendo Switch.

+
+ +
+
+
+ +
+
Nintendo Switch/Twitter Upload
+

Setup your account for uploading through Twitter using your Nintendo Switch!

+

You can select up to 4 images to post to Twitter at one time.

+
+ +
+
+
+
+
+ ) +} + function Website() { const [songs,setSongs] = useState([]) const [update,setUpdate] = useState(false) @@ -719,7 +934,7 @@ function Website() { return (
-

Sidebar Contents

+

Sidebar Contents

Rankings
Item 2
Item 3
@@ -736,7 +951,7 @@ function Website() { } - +

Project DivaR

diff --git a/frontend/src/setupProxy.js b/frontend/src/setupProxy.js index 4b0cee0..8e22e7c 100644 --- a/frontend/src/setupProxy.js +++ b/frontend/src/setupProxy.js @@ -1,6 +1,20 @@ const { createProxyMiddleware } = require('http-proxy-middleware'); module.exports = function(app) { + app.use( + "/plays/:username/:songname", + createProxyMiddleware({ + target: 'http://server:4501', + changeOrigin: true, + }) + ); + app.use( + "/song/:songname/:difficulty", + createProxyMiddleware({ + target: 'http://server:4501', + changeOrigin: true, + }) + ); app.use( "/ratings/:songname", createProxyMiddleware({ diff --git a/server/app.js b/server/app.js index 69ca181..21988c0 100644 --- a/server/app.js +++ b/server/app.js @@ -102,7 +102,7 @@ app.delete('/remove',(req,res)=>{ db.query("select id,authentication_token,playcount,fccount,cool,fine,safe,sad,worst,eclear,nclear,hclear,exclear,exexclear from users where username=$1 limit 1",[req.body.username]) .then((data)=>{if(data && data.rows.length>0){userObj=data.rows[0];if (req.body.authentication_token===userObj.authentication_token){return db.query("delete from plays where id=$1 and userid=$2 returning *",[req.body.playid,userObj.id])}else{throw new Error("Could not authenticate user!")}}else{throw new Error("Cannot find user!")}}) .then((data)=>{if(data && data.rows.length>0){songObj=data.rows[0];return CalculateRating(req.body.username)}else{throw new Error("Could not find play!")}}) - .then((data)=>{rating=data;return db.query("select * from plays where songid=$1 and userid=$2 and difficulty=$3 limit 1",[songObj.songid,userObj.id,songObj.difficulty])}) + .then((data)=>{rating=data;return db.query("select * from plays where songid=$1 and userid=$2 and difficulty=$3 and score>0 limit 1",[songObj.songid,userObj.id,songObj.difficulty])}) .then((data)=>{if(data && data.rows.length===0){isFirstClear=true;}/*console.log([data,userObj.playcount-1,(songObj.safe==0&&songObj.sad==0&&songObj.worst==0)?userObj.fccount-1:userObj.fccount,userObj.cool-songObj.cool,userObj.fine-songObj.fine,userObj.safe-songObj.safe,userObj.sad-songObj.sad,userObj.worst-songObj.worst,(songObj.difficulty=="E")?userObj.ecount-1:userObj.ecount,(songObj.difficulty=="N")?userObj.ncount-1:userObj.ncount,(songObj.difficulty=="H")?userObj.hcount-1:userObj.hcount,(songObj.difficulty=="EX")?userObj.excount-1:userObj.excount,(songObj.difficulty=="EXEX")?userObj.exexcount-1:userObj.exexcount]);*/return db.query("update users set rating=$1,playcount=$2,fccount=$3,cool=$4,fine=$5,safe=$6,sad=$7,worst=$8,eclear=$9,nclear=$10,hclear=$11,exclear=$12,exexclear=$13 where id=$14 returning rating,playcount,fccount,cool,fine,safe,sad,worst,eclear,nclear,hclear,exclear,exexclear",[rating,userObj.playcount-1,(songObj.safe==0&&songObj.sad==0&&songObj.worst==0)?userObj.fccount-1:userObj.fccount,userObj.cool-songObj.cool,userObj.fine-songObj.fine,userObj.safe-songObj.safe,userObj.sad-songObj.sad,userObj.worst-songObj.worst,(songObj.difficulty=="E" && isFirstClear)?userObj.eclear-1:userObj.eclear,(songObj.difficulty=="N" && isFirstClear)?userObj.nclear-1:userObj.nclear,(songObj.difficulty=="H" && isFirstClear)?userObj.hclear-1:userObj.hclear,(songObj.difficulty=="EX" && isFirstClear)?userObj.exclear-1:userObj.exclear,(songObj.difficulty=="EXEX" && isFirstClear)?userObj.exexclear-1:userObj.exexclear,userObj.id])}) .then((data)=>{if(data && data.rows.length>0){res.status(200).json({user:data.rows[0],song:songObj})}else{throw new Error("Could not update user information, but song is deleted!")}}) .catch((err)=>{res.status(500).json(err.message)}) @@ -207,7 +207,13 @@ app.post('/upload', function(req, res) { app.post('/submit', (req, res) => { if (req.body && - req.body.username!==undefined && req.body.authentication_token!==undefined && req.body.song!==undefined && req.body.difficulty!==undefined && req.body.cool!==undefined && req.body.fine!==undefined && req.body.safe!==undefined && req.body.sad!==undefined && req.body.worst!==undefined && req.body.percent!==undefined) { + req.body.username!==undefined && req.body.authentication_token!==undefined && req.body.song!==undefined && req.body.difficulty!==undefined && req.body.cool!==undefined && req.body.fine!==undefined && req.body.safe!==undefined && req.body.sad!==undefined && req.body.worst!==undefined && req.body.fail!==undefined && req.body.percent!==undefined) { + + if (req.body.cool==-1||req.body.fine==-1||req.body.safe==-1||req.body.sad==-1||req.body.worst==-1) { + fs.writeFileSync("invalidSongs",JSON.stringify(req.body)+"\n","a"); + res.status(400).json("Invalid note parameters!"); + } + var fail = true; if (req.body.fail!==undefined) { fail = (req.body.fail=='true'); @@ -263,8 +269,11 @@ app.post('/submit', (req, res) => { CalculateSongScore=(song)=>{ if (song.fail==true){return 0;} - var noteCount=song.cool+song.fine+song.safe+song.sad+song.worst; - var comboBreaks=song.safe+song.sad+song.worst; + var noteCount=Number(song.cool)+Number(song.fine)+Number(song.safe)+Number(song.sad)+Number(song.worst); + var comboBreaks=Number(song.safe)+Number(song.sad)+Number(song.worst); + /*console.log("Combo Breaks: "+comboBreaks) + console.log("Is FC? "+(comboBreaks===0)) + console.log("Is PFC? "+(song.fine===0&&song.safe===0&&song.sad===0&&song.worst===0))*/ var scoreMult=1; var percentMult=1; if (song.fine===0&&song.safe===0&&song.sad===0&&song.worst===0){scoreMult=3}else if(comboBreaks===0){scoreMult=2}else{scoreMult=1} @@ -278,6 +287,8 @@ CalculateSongScore=(song)=>{ if(song.percent<60){percentMult=0}else{percentMult=1+(0.4*((song.percent-60)/40.0))} } } + /*console.log("Score mult: "+scoreMult) + console.log("Percent mult: "+percentMult)*/ var score = ((song.cool*100+song.fine*50+song.safe*10+song.sad*5)/1000.0)*percentMult*scoreMult if (scoreMult>0 && percentMult>0) { score += Math.pow(song.rating,3)/5 @@ -345,7 +356,8 @@ app.get('/recalculatescore/:playid',(req,res)=>{ .then((data)=>res.status(200).json(data)).catch((err)=>{console.log(err);res.status(500).json(err.message);}) }); -/*app.get('/playdata',(req,res)=>{ +/* +app.get('/playdata',(req,res)=>{ db.query('select * from plays') .then((data)=>{res.status(200).json(data.rows)}) .catch((err)=>res.status(500).json(err.message)) @@ -430,9 +442,33 @@ app.get('/bestplay/:username/:songname/:difficulty',(req,res)=>{ }) app.get('/userdata/:username',(req,res)=>{ - var songId=-1,userId=-1; + var songId=-1,userId=-1,finalData={}; db.query('select playcount,fccount,rating,last_played,cool,fine,safe,sad,worst,eclear,nclear,hclear,exclear,exexclear from users where username=$1 limit 1',[req.params.username]) - .then((data)=>{if(data && data.rows.length>0){res.status(200).json(data.rows[0])}}) + .then((data)=>{if(data && data.rows.length>0){finalData=data.rows[0];return db.query("select t.difficulty,COUNT(t.difficulty) from (select distinct on(songid) songid,*,users.id from plays join users on userid=users.id where users.username=$1 and plays.safe=0 and plays.worst=0 and plays.sad=0)t group by t.difficulty",[req.params.username])}else{throw new Error("Could not retrieve user data!")}}) + .then((data)=>{ + if (data) { + var fcData={} + data.rows.forEach((fc)=>{fcData[fc.difficulty]=fc.count}) + finalData={...{fcdata:fcData},...finalData} + return db.query("select t.difficulty,COUNT(t.difficulty) from (select distinct on(songid) songid,*,users.id from plays join users on userid=users.id where users.username=$1 and plays.fine=0 and plays.safe=0 and plays.worst=0 and plays.sad=0)t group by t.difficulty",[req.params.username]) + }else{throw new Error("Could not retrieve user data!")} + }) + .then((data)=>{ + if (data) { + var fcData={} + data.rows.forEach((fc)=>{fcData[fc.difficulty]=fc.count}) + finalData={...{pfcdata:fcData},...finalData} + res.status(200).json(finalData) + }else{throw new Error("Could not retrieve user data!")} + }) + .catch((err)=>{res.status(500).json(err.message)}) +}) + +app.get('/plays/:username/:songid',(req,res)=>{ + db.query("select plays.* from plays join users on users.id=plays.userid where users.username=$1 and plays.songid=$2 order by score desc,date desc limit 100",[req.params.username,req.params.songid]) + .then((data)=>{ + res.status(200).json(data.rows) + }) .catch((err)=>{res.status(500).json(err.message)}) }) @@ -519,6 +555,135 @@ app.get('/users/:orderby/:sortorder',(req,res)=>{ res.status(400).json("Invalid query!") } }) + +function ValidateToken(username,token) { + return db.query('select authentication_token from users where username=$1 limit 1',[username]) + .then((data)=>{ + if (data.rows.length>0) { + return token===data.rows[0].authentication_token; + } else { + return false; + } + }) +} + +function GetSongId(songname) { + return db.query("select id from songs where name=$1 or romanized_name=$1 or english_name=$1 limit 1",[songname]) + .then((data)=>{ + if (data.rows.length>0) { + return data.rows[0].id; + } else { + throw new Error("Could not get song ID for song '"+songname+"'") + } + }) +} + +function GetNoteCount(songname,difficulty) { + var songID=-1; + return GetSongId(songname) + .then((id)=>{songID=id;return db.query("select notecount from songdata where songid=$1 and difficulty=$2 limit 1",[songID,difficulty])}) + .then((data)=>{ + if (data.rows.length>0) { + return data.rows[0].notecount; + } else { + throw new Error("Could not get note count for song '"+songname+"' on difficulty '"+difficulty+"'") + } + }) +} + +app.post('/song/:songname/:difficulty',(req,res)=>{ + if (req.body&&req.params.songname&&req.params.difficulty&&req.body.username&&req.body.percent&&req.body.authentication_token) { + var noteCount=0,songID=0,fail=false; + ValidateToken(req.body.username,req.body.authentication_token) + .then((allowed)=>{ + if (allowed) { + return GetSongId(req.params.songname) + }else{throw new Error("Could not authenticate!")} + }) + .then((songId)=>{ + if (songId) { + songID=songId; + return GetNoteCount(req.params.songname,req.params.difficulty) + }else{throw new Error("Could not find song ID!")} + }) + .then((noteCount)=>{ + var percentThreshold=(req.params.difficulty==="E"?100:107)/100.0 + var percent=(req.params.difficulty==="E"?100:107)?Math.min(req.body.percent/100.0,percentThreshold):Math.min(req.body.percent/107.0,percentThreshold); + var cool = 0; + var fine = 0; + var safe = 0; + var sad = 0; + var worst = 0; + for (var i=0;i{ + res.status(200).json(data.data) + }) + .catch((err)=>{res.status(400).json(err.message)}) + } else { + res.status(400).json("Invalid query!") + } +}) + /* app.get('/twitter/mentions', function(req, res) { if (req.query.data) { diff --git a/server/node_modules/express-fileupload/lib/processNested.js b/server/node_modules/express-fileupload/lib/processNested.js index 83ef371..1661b0f 100644 --- a/server/node_modules/express-fileupload/lib/processNested.js +++ b/server/node_modules/express-fileupload/lib/processNested.js @@ -1,3 +1,5 @@ +const INVALID_KEYS = ['__proto__', 'constructor']; + module.exports = function(data){ if (!data || data.length < 1) return {}; @@ -11,10 +13,16 @@ module.exports = function(data){ keyParts = key .replace(new RegExp(/\[/g), '.') .replace(new RegExp(/\]/g), '') - .split('.'); - + .split('.'); + for (let index = 0; index < keyParts.length; index++){ let k = keyParts[index]; + + // Ensure we don't allow prototype pollution + if (INVALID_KEYS.includes(k)) { + continue; + } + if (index >= keyParts.length - 1){ current[k] = value; } else { diff --git a/server/node_modules/express-fileupload/package.json b/server/node_modules/express-fileupload/package.json index ba00c22..83a6827 100644 --- a/server/node_modules/express-fileupload/package.json +++ b/server/node_modules/express-fileupload/package.json @@ -1,27 +1,27 @@ { - "_from": "express-fileupload", - "_id": "express-fileupload@1.1.7-alpha.4", + "_from": "express-fileupload@1.1.9", + "_id": "express-fileupload@1.1.9", "_inBundle": false, - "_integrity": "sha512-uNl/TB3adUH25cDRp1gDoXQ38SdIZXOAVzC54G/xnOAa4M3maBWiZTVz39cnoQ7TXhmYXYpnOfMDMbqSelXFmQ==", + "_integrity": "sha512-f2w0aoe7lj3NeD8a4MXmYQsqir3Z66I08l9AKq04QbFUAjeZNmPwTlR5Lx2NGwSu/PslsAjGC38MWzo5tTjoBg==", "_location": "/express-fileupload", "_phantomChildren": {}, "_requested": { - "type": "tag", + "type": "version", "registry": true, - "raw": "express-fileupload", + "raw": "express-fileupload@1.1.9", "name": "express-fileupload", "escapedName": "express-fileupload", - "rawSpec": "", + "rawSpec": "1.1.9", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "1.1.9" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/express-fileupload/-/express-fileupload-1.1.7-alpha.4.tgz", - "_shasum": "c87dcb7880fe2e5a1d15ea97a225719c5ac0a30d", - "_spec": "express-fileupload", + "_resolved": "https://registry.npmjs.org/express-fileupload/-/express-fileupload-1.1.9.tgz", + "_shasum": "e798e9318394ed5083e56217ad6cda576da465d2", + "_spec": "express-fileupload@1.1.9", "_where": "/home/sigonasr2/divar/server", "author": { "name": "Richard Girges", @@ -39,11 +39,11 @@ "devDependencies": { "body-parser": "^1.19.0", "coveralls": "^3.0.14", - "eslint": "^6.8.0", + "eslint": "^7.5.0", "express": "^4.17.1", "istanbul": "^0.4.5", "md5": "^2.2.1", - "mocha": "^7.2.0", + "mocha": "^8.0.1", "rimraf": "^3.0.2", "supertest": "^4.0.2" }, @@ -73,5 +73,5 @@ "lint": "eslint ./", "test": "istanbul cover node_modules/mocha/bin/_mocha -- -R spec" }, - "version": "1.1.7-alpha.4" + "version": "1.1.9" } diff --git a/server/node_modules/express-fileupload/test/processNested.spec.js b/server/node_modules/express-fileupload/test/processNested.spec.js index b9b636d..d9e18bd 100644 --- a/server/node_modules/express-fileupload/test/processNested.spec.js +++ b/server/node_modules/express-fileupload/test/processNested.spec.js @@ -45,4 +45,15 @@ describe('Test Convert Flatten object to Nested object', function() { assert.deepEqual(processed, excerpt); }); + + it('Do not allow prototype pollution', () => { + const pollutionOb1 = JSON.parse(`{"__proto__.POLLUTED1": "FOOBAR"}`); + const pollutionOb2 = JSON.parse(`{"constructor.prototype.POLLUTED2": "FOOBAR"}`); + + processNested(pollutionOb1); + processNested(pollutionOb2); + + assert.equal(global.POLLUTED1, undefined); + assert.equal(global.POLLUTED2, undefined); + }); }); diff --git a/server/package-lock.json b/server/package-lock.json index 3606292..0e74b59 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -517,9 +517,9 @@ } }, "express-fileupload": { - "version": "1.1.7-alpha.4", - "resolved": "https://registry.npmjs.org/express-fileupload/-/express-fileupload-1.1.7-alpha.4.tgz", - "integrity": "sha512-uNl/TB3adUH25cDRp1gDoXQ38SdIZXOAVzC54G/xnOAa4M3maBWiZTVz39cnoQ7TXhmYXYpnOfMDMbqSelXFmQ==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/express-fileupload/-/express-fileupload-1.1.9.tgz", + "integrity": "sha512-f2w0aoe7lj3NeD8a4MXmYQsqir3Z66I08l9AKq04QbFUAjeZNmPwTlR5Lx2NGwSu/PslsAjGC38MWzo5tTjoBg==", "requires": { "busboy": "^0.3.1" } diff --git a/server/package.json b/server/package.json index b61dcfb..cdbb6aa 100644 --- a/server/package.json +++ b/server/package.json @@ -13,7 +13,7 @@ "connect-timeout": "^1.9.0", "crypto": "^1.0.1", "express": "^4.17.1", - "express-fileupload": "^1.1.7-alpha.4", + "express-fileupload": "^1.1.9", "get-pixels": "^3.3.2", "image-pixels": "^2.2.2", "pg": "^8.2.1", diff --git a/updateNoteCounts.sql b/updateNoteCounts.sql new file mode 100644 index 0000000..802a67e --- /dev/null +++ b/updateNoteCounts.sql @@ -0,0 +1,753 @@ +update songdata set notecount=290 where songid=1 and difficulty='E'; +update songdata set notecount=253 where songid=2 and difficulty='E'; +update songdata set notecount=312 where songid=3 and difficulty='E'; +update songdata set notecount=350 where songid=4 and difficulty='E'; +update songdata set notecount=400 where songid=5 and difficulty='E'; +update songdata set notecount=263 where songid=6 and difficulty='E'; +update songdata set notecount=370 where songid=7 and difficulty='E'; +update songdata set notecount=236 where songid=8 and difficulty='E'; +update songdata set notecount=310 where songid=9 and difficulty='E'; +update songdata set notecount=287 where songid=10 and difficulty='E'; +update songdata set notecount=322 where songid=11 and difficulty='E'; +update songdata set notecount=305 where songid=12 and difficulty='E'; + +update songdata set notecount=199 where songid=14 and difficulty='E'; +update songdata set notecount=273 where songid=15 and difficulty='E'; + +update songdata set notecount=147 where songid=17 and difficulty='E'; +update songdata set notecount=346 where songid=18 and difficulty='E'; +update songdata set notecount=305 where songid=19 and difficulty='E'; +update songdata set notecount=225 where songid=20 and difficulty='E'; +update songdata set notecount=345 where songid=21 and difficulty='E'; +update songdata set notecount=276 where songid=22 and difficulty='E'; +update songdata set notecount=310 where songid=23 and difficulty='E'; +update songdata set notecount=300 where songid=24 and difficulty='E'; +update songdata set notecount=276 where songid=25 and difficulty='E'; +update songdata set notecount=250 where songid=26 and difficulty='E'; +update songdata set notecount=260 where songid=27 and difficulty='E'; +update songdata set notecount=343 where songid=28 and difficulty='E'; +update songdata set notecount=216 where songid=29 and difficulty='E'; + +update songdata set notecount=340 where songid=31 and difficulty='E'; +update songdata set notecount=279 where songid=32 and difficulty='E'; +update songdata set notecount=389 where songid=33 and difficulty='E'; +update songdata set notecount=316 where songid=34 and difficulty='E'; + + + + +update songdata set notecount=282 where songid=39 and difficulty='E'; +update songdata set notecount=275 where songid=40 and difficulty='E'; +update songdata set notecount=381 where songid=41 and difficulty='E'; +update songdata set notecount=374 where songid=42 and difficulty='E'; + +update songdata set notecount=394 where songid=44 and difficulty='E'; +update songdata set notecount=268 where songid=45 and difficulty='E'; +update songdata set notecount=157 where songid=46 and difficulty='E'; + +update songdata set notecount=315 where songid=48 and difficulty='E'; +update songdata set notecount=289 where songid=49 and difficulty='E'; +update songdata set notecount=302 where songid=50 and difficulty='E'; +update songdata set notecount=416 where songid=51 and difficulty='E'; +update songdata set notecount=233 where songid=52 and difficulty='E'; +update songdata set notecount=371 where songid=53 and difficulty='E'; +update songdata set notecount=318 where songid=54 and difficulty='E'; + + +update songdata set notecount=362 where songid=57 and difficulty='E'; + + +update songdata set notecount=275 where songid=60 and difficulty='E'; +update songdata set notecount=212 where songid=61 and difficulty='E'; +update songdata set notecount=204 where songid=62 and difficulty='E'; + +update songdata set notecount=246 where songid=64 and difficulty='E'; +update songdata set notecount=414 where songid=65 and difficulty='E'; +update songdata set notecount=216 where songid=66 and difficulty='E'; + +update songdata set notecount=399 where songid=68 and difficulty='E'; +update songdata set notecount=337 where songid=69 and difficulty='E'; +update songdata set notecount=406 where songid=70 and difficulty='E'; +update songdata set notecount=288 where songid=71 and difficulty='E'; +update songdata set notecount=339 where songid=72 and difficulty='E'; +update songdata set notecount=251 where songid=73 and difficulty='E'; +update songdata set notecount=280 where songid=74 and difficulty='E'; +update songdata set notecount=226 where songid=75 and difficulty='E'; +update songdata set notecount=274 where songid=76 and difficulty='E'; +update songdata set notecount=299 where songid=77 and difficulty='E'; +update songdata set notecount=377 where songid=78 and difficulty='E'; +update songdata set notecount=330 where songid=79 and difficulty='E'; +update songdata set notecount=322 where songid=80 and difficulty='E'; +update songdata set notecount=261 where songid=81 and difficulty='E'; +update songdata set notecount=231 where songid=82 and difficulty='E'; + +update songdata set notecount=265 where songid=84 and difficulty='E'; +update songdata set notecount=404 where songid=85 and difficulty='E'; +update songdata set notecount=363 where songid=86 and difficulty='E'; +update songdata set notecount=368 where songid=87 and difficulty='E'; +update songdata set notecount=250 where songid=88 and difficulty='E'; +update songdata set notecount=164 where songid=89 and difficulty='E'; +update songdata set notecount=246 where songid=90 and difficulty='E'; +update songdata set notecount=420 where songid=91 and difficulty='E'; +update songdata set notecount=416 where songid=92 and difficulty='E'; +update songdata set notecount=361 where songid=93 and difficulty='E'; +update songdata set notecount=348 where songid=94 and difficulty='E'; +update songdata set notecount=199 where songid=95 and difficulty='E'; + +update songdata set notecount=392 where songid=97 and difficulty='E'; + +update songdata set notecount=321 where songid=99 and difficulty='E'; +update songdata set notecount=388 where songid=100 and difficulty='E'; +update songdata set notecount=388 where songid=101 and difficulty='E'; +update songdata set notecount=276 where songid=102 and difficulty='E'; +update songdata set notecount=369 where songid=103 and difficulty='E'; +update songdata set notecount=336 where songid=104 and difficulty='E'; +update songdata set notecount=330 where songid=105 and difficulty='E'; + +update songdata set notecount=284 where songid=107 and difficulty='E'; +update songdata set notecount=305 where songid=108 and difficulty='E'; +update songdata set notecount=363 where songid=109 and difficulty='E'; +update songdata set notecount=213 where songid=110 and difficulty='E'; +update songdata set notecount=208 where songid=111 and difficulty='E'; +update songdata set notecount=340 where songid=112 and difficulty='E'; + + + +update songdata set notecount=292 where songid=116 and difficulty='E'; + +update songdata set notecount=291 where songid=118 and difficulty='E'; +update songdata set notecount=228 where songid=119 and difficulty='E'; +update songdata set notecount=348 where songid=120 and difficulty='E'; +update songdata set notecount=270 where songid=121 and difficulty='E'; +update songdata set notecount=239 where songid=122 and difficulty='E'; + +update songdata set notecount=332 where songid=124 and difficulty='E'; +update songdata set notecount=227 where songid=125 and difficulty='E'; +update songdata set notecount=286 where songid=126 and difficulty='E'; +update songdata set notecount=358 where songid=127 and difficulty='E'; + + +update songdata set notecount=251 where songid=130 and difficulty='E'; +update songdata set notecount=249 where songid=131 and difficulty='E'; +update songdata set notecount=329 where songid=132 and difficulty='E'; +update songdata set notecount=335 where songid=133 and difficulty='E'; +update songdata set notecount=288 where songid=134 and difficulty='E'; +update songdata set notecount=285 where songid=135 and difficulty='E'; +update songdata set notecount=327 where songid=136 and difficulty='E'; +update songdata set notecount=285 where songid=137 and difficulty='E'; + +update songdata set notecount=265 where songid=139 and difficulty='E'; +update songdata set notecount=346 where songid=140 and difficulty='E'; +update songdata set notecount=174 where songid=141 and difficulty='E'; +update songdata set notecount=328 where songid=142 and difficulty='E'; +update songdata set notecount=241 where songid=143 and difficulty='E'; + +update songdata set notecount=135 where songid=145 and difficulty='E'; + +update songdata set notecount=310 where songid=147 and difficulty='E'; + +update songdata set notecount=291 where songid=149 and difficulty='E'; + +update songdata set notecount=290 where songid=1 and difficulty='N'; +update songdata set notecount=253 where songid=2 and difficulty='N'; +update songdata set notecount=312 where songid=3 and difficulty='N'; +update songdata set notecount=350 where songid=4 and difficulty='N'; +update songdata set notecount=400 where songid=5 and difficulty='N'; +update songdata set notecount=263 where songid=6 and difficulty='N'; +update songdata set notecount=370 where songid=7 and difficulty='N'; +update songdata set notecount=236 where songid=8 and difficulty='N'; +update songdata set notecount=310 where songid=9 and difficulty='N'; +update songdata set notecount=287 where songid=10 and difficulty='N'; +update songdata set notecount=322 where songid=11 and difficulty='N'; +update songdata set notecount=305 where songid=12 and difficulty='N'; +update songdata set notecount= where songid=13 and difficulty='N'; +update songdata set notecount=199 where songid=14 and difficulty='N'; +update songdata set notecount=273 where songid=15 and difficulty='N'; +update songdata set notecount= where songid=16 and difficulty='N'; +update songdata set notecount=147 where songid=17 and difficulty='N'; +update songdata set notecount=346 where songid=18 and difficulty='N'; +update songdata set notecount=305 where songid=19 and difficulty='N'; +update songdata set notecount=225 where songid=20 and difficulty='N'; +update songdata set notecount=345 where songid=21 and difficulty='N'; +update songdata set notecount=276 where songid=22 and difficulty='N'; +update songdata set notecount=310 where songid=23 and difficulty='N'; +update songdata set notecount=300 where songid=24 and difficulty='N'; +update songdata set notecount=276 where songid=25 and difficulty='N'; +update songdata set notecount=250 where songid=26 and difficulty='N'; +update songdata set notecount=260 where songid=27 and difficulty='N'; +update songdata set notecount=343 where songid=28 and difficulty='N'; +update songdata set notecount=216 where songid=29 and difficulty='N'; +update songdata set notecount= where songid=30 and difficulty='N'; +update songdata set notecount=340 where songid=31 and difficulty='N'; +update songdata set notecount=279 where songid=32 and difficulty='N'; +update songdata set notecount=389 where songid=33 and difficulty='N'; +update songdata set notecount=316 where songid=34 and difficulty='N'; +update songdata set notecount= where songid=35 and difficulty='N'; +update songdata set notecount= where songid=36 and difficulty='N'; +update songdata set notecount= where songid=37 and difficulty='N'; +update songdata set notecount= where songid=38 and difficulty='N'; +update songdata set notecount=282 where songid=39 and difficulty='N'; +update songdata set notecount=275 where songid=40 and difficulty='N'; +update songdata set notecount=381 where songid=41 and difficulty='N'; +update songdata set notecount=374 where songid=42 and difficulty='N'; +update songdata set notecount= where songid=43 and difficulty='N'; +update songdata set notecount=394 where songid=44 and difficulty='N'; +update songdata set notecount=268 where songid=45 and difficulty='N'; +update songdata set notecount=157 where songid=46 and difficulty='N'; +update songdata set notecount= where songid=47 and difficulty='N'; +update songdata set notecount=315 where songid=48 and difficulty='N'; +update songdata set notecount=289 where songid=49 and difficulty='N'; +update songdata set notecount=302 where songid=50 and difficulty='N'; +update songdata set notecount=416 where songid=51 and difficulty='N'; +update songdata set notecount=233 where songid=52 and difficulty='N'; +update songdata set notecount=371 where songid=53 and difficulty='N'; +update songdata set notecount=318 where songid=54 and difficulty='N'; +update songdata set notecount= where songid=55 and difficulty='N'; +update songdata set notecount= where songid=56 and difficulty='N'; +update songdata set notecount=362 where songid=57 and difficulty='N'; +update songdata set notecount= where songid=58 and difficulty='N'; +update songdata set notecount= where songid=59 and difficulty='N'; +update songdata set notecount=275 where songid=60 and difficulty='N'; +update songdata set notecount=212 where songid=61 and difficulty='N'; +update songdata set notecount=204 where songid=62 and difficulty='N'; +update songdata set notecount= where songid=63 and difficulty='N'; +update songdata set notecount=246 where songid=64 and difficulty='N'; +update songdata set notecount=414 where songid=65 and difficulty='N'; +update songdata set notecount=216 where songid=66 and difficulty='N'; +update songdata set notecount= where songid=67 and difficulty='N'; +update songdata set notecount=399 where songid=68 and difficulty='N'; +update songdata set notecount=337 where songid=69 and difficulty='N'; +update songdata set notecount=406 where songid=70 and difficulty='N'; +update songdata set notecount=288 where songid=71 and difficulty='N'; +update songdata set notecount=339 where songid=72 and difficulty='N'; +update songdata set notecount=251 where songid=73 and difficulty='N'; +update songdata set notecount=280 where songid=74 and difficulty='N'; +update songdata set notecount=226 where songid=75 and difficulty='N'; +update songdata set notecount=274 where songid=76 and difficulty='N'; +update songdata set notecount=299 where songid=77 and difficulty='N'; +update songdata set notecount=377 where songid=78 and difficulty='N'; +update songdata set notecount=330 where songid=79 and difficulty='N'; +update songdata set notecount=322 where songid=80 and difficulty='N'; +update songdata set notecount=261 where songid=81 and difficulty='N'; +update songdata set notecount=231 where songid=82 and difficulty='N'; +update songdata set notecount= where songid=83 and difficulty='N'; +update songdata set notecount=265 where songid=84 and difficulty='N'; +update songdata set notecount=404 where songid=85 and difficulty='N'; +update songdata set notecount=363 where songid=86 and difficulty='N'; +update songdata set notecount=368 where songid=87 and difficulty='N'; +update songdata set notecount=250 where songid=88 and difficulty='N'; +update songdata set notecount=164 where songid=89 and difficulty='N'; +update songdata set notecount=246 where songid=90 and difficulty='N'; +update songdata set notecount=420 where songid=91 and difficulty='N'; +update songdata set notecount=416 where songid=92 and difficulty='N'; +update songdata set notecount=361 where songid=93 and difficulty='N'; +update songdata set notecount=348 where songid=94 and difficulty='N'; +update songdata set notecount=199 where songid=95 and difficulty='N'; +update songdata set notecount= where songid=96 and difficulty='N'; +update songdata set notecount=392 where songid=97 and difficulty='N'; +update songdata set notecount= where songid=98 and difficulty='N'; +update songdata set notecount=321 where songid=99 and difficulty='N'; +update songdata set notecount=388 where songid=100 and difficulty='N'; +update songdata set notecount=388 where songid=101 and difficulty='N'; +update songdata set notecount=276 where songid=102 and difficulty='N'; +update songdata set notecount=369 where songid=103 and difficulty='N'; +update songdata set notecount=336 where songid=104 and difficulty='N'; +update songdata set notecount=330 where songid=105 and difficulty='N'; +update songdata set notecount= where songid=106 and difficulty='N'; +update songdata set notecount=284 where songid=107 and difficulty='N'; +update songdata set notecount=305 where songid=108 and difficulty='N'; +update songdata set notecount=363 where songid=109 and difficulty='N'; +update songdata set notecount=213 where songid=110 and difficulty='N'; +update songdata set notecount=208 where songid=111 and difficulty='N'; +update songdata set notecount=340 where songid=112 and difficulty='N'; +update songdata set notecount= where songid=113 and difficulty='N'; +update songdata set notecount= where songid=114 and difficulty='N'; +update songdata set notecount= where songid=115 and difficulty='N'; +update songdata set notecount=292 where songid=116 and difficulty='N'; +update songdata set notecount= where songid=117 and difficulty='N'; +update songdata set notecount=291 where songid=118 and difficulty='N'; + +update songdata set notecount=348 where songid=120 and difficulty='N'; +update songdata set notecount=270 where songid=121 and difficulty='N'; +update songdata set notecount=239 where songid=122 and difficulty='N'; +update songdata set notecount= where songid=123 and difficulty='N'; +update songdata set notecount=332 where songid=124 and difficulty='N'; + +update songdata set notecount=286 where songid=126 and difficulty='N'; +update songdata set notecount=358 where songid=127 and difficulty='N'; +update songdata set notecount= where songid=128 and difficulty='N'; +update songdata set notecount= where songid=129 and difficulty='N'; +update songdata set notecount=251 where songid=130 and difficulty='N'; +update songdata set notecount=249 where songid=131 and difficulty='N'; +update songdata set notecount=329 where songid=132 and difficulty='N'; +update songdata set notecount=335 where songid=133 and difficulty='N'; +update songdata set notecount=288 where songid=134 and difficulty='N'; +update songdata set notecount=285 where songid=135 and difficulty='N'; +update songdata set notecount=327 where songid=136 and difficulty='N'; +update songdata set notecount=285 where songid=137 and difficulty='N'; +update songdata set notecount= where songid=138 and difficulty='N'; +update songdata set notecount=265 where songid=139 and difficulty='N'; +update songdata set notecount=346 where songid=140 and difficulty='N'; +update songdata set notecount=174 where songid=141 and difficulty='N'; +update songdata set notecount=328 where songid=142 and difficulty='N'; +update songdata set notecount=241 where songid=143 and difficulty='N'; +update songdata set notecount= where songid=144 and difficulty='N'; +update songdata set notecount=135 where songid=145 and difficulty='N'; +update songdata set notecount= where songid=146 and difficulty='N'; +update songdata set notecount=310 where songid=147 and difficulty='N'; +update songdata set notecount= where songid=148 and difficulty='N'; +update songdata set notecount=291 where songid=149 and difficulty='N'; +update songdata set notecount= where songid=150 and difficulty='N'; +update songdata set notecount= where songid=151 and difficulty='N'; +update songdata set notecount=290 where songid=1 and difficulty='H'; +update songdata set notecount=253 where songid=2 and difficulty='H'; +update songdata set notecount=312 where songid=3 and difficulty='H'; +update songdata set notecount=350 where songid=4 and difficulty='H'; +update songdata set notecount=400 where songid=5 and difficulty='H'; +update songdata set notecount=263 where songid=6 and difficulty='H'; +update songdata set notecount=370 where songid=7 and difficulty='H'; +update songdata set notecount=236 where songid=8 and difficulty='H'; +update songdata set notecount=310 where songid=9 and difficulty='H'; +update songdata set notecount=287 where songid=10 and difficulty='H'; +update songdata set notecount=322 where songid=11 and difficulty='H'; +update songdata set notecount=305 where songid=12 and difficulty='H'; +update songdata set notecount= where songid=13 and difficulty='H'; +update songdata set notecount=199 where songid=14 and difficulty='H'; +update songdata set notecount=273 where songid=15 and difficulty='H'; +update songdata set notecount= where songid=16 and difficulty='H'; +update songdata set notecount=147 where songid=17 and difficulty='H'; +update songdata set notecount=346 where songid=18 and difficulty='H'; +update songdata set notecount=305 where songid=19 and difficulty='H'; +update songdata set notecount=225 where songid=20 and difficulty='H'; +update songdata set notecount=345 where songid=21 and difficulty='H'; +update songdata set notecount=276 where songid=22 and difficulty='H'; +update songdata set notecount=310 where songid=23 and difficulty='H'; +update songdata set notecount=300 where songid=24 and difficulty='H'; +update songdata set notecount=276 where songid=25 and difficulty='H'; +update songdata set notecount=250 where songid=26 and difficulty='H'; +update songdata set notecount=260 where songid=27 and difficulty='H'; +update songdata set notecount=343 where songid=28 and difficulty='H'; +update songdata set notecount=216 where songid=29 and difficulty='H'; +update songdata set notecount= where songid=30 and difficulty='H'; +update songdata set notecount=340 where songid=31 and difficulty='H'; +update songdata set notecount=279 where songid=32 and difficulty='H'; +update songdata set notecount=389 where songid=33 and difficulty='H'; +update songdata set notecount=316 where songid=34 and difficulty='H'; +update songdata set notecount= where songid=35 and difficulty='H'; +update songdata set notecount= where songid=36 and difficulty='H'; +update songdata set notecount= where songid=37 and difficulty='H'; +update songdata set notecount= where songid=38 and difficulty='H'; +update songdata set notecount=282 where songid=39 and difficulty='H'; +update songdata set notecount=275 where songid=40 and difficulty='H'; +update songdata set notecount=381 where songid=41 and difficulty='H'; +update songdata set notecount=374 where songid=42 and difficulty='H'; +update songdata set notecount= where songid=43 and difficulty='H'; +update songdata set notecount=394 where songid=44 and difficulty='H'; +update songdata set notecount=268 where songid=45 and difficulty='H'; +update songdata set notecount=157 where songid=46 and difficulty='H'; +update songdata set notecount= where songid=47 and difficulty='H'; +update songdata set notecount=315 where songid=48 and difficulty='H'; +update songdata set notecount=289 where songid=49 and difficulty='H'; +update songdata set notecount=302 where songid=50 and difficulty='H'; +update songdata set notecount=416 where songid=51 and difficulty='H'; +update songdata set notecount=233 where songid=52 and difficulty='H'; +update songdata set notecount=371 where songid=53 and difficulty='H'; +update songdata set notecount=318 where songid=54 and difficulty='H'; +update songdata set notecount= where songid=55 and difficulty='H'; +update songdata set notecount= where songid=56 and difficulty='H'; +update songdata set notecount=362 where songid=57 and difficulty='H'; +update songdata set notecount= where songid=58 and difficulty='H'; +update songdata set notecount= where songid=59 and difficulty='H'; +update songdata set notecount=275 where songid=60 and difficulty='H'; +update songdata set notecount=212 where songid=61 and difficulty='H'; +update songdata set notecount=204 where songid=62 and difficulty='H'; +update songdata set notecount= where songid=63 and difficulty='H'; +update songdata set notecount=246 where songid=64 and difficulty='H'; +update songdata set notecount=414 where songid=65 and difficulty='H'; +update songdata set notecount=216 where songid=66 and difficulty='H'; +update songdata set notecount= where songid=67 and difficulty='H'; +update songdata set notecount=399 where songid=68 and difficulty='H'; +update songdata set notecount=337 where songid=69 and difficulty='H'; +update songdata set notecount=406 where songid=70 and difficulty='H'; +update songdata set notecount=288 where songid=71 and difficulty='H'; +update songdata set notecount=339 where songid=72 and difficulty='H'; +update songdata set notecount=251 where songid=73 and difficulty='H'; +update songdata set notecount=280 where songid=74 and difficulty='H'; +update songdata set notecount=226 where songid=75 and difficulty='H'; +update songdata set notecount=274 where songid=76 and difficulty='H'; +update songdata set notecount=299 where songid=77 and difficulty='H'; +update songdata set notecount=377 where songid=78 and difficulty='H'; +update songdata set notecount=330 where songid=79 and difficulty='H'; +update songdata set notecount=322 where songid=80 and difficulty='H'; +update songdata set notecount=261 where songid=81 and difficulty='H'; +update songdata set notecount=231 where songid=82 and difficulty='H'; +update songdata set notecount= where songid=83 and difficulty='H'; +update songdata set notecount=265 where songid=84 and difficulty='H'; +update songdata set notecount=404 where songid=85 and difficulty='H'; +update songdata set notecount=363 where songid=86 and difficulty='H'; +update songdata set notecount=368 where songid=87 and difficulty='H'; +update songdata set notecount=250 where songid=88 and difficulty='H'; +update songdata set notecount=164 where songid=89 and difficulty='H'; +update songdata set notecount=246 where songid=90 and difficulty='H'; +update songdata set notecount=420 where songid=91 and difficulty='H'; +update songdata set notecount=416 where songid=92 and difficulty='H'; +update songdata set notecount=361 where songid=93 and difficulty='H'; +update songdata set notecount=348 where songid=94 and difficulty='H'; +update songdata set notecount=199 where songid=95 and difficulty='H'; +update songdata set notecount= where songid=96 and difficulty='H'; +update songdata set notecount=392 where songid=97 and difficulty='H'; +update songdata set notecount= where songid=98 and difficulty='H'; +update songdata set notecount=321 where songid=99 and difficulty='H'; +update songdata set notecount=388 where songid=100 and difficulty='H'; +update songdata set notecount=388 where songid=101 and difficulty='H'; +update songdata set notecount=276 where songid=102 and difficulty='H'; +update songdata set notecount=369 where songid=103 and difficulty='H'; +update songdata set notecount=336 where songid=104 and difficulty='H'; +update songdata set notecount=330 where songid=105 and difficulty='H'; +update songdata set notecount= where songid=106 and difficulty='H'; +update songdata set notecount=284 where songid=107 and difficulty='H'; +update songdata set notecount=305 where songid=108 and difficulty='H'; +update songdata set notecount=363 where songid=109 and difficulty='H'; +update songdata set notecount=213 where songid=110 and difficulty='H'; +update songdata set notecount=208 where songid=111 and difficulty='H'; +update songdata set notecount=340 where songid=112 and difficulty='H'; +update songdata set notecount= where songid=113 and difficulty='H'; +update songdata set notecount= where songid=114 and difficulty='H'; +update songdata set notecount= where songid=115 and difficulty='H'; +update songdata set notecount=292 where songid=116 and difficulty='H'; +update songdata set notecount= where songid=117 and difficulty='H'; +update songdata set notecount=291 where songid=118 and difficulty='H'; +update songdata set notecount=228 where songid=119 and difficulty='H'; +update songdata set notecount=348 where songid=120 and difficulty='H'; +update songdata set notecount=270 where songid=121 and difficulty='H'; +update songdata set notecount=239 where songid=122 and difficulty='H'; +update songdata set notecount= where songid=123 and difficulty='H'; +update songdata set notecount=332 where songid=124 and difficulty='H'; +update songdata set notecount=227 where songid=125 and difficulty='H'; +update songdata set notecount=286 where songid=126 and difficulty='H'; +update songdata set notecount=358 where songid=127 and difficulty='H'; +update songdata set notecount= where songid=128 and difficulty='H'; +update songdata set notecount= where songid=129 and difficulty='H'; +update songdata set notecount=251 where songid=130 and difficulty='H'; +update songdata set notecount=249 where songid=131 and difficulty='H'; +update songdata set notecount=329 where songid=132 and difficulty='H'; +update songdata set notecount=335 where songid=133 and difficulty='H'; +update songdata set notecount=288 where songid=134 and difficulty='H'; +update songdata set notecount=285 where songid=135 and difficulty='H'; +update songdata set notecount=327 where songid=136 and difficulty='H'; +update songdata set notecount=285 where songid=137 and difficulty='H'; +update songdata set notecount= where songid=138 and difficulty='H'; +update songdata set notecount=265 where songid=139 and difficulty='H'; +update songdata set notecount=346 where songid=140 and difficulty='H'; +update songdata set notecount=174 where songid=141 and difficulty='H'; +update songdata set notecount=328 where songid=142 and difficulty='H'; +update songdata set notecount=241 where songid=143 and difficulty='H'; +update songdata set notecount= where songid=144 and difficulty='H'; +update songdata set notecount=135 where songid=145 and difficulty='H'; +update songdata set notecount= where songid=146 and difficulty='H'; +update songdata set notecount=310 where songid=147 and difficulty='H'; +update songdata set notecount= where songid=148 and difficulty='H'; +update songdata set notecount=291 where songid=149 and difficulty='H'; +update songdata set notecount= where songid=150 and difficulty='H'; +update songdata set notecount= where songid=151 and difficulty='H'; +update songdata set notecount=290 where songid=1 and difficulty='EX'; +update songdata set notecount=253 where songid=2 and difficulty='EX'; +update songdata set notecount=312 where songid=3 and difficulty='EX'; +update songdata set notecount=350 where songid=4 and difficulty='EX'; +update songdata set notecount=400 where songid=5 and difficulty='EX'; +update songdata set notecount=263 where songid=6 and difficulty='EX'; +update songdata set notecount=370 where songid=7 and difficulty='EX'; +update songdata set notecount=236 where songid=8 and difficulty='EX'; +update songdata set notecount=310 where songid=9 and difficulty='EX'; +update songdata set notecount=287 where songid=10 and difficulty='EX'; +update songdata set notecount=322 where songid=11 and difficulty='EX'; +update songdata set notecount=305 where songid=12 and difficulty='EX'; +update songdata set notecount= where songid=13 and difficulty='EX'; +update songdata set notecount=199 where songid=14 and difficulty='EX'; +update songdata set notecount=273 where songid=15 and difficulty='EX'; +update songdata set notecount= where songid=16 and difficulty='EX'; +update songdata set notecount=147 where songid=17 and difficulty='EX'; +update songdata set notecount=346 where songid=18 and difficulty='EX'; +update songdata set notecount=305 where songid=19 and difficulty='EX'; +update songdata set notecount=225 where songid=20 and difficulty='EX'; +update songdata set notecount=345 where songid=21 and difficulty='EX'; +update songdata set notecount=276 where songid=22 and difficulty='EX'; +update songdata set notecount=310 where songid=23 and difficulty='EX'; +update songdata set notecount=300 where songid=24 and difficulty='EX'; +update songdata set notecount=276 where songid=25 and difficulty='EX'; +update songdata set notecount=250 where songid=26 and difficulty='EX'; +update songdata set notecount=260 where songid=27 and difficulty='EX'; +update songdata set notecount=343 where songid=28 and difficulty='EX'; +update songdata set notecount=216 where songid=29 and difficulty='EX'; +update songdata set notecount= where songid=30 and difficulty='EX'; +update songdata set notecount=340 where songid=31 and difficulty='EX'; +update songdata set notecount=279 where songid=32 and difficulty='EX'; +update songdata set notecount=389 where songid=33 and difficulty='EX'; +update songdata set notecount=316 where songid=34 and difficulty='EX'; +update songdata set notecount= where songid=35 and difficulty='EX'; +update songdata set notecount= where songid=36 and difficulty='EX'; +update songdata set notecount= where songid=37 and difficulty='EX'; +update songdata set notecount= where songid=38 and difficulty='EX'; +update songdata set notecount=282 where songid=39 and difficulty='EX'; +update songdata set notecount=275 where songid=40 and difficulty='EX'; +update songdata set notecount=381 where songid=41 and difficulty='EX'; +update songdata set notecount=374 where songid=42 and difficulty='EX'; +update songdata set notecount= where songid=43 and difficulty='EX'; +update songdata set notecount=394 where songid=44 and difficulty='EX'; +update songdata set notecount=268 where songid=45 and difficulty='EX'; +update songdata set notecount=157 where songid=46 and difficulty='EX'; +update songdata set notecount= where songid=47 and difficulty='EX'; +update songdata set notecount=315 where songid=48 and difficulty='EX'; +update songdata set notecount=289 where songid=49 and difficulty='EX'; +update songdata set notecount=302 where songid=50 and difficulty='EX'; +update songdata set notecount=416 where songid=51 and difficulty='EX'; +update songdata set notecount=233 where songid=52 and difficulty='EX'; +update songdata set notecount=371 where songid=53 and difficulty='EX'; +update songdata set notecount=318 where songid=54 and difficulty='EX'; +update songdata set notecount= where songid=55 and difficulty='EX'; +update songdata set notecount= where songid=56 and difficulty='EX'; +update songdata set notecount=362 where songid=57 and difficulty='EX'; +update songdata set notecount= where songid=58 and difficulty='EX'; +update songdata set notecount= where songid=59 and difficulty='EX'; +update songdata set notecount=275 where songid=60 and difficulty='EX'; +update songdata set notecount=212 where songid=61 and difficulty='EX'; +update songdata set notecount=204 where songid=62 and difficulty='EX'; +update songdata set notecount= where songid=63 and difficulty='EX'; +update songdata set notecount=246 where songid=64 and difficulty='EX'; +update songdata set notecount=414 where songid=65 and difficulty='EX'; +update songdata set notecount=216 where songid=66 and difficulty='EX'; +update songdata set notecount= where songid=67 and difficulty='EX'; +update songdata set notecount=399 where songid=68 and difficulty='EX'; +update songdata set notecount=337 where songid=69 and difficulty='EX'; +update songdata set notecount=406 where songid=70 and difficulty='EX'; +update songdata set notecount=288 where songid=71 and difficulty='EX'; +update songdata set notecount=339 where songid=72 and difficulty='EX'; +update songdata set notecount=251 where songid=73 and difficulty='EX'; +update songdata set notecount=280 where songid=74 and difficulty='EX'; +update songdata set notecount=226 where songid=75 and difficulty='EX'; +update songdata set notecount=274 where songid=76 and difficulty='EX'; +update songdata set notecount=299 where songid=77 and difficulty='EX'; +update songdata set notecount=377 where songid=78 and difficulty='EX'; +update songdata set notecount=330 where songid=79 and difficulty='EX'; +update songdata set notecount=322 where songid=80 and difficulty='EX'; +update songdata set notecount=261 where songid=81 and difficulty='EX'; +update songdata set notecount=231 where songid=82 and difficulty='EX'; +update songdata set notecount= where songid=83 and difficulty='EX'; +update songdata set notecount=265 where songid=84 and difficulty='EX'; +update songdata set notecount=404 where songid=85 and difficulty='EX'; +update songdata set notecount=363 where songid=86 and difficulty='EX'; +update songdata set notecount=368 where songid=87 and difficulty='EX'; +update songdata set notecount=250 where songid=88 and difficulty='EX'; +update songdata set notecount=164 where songid=89 and difficulty='EX'; +update songdata set notecount=246 where songid=90 and difficulty='EX'; +update songdata set notecount=420 where songid=91 and difficulty='EX'; +update songdata set notecount=416 where songid=92 and difficulty='EX'; +update songdata set notecount=361 where songid=93 and difficulty='EX'; +update songdata set notecount=348 where songid=94 and difficulty='EX'; +update songdata set notecount=199 where songid=95 and difficulty='EX'; +update songdata set notecount= where songid=96 and difficulty='EX'; +update songdata set notecount=392 where songid=97 and difficulty='EX'; +update songdata set notecount= where songid=98 and difficulty='EX'; +update songdata set notecount=321 where songid=99 and difficulty='EX'; +update songdata set notecount=388 where songid=100 and difficulty='EX'; +update songdata set notecount=388 where songid=101 and difficulty='EX'; +update songdata set notecount=276 where songid=102 and difficulty='EX'; +update songdata set notecount=369 where songid=103 and difficulty='EX'; +update songdata set notecount=336 where songid=104 and difficulty='EX'; +update songdata set notecount=330 where songid=105 and difficulty='EX'; +update songdata set notecount= where songid=106 and difficulty='EX'; +update songdata set notecount=284 where songid=107 and difficulty='EX'; +update songdata set notecount=305 where songid=108 and difficulty='EX'; +update songdata set notecount=363 where songid=109 and difficulty='EX'; +update songdata set notecount=213 where songid=110 and difficulty='EX'; +update songdata set notecount=208 where songid=111 and difficulty='EX'; +update songdata set notecount=340 where songid=112 and difficulty='EX'; +update songdata set notecount= where songid=113 and difficulty='EX'; +update songdata set notecount= where songid=114 and difficulty='EX'; +update songdata set notecount= where songid=115 and difficulty='EX'; +update songdata set notecount=292 where songid=116 and difficulty='EX'; +update songdata set notecount= where songid=117 and difficulty='EX'; +update songdata set notecount=291 where songid=118 and difficulty='EX'; +update songdata set notecount=228 where songid=119 and difficulty='EX'; +update songdata set notecount=348 where songid=120 and difficulty='EX'; +update songdata set notecount=270 where songid=121 and difficulty='EX'; +update songdata set notecount=239 where songid=122 and difficulty='EX'; +update songdata set notecount= where songid=123 and difficulty='EX'; +update songdata set notecount=332 where songid=124 and difficulty='EX'; +update songdata set notecount=227 where songid=125 and difficulty='EX'; +update songdata set notecount=286 where songid=126 and difficulty='EX'; +update songdata set notecount=358 where songid=127 and difficulty='EX'; +update songdata set notecount= where songid=128 and difficulty='EX'; +update songdata set notecount= where songid=129 and difficulty='EX'; +update songdata set notecount=251 where songid=130 and difficulty='EX'; +update songdata set notecount=249 where songid=131 and difficulty='EX'; +update songdata set notecount=329 where songid=132 and difficulty='EX'; +update songdata set notecount=335 where songid=133 and difficulty='EX'; +update songdata set notecount=288 where songid=134 and difficulty='EX'; +update songdata set notecount=285 where songid=135 and difficulty='EX'; +update songdata set notecount=327 where songid=136 and difficulty='EX'; +update songdata set notecount=285 where songid=137 and difficulty='EX'; +update songdata set notecount= where songid=138 and difficulty='EX'; +update songdata set notecount=265 where songid=139 and difficulty='EX'; +update songdata set notecount=346 where songid=140 and difficulty='EX'; +update songdata set notecount=174 where songid=141 and difficulty='EX'; +update songdata set notecount=328 where songid=142 and difficulty='EX'; +update songdata set notecount=241 where songid=143 and difficulty='EX'; +update songdata set notecount= where songid=144 and difficulty='EX'; +update songdata set notecount=135 where songid=145 and difficulty='EX'; +update songdata set notecount= where songid=146 and difficulty='EX'; +update songdata set notecount=310 where songid=147 and difficulty='EX'; +update songdata set notecount= where songid=148 and difficulty='EX'; +update songdata set notecount=291 where songid=149 and difficulty='EX'; +update songdata set notecount= where songid=150 and difficulty='EX'; +update songdata set notecount= where songid=151 and difficulty='EX'; + + + + + + + + + + +update songdata set notecount=322 where songid=11 and difficulty='EXEX'; +update songdata set notecount=305 where songid=12 and difficulty='EXEX'; +update songdata set notecount= where songid=13 and difficulty='EXEX'; + +update songdata set notecount=273 where songid=15 and difficulty='EXEX'; +update songdata set notecount= where songid=16 and difficulty='EXEX'; +update songdata set notecount=147 where songid=17 and difficulty='EXEX'; +update songdata set notecount=346 where songid=18 and difficulty='EXEX'; +update songdata set notecount=305 where songid=19 and difficulty='EXEX'; +update songdata set notecount=225 where songid=20 and difficulty='EXEX'; +update songdata set notecount=345 where songid=21 and difficulty='EXEX'; +update songdata set notecount=276 where songid=22 and difficulty='EXEX'; +update songdata set notecount=310 where songid=23 and difficulty='EXEX'; +update songdata set notecount=300 where songid=24 and difficulty='EXEX'; + +update songdata set notecount=250 where songid=26 and difficulty='EXEX'; +update songdata set notecount=260 where songid=27 and difficulty='EXEX'; +update songdata set notecount=343 where songid=28 and difficulty='EXEX'; +update songdata set notecount=216 where songid=29 and difficulty='EXEX'; +update songdata set notecount= where songid=30 and difficulty='EXEX'; + +update songdata set notecount=279 where songid=32 and difficulty='EXEX'; +update songdata set notecount=389 where songid=33 and difficulty='EXEX'; + +update songdata set notecount= where songid=35 and difficulty='EXEX'; +update songdata set notecount= where songid=36 and difficulty='EXEX'; + +update songdata set notecount= where songid=38 and difficulty='EXEX'; + +update songdata set notecount=275 where songid=40 and difficulty='EXEX'; + +update songdata set notecount=374 where songid=42 and difficulty='EXEX'; + +update songdata set notecount=394 where songid=44 and difficulty='EXEX'; + + + +update songdata set notecount=315 where songid=48 and difficulty='EXEX'; + + + + + +update songdata set notecount=318 where songid=54 and difficulty='EXEX'; +update songdata set notecount= where songid=55 and difficulty='EXEX'; + +update songdata set notecount=362 where songid=57 and difficulty='EXEX'; +update songdata set notecount= where songid=58 and difficulty='EXEX'; + + + +update songdata set notecount=204 where songid=62 and difficulty='EXEX'; +update songdata set notecount= where songid=63 and difficulty='EXEX'; + + + + + + + + + + + + + + + + + + + + + + + +update songdata set notecount=368 where songid=87 and difficulty='EXEX'; + + + + + + + + +update songdata set notecount= where songid=96 and difficulty='EXEX'; +update songdata set notecount=392 where songid=97 and difficulty='EXEX'; +update songdata set notecount= where songid=98 and difficulty='EXEX'; + + + + +update songdata set notecount=369 where songid=103 and difficulty='EXEX'; +update songdata set notecount=336 where songid=104 and difficulty='EXEX'; +update songdata set notecount=330 where songid=105 and difficulty='EXEX'; +update songdata set notecount= where songid=106 and difficulty='EXEX'; + +update songdata set notecount=305 where songid=108 and difficulty='EXEX'; +update songdata set notecount=363 where songid=109 and difficulty='EXEX'; +update songdata set notecount=213 where songid=110 and difficulty='EXEX'; + +update songdata set notecount=340 where songid=112 and difficulty='EXEX'; +update songdata set notecount= where songid=113 and difficulty='EXEX'; +update songdata set notecount= where songid=114 and difficulty='EXEX'; +update songdata set notecount= where songid=115 and difficulty='EXEX'; + + +update songdata set notecount=291 where songid=118 and difficulty='EXEX'; +update songdata set notecount=228 where songid=119 and difficulty='EXEX'; +update songdata set notecount=348 where songid=120 and difficulty='EXEX'; + +update songdata set notecount=239 where songid=122 and difficulty='EXEX'; +update songdata set notecount= where songid=123 and difficulty='EXEX'; + +update songdata set notecount=227 where songid=125 and difficulty='EXEX'; + +update songdata set notecount=358 where songid=127 and difficulty='EXEX'; + + +update songdata set notecount=251 where songid=130 and difficulty='EXEX'; +update songdata set notecount=249 where songid=131 and difficulty='EXEX'; + +update songdata set notecount=335 where songid=133 and difficulty='EXEX'; + +update songdata set notecount=285 where songid=135 and difficulty='EXEX'; + + + +update songdata set notecount=265 where songid=139 and difficulty='EXEX'; + + + +update songdata set notecount=241 where songid=143 and difficulty='EXEX'; +update songdata set notecount= where songid=144 and difficulty='EXEX'; + +update songdata set notecount= where songid=146 and difficulty='EXEX'; + +update songdata set notecount= where songid=148 and difficulty='EXEX'; + +