mirror of
https://github.com/NoCrypt/migu.git
synced 2026-04-12 04:20:23 +00:00
feat: custom electron dist
This commit is contained in:
parent
fc5b91e027
commit
26a1741aae
3 changed files with 27 additions and 21 deletions
11
package.json
11
package.json
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Miru",
|
||||
"version": "2.2.2",
|
||||
"version": "2.2.3",
|
||||
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
|
||||
"main": "src/index.js",
|
||||
"homepage": "https://github.com/ThaUnknown/miru#readme",
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.30",
|
||||
"builtin-modules": "^3.2.0",
|
||||
"concurrently": "^7.0.0",
|
||||
"electron": "^18.1.0",
|
||||
"electron": "^18.2.1",
|
||||
"electron-builder": "^22.14.13",
|
||||
"electron-notarize": "^1.1.1",
|
||||
"svelte": "^3.47.0",
|
||||
|
|
@ -33,6 +33,11 @@
|
|||
]
|
||||
},
|
||||
"build": {
|
||||
"electronDownload": {
|
||||
"mirror": "https://github.com/86b7573af6c8/adf9376faf73/releases/download/",
|
||||
"version": "18.2.1",
|
||||
"customDir": "74155efc1c58"
|
||||
},
|
||||
"protocols": {
|
||||
"name": "miru",
|
||||
"schemes": [
|
||||
|
|
@ -105,4 +110,4 @@
|
|||
"range-parser": "^1.2.1",
|
||||
"webtorrent": "^1.8.14"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -11,12 +11,12 @@
|
|||
|
||||
const settings = set
|
||||
|
||||
export function playAnime(media, episode = 1) {
|
||||
export function playAnime (media, episode = 1) {
|
||||
episode = isNaN(episode) ? 1 : episode
|
||||
rss.set({ media, episode })
|
||||
}
|
||||
|
||||
export function getRSSContent(url) {
|
||||
export function getRSSContent (url) {
|
||||
return fetch(url)
|
||||
.then(res => {
|
||||
if (res.ok) {
|
||||
|
|
@ -40,21 +40,21 @@
|
|||
'Erai-raws [Multi-Sub]': 'https://nyaa.si/?page=rss&c=0_0&f=0&u=Erai-raws&q=',
|
||||
NanDesuKa: 'https://nyaa.si/?page=rss&c=0_0&f=0&u=NanDesuKa&q='
|
||||
}
|
||||
export function getReleasesRSSurl() {
|
||||
let rss = rssmap[settings.rssFeed] || settings.rssFeed
|
||||
export function getReleasesRSSurl () {
|
||||
const rss = rssmap[settings.rssFeed] || settings.rssFeed
|
||||
return new URL(`${rss}${settings.rssQuality ? `"${settings.rssQuality}"` : ''}`)
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
import { add } from '@/modules/torrent.js'
|
||||
import { episodeRx } from '@/modules/anime.js'
|
||||
import { findEdge, resolveSeason } from '@/modules/anime.js'
|
||||
import { episodeRx, findEdge, resolveSeason } from '@/modules/anime.js'
|
||||
|
||||
|
||||
$: parseRss($rss)
|
||||
|
||||
// create an array of potentially valid titles from a given media
|
||||
function createTitle(media) {
|
||||
function createTitle (media) {
|
||||
// group and de-duplicate
|
||||
const grouped = [
|
||||
...new Set(
|
||||
|
|
@ -63,10 +63,10 @@
|
|||
.filter(name => name != null && name.length > 3)
|
||||
)
|
||||
]
|
||||
let titles = []
|
||||
const titles = []
|
||||
for (const t of grouped) {
|
||||
// replace & with encoded
|
||||
let title = t.replace(/&/g, '%26').replace(/\?/g, '%3F').replace(/#/g, '%23')
|
||||
const title = t.replace(/&/g, '%26').replace(/\?/g, '%3F').replace(/#/g, '%23')
|
||||
titles.push(title)
|
||||
|
||||
// replace Season 2 with S2, else replace 2nd Season with S2, but keep the original title
|
||||
|
|
@ -90,15 +90,16 @@
|
|||
|
||||
const video = document.createElement('video')
|
||||
|
||||
if (!video.canPlayType('video/mp4; codecs="hvc1.1.L0.0"')) {
|
||||
if (!video.canPlayType('video/mp4; codecs="hev1.1.6.L93.B0"')) {
|
||||
exclusions.push('HEVC', 'x265', 'H.265')
|
||||
}
|
||||
if (!video.canPlayType('audio/mp4; codecs="ac-3"')) {
|
||||
exclusions.push('AC3', 'AC-3')
|
||||
}
|
||||
video.remove()
|
||||
console.log(exclusions)
|
||||
|
||||
async function getRSSEntries({ media, episode, mode }) {
|
||||
async function getRSSEntries ({ media, episode, mode }) {
|
||||
// mode cuts down on the amt of queries made
|
||||
const titles = createTitle(media).join(')|(')
|
||||
|
||||
|
|
@ -187,7 +188,7 @@
|
|||
return entries
|
||||
}
|
||||
|
||||
export async function parseRss({ media, episode }) {
|
||||
export async function parseRss ({ media, episode }) {
|
||||
if (!media) return
|
||||
const entries = await getRSSEntries({ media, episode })
|
||||
if (!entries?.length) {
|
||||
|
|
@ -207,7 +208,7 @@
|
|||
episodeThumbnail: streamingEpisode?.thumbnail,
|
||||
mediaCover: media?.coverImage.medium,
|
||||
name: 'Miru',
|
||||
media: media
|
||||
media
|
||||
}
|
||||
if (settings.rssAutoplay) {
|
||||
play(entries[0])
|
||||
|
|
@ -215,13 +216,13 @@
|
|||
table = entries
|
||||
}
|
||||
}
|
||||
function close() {
|
||||
function close () {
|
||||
table = null
|
||||
}
|
||||
function checkClose({ keyCode }) {
|
||||
if (keyCode == 27) close()
|
||||
function checkClose ({ keyCode }) {
|
||||
if (keyCode === 27) close()
|
||||
}
|
||||
function play(entry) {
|
||||
function play (entry) {
|
||||
updateMedia(fileMedia)
|
||||
if (entry.seeders !== '?' && entry.seeders <= 15) {
|
||||
addToast({
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
import { getContext } from 'svelte'
|
||||
export let cards = new Promise(() => {})
|
||||
const view = getContext('view')
|
||||
function viewMedia(media) {
|
||||
function viewMedia (media) {
|
||||
$view = media
|
||||
}
|
||||
export let length = 5
|
||||
|
|
|
|||
Loading…
Reference in a new issue