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