Skip to content

Commit

Permalink
settings chages, drive caching improvements, anime resolving improvem…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
ThaUnknown committed Nov 12, 2020
1 parent b4d80e1 commit fb6e518
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/index.html
Expand Up @@ -383,7 +383,7 @@ <h1 class="content-title font-size-22">
<label for="torrent3">Trusted Only</label>
</div>
<div class="custom-switch mb-10" data-toggle="tooltip" data-placement="top" data-title="Greatly Reduces RAM Usage By Caching Torrents On Drive, Increases CPU And Drive Usage,
Bad For SSDs, Experimental">
Bad For SSDs, Disables Downloading, Experimental">
<input type="checkbox" id="torrent5">
<label for="torrent5">Drive Caching</label>
</div>
Expand Down
3 changes: 3 additions & 0 deletions app/js/animeHandler.js
Expand Up @@ -456,6 +456,9 @@ async function resolveName(name, method){
if (!res.data.Page.media[0]) {
res = await alRequest(name.replace(" (TV)", "").replace(` (${new Date().getFullYear()})`, ""), method)
}
if(settings.torrent7 && !res.data.Page.media[0] && method == "SearchReleasesSingle"){
res = await alRequest(name, "SearchAnySingle")
}
store[name] = res.data.Page.media[0]
}
return store[name]
Expand Down
14 changes: 9 additions & 5 deletions app/js/playerHandler.js
Expand Up @@ -108,10 +108,14 @@ async function buildVideo(file, nowPlaying) {
alertType: "alert-success",
fillType: ""
});
if (settings.player8 && !settings.torrent5) {
finishThumbnails(file);
if (settings.player8) {
if (!settings.torrent5) {
finishThumbnails(file);
}
postDownload(file)
}
if (!settings.torrent5) {
downloadFile(file)
postDownload(videoFiles[0])
}
}
}
Expand All @@ -120,7 +124,7 @@ async function buildVideo(file, nowPlaying) {
setTimeout(onProgress, 100)
if (nowPlaying) {
playerData.nowPlaying = nowPlaying
} else {
} else if (settings.torrent7) {
let regexParse = nameParseRegex.fallback.exec(file.name)
playerData.nowPlaying = [await resolveName(regexParse[2], "SearchAnySingle"), regexParse[3]]
}
Expand Down Expand Up @@ -231,7 +235,7 @@ function finishThumbnails(file) {
if (settings.player5 && settings.player8) {
let thumbVid = document.createElement("video"),
index = 0
file.getBlobURL((err, url) => {
thumbVid.src = file.getBlobURL((err, url) => {
thumbVid.src = url
})

Expand Down
9 changes: 0 additions & 9 deletions app/js/settingsHandler.js
Expand Up @@ -57,14 +57,5 @@ if (searchParams.get("access_token")) {
localStorage.setItem("ALtoken", searchParams.get("access_token"))
window.location = "/app/#settingsTab"
}
torrent5.onclick = e => {
if (e.srcElement.checked)
player8.checked = false

}
player8.onclick = e => {
if (e.srcElement.checked)
torrent5.checked = false
}

document.documentElement.style.setProperty("font-size", settings.other1 + "%")

0 comments on commit fb6e518

Please sign in to comment.