add support for patch files, bc recently peppy messed something up
This commit is contained in:
parent
f6e5ead7ed
commit
7cba78b270
18
osuUtil.js
18
osuUtil.js
|
@ -89,9 +89,17 @@ async function getEZPPUIMD5() {
|
||||||
async function filesThatNeedUpdate(osuPath, updateFiles) {
|
async function filesThatNeedUpdate(osuPath, updateFiles) {
|
||||||
const filesToDownload = [];
|
const filesToDownload = [];
|
||||||
for (const updatedFile of updateFiles) {
|
for (const updatedFile of updateFiles) {
|
||||||
const fileName = updatedFile.filename;
|
let fileName = updatedFile.filename;
|
||||||
const fileHash = updatedFile.file_hash;
|
let fileHash = updatedFile.file_hash;
|
||||||
const fileURL = updatedFile.url_full;
|
let fileURL = updatedFile.url_full;
|
||||||
|
|
||||||
|
if ("url_patch" in updatedFile && updatedFile.url_patch != undefined) {
|
||||||
|
const stripped = updatedFile.url_patch.split("_");
|
||||||
|
fileHash = stripped[stripped.length - 1];
|
||||||
|
const lastIndex = fileURL.lastIndexOf("/");
|
||||||
|
const baseUrl = fileURL.slice(0, lastIndex);
|
||||||
|
fileURL = baseUrl + "/f_" + fileHash;
|
||||||
|
}
|
||||||
|
|
||||||
if (ignoredOsuEntities.includes(fileName)) continue;
|
if (ignoredOsuEntities.includes(fileName)) continue;
|
||||||
|
|
||||||
|
@ -103,7 +111,7 @@ async function filesThatNeedUpdate(osuPath, updateFiles) {
|
||||||
filesToDownload.push({
|
filesToDownload.push({
|
||||||
fileName,
|
fileName,
|
||||||
fileURL
|
fileURL
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
filesToDownload.push({
|
filesToDownload.push({
|
||||||
|
@ -119,7 +127,6 @@ async function filesThatNeedUpdate(osuPath, updateFiles) {
|
||||||
const binaryUIContents = await fs.promises.readFile(ezppUI);
|
const binaryUIContents = await fs.promises.readFile(ezppUI);
|
||||||
const existingUIMD5 = crypto.createHash("md5").update(binaryUIContents).digest("hex");
|
const existingUIMD5 = crypto.createHash("md5").update(binaryUIContents).digest("hex");
|
||||||
if (existingUIMD5 != latestMd5Hash) {
|
if (existingUIMD5 != latestMd5Hash) {
|
||||||
console.log("MD5 Hashes dont match");
|
|
||||||
filesToDownload.push({
|
filesToDownload.push({
|
||||||
folder: "EZPPLauncher",
|
folder: "EZPPLauncher",
|
||||||
fileName: "ezpp!ui.dll",
|
fileName: "ezpp!ui.dll",
|
||||||
|
@ -127,7 +134,6 @@ async function filesThatNeedUpdate(osuPath, updateFiles) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("Does not exist");
|
|
||||||
filesToDownload.push({
|
filesToDownload.push({
|
||||||
folder: "EZPPLauncher",
|
folder: "EZPPLauncher",
|
||||||
fileName: "ezpp!ui.dll",
|
fileName: "ezpp!ui.dll",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user