settings chages, drive caching improvements, anime resolving improvements

This commit is contained in:
ThaUnknown 2020-11-12 01:17:09 +01:00
parent b4d80e1e28
commit fb6e5183bb
4 changed files with 13 additions and 15 deletions

View file

@ -383,7 +383,7 @@
<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>

View file

@ -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]

View file

@ -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])
}
}
}
@ -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]]
}
@ -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
})

View file

@ -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 + "%")