mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-21 00:02:06 +00:00
remove trailer after close, only push notifications when setting is enabled, NRE fixes
This commit is contained in:
parent
0ebafbd005
commit
c6e822f783
4 changed files with 21 additions and 17 deletions
|
|
@ -116,7 +116,7 @@
|
|||
<div class="modal" id="trailer" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content w-three-quarter h-full bg-transparent d-flex justify-content-center flex-column">
|
||||
<button class="close pointer" data-dismiss="modal" type="button" aria-label="Close">
|
||||
<button class="close pointer" data-dismiss="modal" type="button" aria-label="Close" id="trailerClose">
|
||||
<span>×</span>
|
||||
</button>
|
||||
<div class="trailer w-full position-relative">
|
||||
|
|
@ -250,11 +250,11 @@
|
|||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="browse" class="flex-column border-top">
|
||||
<div class="gallery browse h-full overflow-y-auto">
|
||||
<section id="browse" class="flex-column">
|
||||
<div class="gallery browse overflow-y-auto">
|
||||
</div>
|
||||
</section>
|
||||
<section id="home" class="flex-column border-top overflow-y-auto">
|
||||
<section id="home" class="flex-column overflow-y-auto">
|
||||
<div class="h-full p-10">
|
||||
<a class="d-flex px-20 align-items-end pointer text-decoration-none" id="homeContinueMore"
|
||||
data-function="continue" href="#browse">
|
||||
|
|
@ -594,11 +594,11 @@
|
|||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="downloads" class="flex-column border-top">
|
||||
<section id="downloads" class="flex-column">
|
||||
<div class="gallery downloads h-full overflow-y-auto">
|
||||
</div>
|
||||
</section>
|
||||
<section id="playlist" class="flex-column border-top">
|
||||
<section id="playlist" class="flex-column">
|
||||
<div class="gallery playlist h-full overflow-y-auto">
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -427,6 +427,9 @@ function viewAnime(media) {
|
|||
viewEpisodesWrapper.classList.add("hidden")
|
||||
}
|
||||
}
|
||||
trailerClose.onclick = () => {
|
||||
trailerVideo.src = ""
|
||||
}
|
||||
function trailerPopup(trailer) {
|
||||
trailerVideo.src = ""
|
||||
halfmoon.toggleModal("trailer")
|
||||
|
|
@ -435,7 +438,6 @@ function trailerPopup(trailer) {
|
|||
trailerVideo.src = "https://www.youtube.com/embed/" + trailer.id
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
//details list factory
|
||||
function detailsCreator(entry) {
|
||||
|
|
|
|||
|
|
@ -57,14 +57,16 @@ async function loadHomePage() {
|
|||
homeReleases.innerHTML = ''
|
||||
homeReleases.appendChild(gallerySkeletonFrag(4))
|
||||
resolveFileMedia({ fileName: doc.querySelector("item").querySelector("title").innerHTML, method: "SearchName", isRelease: true }).then(mediaInformation => {
|
||||
let notification = new Notification(mediaInformation.media.title.userPreferred, {
|
||||
body: `Episode ${mediaInformation.episode} was just released!`,
|
||||
icon: mediaInformation.media.coverImage.medium
|
||||
});
|
||||
notification.onclick = async () => {
|
||||
window.parent.focus();
|
||||
addTorrent(doc.querySelector("item").querySelector("link").innerHTML, { media: mediaInformation.media, episode: mediaInformation.episode })
|
||||
store[mediaInformation.parseObject.anime_title] = await alRequest({ id: mediaInformation.media.id, method: "SearchIDSingle" }).then(res => res.data.Media)
|
||||
if (settings.other3) {
|
||||
let notification = new Notification(mediaInformation.media.title.userPreferred, {
|
||||
body: `Episode ${mediaInformation.episode} was just released!`,
|
||||
icon: mediaInformation.media.coverImage.medium
|
||||
});
|
||||
notification.onclick = async () => {
|
||||
window.parent.focus();
|
||||
addTorrent(doc.querySelector("item").querySelector("link").innerHTML, { media: mediaInformation.media, episode: mediaInformation.episode })
|
||||
store[mediaInformation.parseObject.anime_title] = await alRequest({ id: mediaInformation.media.id, method: "SearchIDSingle" }).then(res => res.data.Media)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -123,7 +125,7 @@ async function loadHomePage() {
|
|||
let frag = document.createDocumentFragment(),
|
||||
date = new Date()
|
||||
opts.media.forEach(media => {
|
||||
if (opts.schedule && (!lastDate || (new Date(+date + media.nextAiringEpisode.timeUntilAiring * 1000).getDay() != lastDate.getDay()))) {
|
||||
if (opts.schedule && media.nextAiringEpisode?.timeUntilAiring && (!lastDate || (new Date(+date + media.nextAiringEpisode.timeUntilAiring * 1000).getDay() != lastDate.getDay()))) {
|
||||
let div = document.createElement("div")
|
||||
lastDate = new Date(+date + media.nextAiringEpisode.timeUntilAiring * 1000)
|
||||
div.classList.add("day-row", "font-size-24", "font-weight-bold", "h-50", "d-flex", "align-items-end")
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ async function buildVideo(torrent, opts) { // sets video source and creates a bu
|
|||
navNowPlaying.classList.remove("d-none")
|
||||
} else { // try to resolve name
|
||||
let mediaInformation = await resolveFileMedia({ fileName: selectedFile.name, method: "SearchName" })
|
||||
playerData.nowPlaying = [mediaInformation.media, mediaInformation.parseObject.episode_number]
|
||||
playerData.nowPlaying = [mediaInformation.media, mediaInformation.episode]
|
||||
if (mediaInformation.media) {
|
||||
navNowPlaying.classList.remove("d-none")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue