mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-21 10:01:59 +00:00
bit better latest releases GUI
This commit is contained in:
parent
f9ab49505f
commit
63d2043db6
2 changed files with 76 additions and 45 deletions
|
|
@ -60,7 +60,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-dark">
|
<div class="bg-dark">
|
||||||
<div class="container row">
|
<div class="container row">
|
||||||
<div class="col-md-3 mt-10 mt-nc pb-20 d-flex flex-column justify-content-between align-items-center cover-wrapper">
|
<div
|
||||||
|
class="col-md-3 mt-10 mt-nc pb-20 d-flex flex-column justify-content-between align-items-center cover-wrapper">
|
||||||
<img class="contain-img rounded w-full">
|
<img class="contain-img rounded w-full">
|
||||||
<div class="input-group pt-10">
|
<div class="input-group pt-10">
|
||||||
<div class="input-group-prepend flex-grow-1">
|
<div class="input-group-prepend flex-grow-1">
|
||||||
|
|
@ -68,8 +69,8 @@
|
||||||
Episode</button>
|
Episode</button>
|
||||||
</div>
|
</div>
|
||||||
<input type="number" id="ep"
|
<input type="number" id="ep"
|
||||||
class="form-control flex-reset w-60 bg-primary px-5 text-right"
|
class="form-control flex-reset w-60 bg-primary px-5 text-right" placeholder="#"
|
||||||
placeholder="#" value="1" min="1">
|
value="1" min="1">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-9 p-20 d-flex flex-column">
|
<div class="col-md-9 p-20 d-flex flex-column">
|
||||||
|
|
@ -231,6 +232,27 @@
|
||||||
<button class="btn btn-primary px-10 d-flex align-items-center" id="refRel">
|
<button class="btn btn-primary px-10 d-flex align-items-center" id="refRel">
|
||||||
<div class="material-icons">refresh</div> Refresh
|
<div class="material-icons">refresh</div> Refresh
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-danger px-10 d-flex align-items-center ml-10" id="clearRelCache">
|
||||||
|
<div class="material-icons">delete_forever</div> Clear Cache
|
||||||
|
</button>
|
||||||
|
<div class="input-group w-150 ml-10">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">Quality</span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" disabled id="relQual">
|
||||||
|
</div>
|
||||||
|
<div class="input-group w-150 ml-10">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">Feed</span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" disabled id="relFeed">
|
||||||
|
</div>
|
||||||
|
<div class="input-group w-200 ml-10">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">Updated</span>
|
||||||
|
</div>
|
||||||
|
<input type="time" class="form-control" id="relTime" disabled>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="gallery releases h-full overflow-y-scroll border-left border-top">
|
<div class="gallery releases h-full overflow-y-scroll border-left border-top">
|
||||||
|
|
@ -345,14 +367,15 @@
|
||||||
<label for="torrent2">Auto-Play Torrents [This might lead to wrong torrents being
|
<label for="torrent2">Auto-Play Torrents [This might lead to wrong torrents being
|
||||||
played]</label>
|
played]</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="custom-switch mb-10">
|
<div class="custom-switch mb-10">
|
||||||
<input type="checkbox" id="torrent3">
|
<input type="checkbox" id="torrent3">
|
||||||
<label for="torrent3">Trusted Only [Less results but higher quality and more seeders]</label>
|
<label for="torrent3">Trusted Only [Less results but higher quality and more seeders]</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="custom-switch mb-20">
|
<div class="custom-switch mb-20">
|
||||||
<input type="checkbox" id="torrent5">
|
<input type="checkbox" id="torrent5">
|
||||||
<label for="torrent5">Drive Caching [Greatly reduces RAM usage, increases CPU and Drive usage, bad for SSDs]</label>
|
<label for="torrent5">Drive Caching [Greatly reduces RAM usage, increases CPU and Drive usage,
|
||||||
</div>
|
bad for SSDs]</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h1 class="content-title font-size-22">
|
<h1 class="content-title font-size-22">
|
||||||
Other Settings
|
Other Settings
|
||||||
|
|
@ -376,7 +399,8 @@
|
||||||
|
|
||||||
|
|
||||||
<button class="btn btn-danger" type="button" id="setRes">Restore Defaults</button>
|
<button class="btn btn-danger" type="button" id="setRes">Restore Defaults</button>
|
||||||
<button class="btn btn-success" type="button" id="regProtButton">Set As Default For Magnet Links</button>
|
<button class="btn btn-success" type="button" id="regProtButton">Set As Default For Magnet
|
||||||
|
Links</button>
|
||||||
<p class="text-muted">
|
<p class="text-muted">
|
||||||
Restart may be required for some settings to take effect.
|
Restart may be required for some settings to take effect.
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
|
|
@ -348,50 +348,57 @@ let store = JSON.parse(localStorage.getItem("store")),
|
||||||
lastResult
|
lastResult
|
||||||
|
|
||||||
async function hsRss() {
|
async function hsRss() {
|
||||||
if (document.location.href.endsWith("#releases")) {
|
let frag = document.createDocumentFragment(),
|
||||||
let frag = document.createDocumentFragment(),
|
releases = document.querySelector(".releases"),
|
||||||
releases = document.querySelector(".releases"),
|
url = settings.torrent4 == "https://miru.kirdow.com/request/?url=https://www.erai-raws.info/rss-" ? settings.torrent4 + settings.torrent1 + "-magnet" : settings.torrent4 + settings.torrent1
|
||||||
url = settings.torrent4 == "https://miru.kirdow.com/request/?url=https://www.erai-raws.info/rss-" ? settings.torrent4 + settings.torrent1 + "-magnet" : settings.torrent4 + settings.torrent1
|
relFeed.value = torrent4.options[torrent4.selectedIndex].text
|
||||||
res = await fetch(url)
|
relQual.value = torrent1.options[torrent1.selectedIndex].text
|
||||||
await res.text().then(async (xmlTxt) => {
|
let time = new Date
|
||||||
try {
|
relTime.value = time.toISOString().slice(11, -1).slice(0, -7)
|
||||||
let doc = DOMPARSER(xmlTxt, "text/xml")
|
res = await fetch(url)
|
||||||
if (lastResult != doc) {
|
await res.text().then(async (xmlTxt) => {
|
||||||
releases.textContent = '';
|
try {
|
||||||
releases.appendChild(skeletonCard)
|
let doc = DOMPARSER(xmlTxt, "text/xml")
|
||||||
lastResult = doc
|
if (lastResult != doc) {
|
||||||
let items = doc.querySelectorAll("item")
|
releases.textContent = '';
|
||||||
for (let item of items) {
|
releases.appendChild(skeletonCard)
|
||||||
let i = item.querySelector.bind(item),
|
lastResult = doc
|
||||||
regexParse = (nameParseRegex[settings.torrent4]||nameParseRegex.parse).exec(i("title").textContent)
|
let items = doc.querySelectorAll("item")
|
||||||
if (!store.hasOwnProperty(regexParse[2]) && !alResponse.data.Page.media.some(media => (Object.values(media.title).concat(media.synonyms).filter(name => name != null).includes(regexParse[2]) && ((store[regexParse[2]] = media) && true)))) {
|
for (let item of items) {
|
||||||
//shit not found, lookup
|
let i = item.querySelector.bind(item),
|
||||||
let res = await alRequest(regexParse[2], 1)
|
regexParse = (nameParseRegex[settings.torrent4] || nameParseRegex.parse).exec(i("title").textContent)
|
||||||
if (!res.data.Page.media[0]) {
|
if (!store.hasOwnProperty(regexParse[2]) && !alResponse.data.Page.media.some(media => (Object.values(media.title).concat(media.synonyms).filter(name => name != null).includes(regexParse[2]) && ((store[regexParse[2]] = media) && true)))) {
|
||||||
res = await alRequest(regexParse[2].replace(" (TV)", "").replace(` (${new Date().getFullYear()})`, ""), 1)
|
//shit not found, lookup
|
||||||
}
|
let res = await alRequest(regexParse[2], 1)
|
||||||
store[regexParse[2]] = res.data.Page.media[0]
|
if (!res.data.Page.media[0]) {
|
||||||
|
res = await alRequest(regexParse[2].replace(" (TV)", "").replace(` (${new Date().getFullYear()})`, ""), 1)
|
||||||
}
|
}
|
||||||
let media = store[regexParse[2]],
|
store[regexParse[2]] = res.data.Page.media[0]
|
||||||
template = cardCreator(media, regexParse)
|
|
||||||
template.onclick = () => {
|
|
||||||
playerData.selected = [regexParse[2], regexParse[4]]
|
|
||||||
addTorrent(i('link').textContent)
|
|
||||||
}
|
|
||||||
frag.appendChild(template)
|
|
||||||
}
|
}
|
||||||
releases.textContent = '';
|
let media = store[regexParse[2]],
|
||||||
releases.appendChild(frag)
|
template = cardCreator(media, regexParse)
|
||||||
|
template.onclick = () => {
|
||||||
|
playerData.selected = [regexParse[2], regexParse[4]]
|
||||||
|
addTorrent(i('link').textContent)
|
||||||
|
}
|
||||||
|
frag.appendChild(template)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
releases.textContent = '';
|
||||||
console.error(e)
|
releases.appendChild(frag)
|
||||||
}
|
}
|
||||||
})
|
} catch (e) {
|
||||||
}
|
console.error(e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
localStorage.setItem("store", JSON.stringify(store))
|
localStorage.setItem("store", JSON.stringify(store))
|
||||||
}
|
}
|
||||||
refRel.onclick = () => {
|
refRel.onclick = () =>
|
||||||
hsRss()
|
hsRss()
|
||||||
|
|
||||||
|
clearRelCache.onclick = () =>{
|
||||||
|
localStorage.removeItem("store")
|
||||||
|
store = {}
|
||||||
}
|
}
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
hsRss()
|
hsRss()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue