Skip to content

Commit 8d05fc8

Browse files
committed
Fix prices perhaps. Also remove download via proxy button
1 parent 3f7377f commit 8d05fc8

3 files changed

Lines changed: 17 additions & 20 deletions

File tree

OculusDB/ObjectConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public class ObjectConverter
6969
return converted;
7070
}
7171

72-
public static dynamic ConvertToDBType(BsonDocument d)
72+
public static dynamic? ConvertToDBType(BsonDocument? d)
7373
{
7474
if (d == null) return null;
7575
string type = d.GetValue("__OculusDBType").ToString();

OculusDB/ScrapingMaster/ScrapingManaging.cs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private static void ProcessScrapedResults(ScrapingNodeTaskResult taskResult, Scr
192192
ulong taskId = processTaskId;
193193
processTaskId++;
194194
Logger.Log("# " + taskId + " Processing " + taskResult.scraped.applications.Count + " applications, " + taskResult.scraped.dlcs.Count + " dlcs, " + taskResult.scraped.dlcPacks.Count + " dlc packs, " + taskResult.scraped.versions.Count + " version and " + taskResult.scraped.imgs.Count + " images from scraping node " + scrapingNodeAuthenticationResult.scrapingNode);
195-
ScrapingContribution scrapingContribution = new ScrapingContribution();
195+
ScrapingContribution? scrapingContribution = new ScrapingContribution();
196196
scrapingContribution.scrapingNode = scrapingNodeAuthenticationResult.scrapingNode;
197197
// Process Versions
198198
Dictionary<string, List<DBVersion>> versionLookup = new Dictionary<string, List<DBVersion>>();
@@ -431,25 +431,21 @@ private static void ProcessScrapedResults(ScrapingNodeTaskResult taskResult, Scr
431431
long newestNonZeroPrice = 0;
432432
foreach (DBActivityPriceChanged p in priceChanges)
433433
{
434-
if(!nodesPrice.ContainsKey(p.newPriceOffsetNumerical))
435-
{
436-
nodesPrice.Add(p.newPriceOffsetNumerical, 0);
437-
}
434+
nodesPrice.TryAdd(p.newPriceOffsetNumerical, 0);
438435
if (p.newPriceOffsetNumerical != 0)
439436
{
440437
newestNonZeroPrice = p.newPriceOffsetNumerical;
441438
}
442439
nodesPrice[p.newPriceOffsetNumerical]++;
443440
}
444441
// now check if one node does a limbo
445-
long suggestedPrice = a.priceOffsetNumerical;
446442
a.priceLimboDetected = false;
447443
foreach (var prices in nodesPrice)
448444
{
449445
if (prices.Value > 2 && prices.Key == 0) // price limbo if the same price occurrs more than twice
450446
{
451447
a.priceLimboDetected = true;
452-
suggestedPrice = newestNonZeroPrice;
448+
a.priceOffsetNumerical = newestNonZeroPrice;
453449
break;
454450
}
455451
}
@@ -462,7 +458,6 @@ private static void ProcessScrapedResults(ScrapingNodeTaskResult taskResult, Scr
462458
priceChange.parentApplication.displayName = a.displayName;
463459
priceChange.newPriceOffsetNumerical = a.priceOffsetNumerical;
464460
priceChange.currency = a.currency;
465-
if(a.priceLimboDetected) priceChange.newPriceOffsetNumerical = suggestedPrice; // Set the price to the highest price in case of price limbo
466461
if (lastPriceChange != null)
467462
{
468463
if (lastPriceChange.newPriceOffset != priceChange.newPriceOffset)
@@ -474,18 +469,14 @@ private static void ProcessScrapedResults(ScrapingNodeTaskResult taskResult, Scr
474469
}
475470
else
476471
{
477-
if (priceChange == null)
478-
{
479-
ReportErrorWithDiscordMessage("Price change is null. Responsible node is " + scrapingNodeAuthenticationResult.scrapingNode.scrapingNodeId, "nullError");
480-
}
481-
else if (scrapingContribution == null)
472+
if (scrapingContribution == null)
482473
{
483474
ReportErrorWithDiscordMessage("Scraping Contribution is null. Responsible node is " + scrapingNodeAuthenticationResult.scrapingNode.scrapingNodeId, "nullError");
484475
}
485476
else ScrapingNodeMongoDBManager.AddBsonDocumentToActivityCollection(priceChange.ToBsonDocument(), ref scrapingContribution);
486477
}
487478

488-
DBApplication old = ObjectConverter.ConvertToDBType(MongoDBInteractor.GetByID(a.id, 1, a.currency).FirstOrDefault());
479+
DBApplication? old = ObjectConverter.ConvertToDBType(MongoDBInteractor.GetByID(a.id, 1, a.currency).FirstOrDefault());
489480
ScrapingNodeMongoDBManager.AddApplication(a, ref scrapingContribution);
490481
if (old != null)
491482
{

OculusDB/frontend/script.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ function RealDownload(id, openObb) {
13111311
if(openObb) ObbDownloadPopUp();
13121312
}
13131313

1314-
function AndroidDownload(id, parentApplicationId,parentApplicationName, version, isObb = false, obbIds = "", obbNames = "") {
1314+
function AndroidDownload(id, parentApplicationId,parentApplicationName, version, isObb = false, obbIds = "", obbNames = "", hmd = "EUREKA") {
13151315

13161316
if(!DownloadCheck()) return
13171317

@@ -1356,11 +1356,18 @@ function AndroidDownload(id, parentApplicationId,parentApplicationName, version,
13561356
<div>
13571357
<div style="font-size: 1.2em; font-weight: bold; margin-bottom: 10px;">Why is my download not starting?</div>
13581358
<p>
1359-
<span style="font-weight: bold">You cannot download quest games atm. You may be able to use <span style="font-weight: bolder;">QuestAppVersionSwitcher</span> to downgrade/download Quest games like Beat Saber.</span>
1359+
<span style="font-weight: bold">You cannot download quest games directly via your browser atm. You may be able to use <a style="font-weight: bolder;" href="https://oculusdb.rui2015.me/guide/quest/qavs">QuestAppVersionSwitcher</a> to downgrade/download Quest games like Beat Saber.</span>
13601360
It's an app you install on your Quest and then use to downgrade. You can find a guide on how to set it up <a href="https://oculusdb.rui2015.me/guide/quest/qavs">here</a>.
1361+
<br/>
1362+
<br/>
1363+
If you want to download directly on your pc, you can use Oculus Downgrader. In that case press the Oculus Downgrader button below.
13611364
For more info check <a href="https://computerelite.github.io/blog/2024/01/05/downgrading">here</a>.
13621365
<br/>
1363-
<input type="button" onclick="GetHelp()" value="Receive Help">
1366+
<br/>
1367+
If you need further help you can join the <a href="{OculusDBDC}">OculusDB Discord server</a> and ask for help in the #support channel.
1368+
<br/>
1369+
<input type="button" onclick="AndroidDownloadPopUp('${parentApplicationId}','${id}', '${hmd}')" value="Oculus Downgrader">
1370+
<input type="button" onclick="GetHelp()" value="Poem for help">
13641371
</p>
13651372
</div>
13661373
`);
@@ -1464,8 +1471,7 @@ function GetDownloadButtonVersion(downloadable, id, hmd, binaryType, parentAppli
14641471
if(localStorage.isOculusDowngrader) {
14651472
return `<input type="button" value="Download${downloadable ? '"' : ' (Developer only)" class="red"'} onmousedown="MouseDown(event)" onmouseup="if(MouseUp(event)) AndroidDownloadPopUp('${parentApplication.id}','${id}', '${hmd}')" oncontextmenu="ContextMenuEnabled(event, this)">`
14661473
}
1467-
return `<input type="button" value="Download${downloadable ? '"' : ' (Developer only)" class="red"'} onmousedown="MouseDown(event)" onmouseup="if(MouseUp(event)) AndroidDownload('${id}', '${parentApplication.id}', '${parentApplication.displayName.replace("'", "\\'")}', '${version}', ${isObb}, ${obbIds == null ? "null" : `'${obbIds}'`}, ${obbNames == null ? "null" : `'${obbNames}'`})" oncontextmenu="ContextMenuEnabled(event, this)" cmon-0="Copy download url" cmov-0="Copy(GetDownloadLink('${id}'))" cmon-1="Show Oculus Downgrader code" cmov-1="AndroidDownloadPopUp('${parentApplication.id}','${id}', '${hmd}')">
1468-
${localStorage.isQAVS ? `` : `<input type="button" value="Download via Proxy (will probably work${downloadable ? ')"' : '; Developer only)" class="red"'} onmousedown="MouseDown(event)" onmouseup="if(MouseUp(event)) ProxyDownload('${id}')">`}`
1474+
return `<input type="button" value="Download${downloadable ? '"' : ' (Developer only)" class="red"'} onmousedown="MouseDown(event)" onmouseup="if(MouseUp(event)) AndroidDownload('${id}', '${parentApplication.id}', '${parentApplication.displayName.replace("'", "\\'")}', '${version}', ${isObb}, ${obbIds == null ? "null" : `'${obbIds}'`}, ${obbNames == null ? "null" : `'${obbNames}'`}, '${hmd}')" oncontextmenu="ContextMenuEnabled(event, this)" cmon-0="Copy download url" cmov-0="Copy(GetDownloadLink('${id}'))" cmon-1="Show Oculus Downgrader code" cmov-1="AndroidDownloadPopUp('${parentApplication.id}','${id}', '${hmd}')">`
14691475
}
14701476
return `<input type="button" value="Download${downloadable ? '"' : ' (Developer only)" class="red"'} onmousedown="MouseDown(event)" onmouseup="if(MouseUp(event)) RiftDownloadPopUp('${parentApplication.id}','${id}')" oncontextmenu="ContextMenuEnabled(event, this)" cmon-0="Show Oculus Downgrader code" cmov-0="RiftDownloadPopUp('${parentApplication.id}','${id}')">`
14711477
}

0 commit comments

Comments
 (0)