mirror of
https://github.com/NoCrypt/migu.git
synced 2026-04-21 00:22:08 +00:00
feat: add timestamps to cards and RSS feeds
This commit is contained in:
parent
7b3045d973
commit
5a687c0cd5
7 changed files with 40 additions and 9 deletions
|
|
@ -23,6 +23,9 @@ One of four reasons:
|
||||||
- your ISP blocks Nyaa, see [this tutorial](https://thewiki.moe/en/tutorials/unblock) for a fix
|
- your ISP blocks Nyaa, see [this tutorial](https://thewiki.moe/en/tutorials/unblock) for a fix
|
||||||
- the app couldn't find a matching torrent for the anime
|
- the app couldn't find a matching torrent for the anime
|
||||||
|
|
||||||
|
## **I selected an episode to play, but Miru plays something else!**
|
||||||
|
Finding desired episodes can sometimes be difficult, if Miru auto-selects an episode incorrectly you can either disable auto-play torrents in settings to select torrents yourself during episode choosing, or manually find and paste in a .torrent file URL or a magnet URL into Miru to play a desired episode manually.
|
||||||
|
|
||||||
## **Will you make an android version?**
|
## **Will you make an android version?**
|
||||||
No. This app cannot be ported to android in any way.
|
No. This app cannot be ported to android in any way.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "Miru",
|
"name": "Miru",
|
||||||
"version": "3.9.10",
|
"version": "3.10.0",
|
||||||
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
|
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
|
||||||
"description": "Stream anime torrents, real-time with no waiting for downloads.",
|
"description": "Stream anime torrents, real-time with no waiting for downloads.",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
|
|
@ -111,7 +111,7 @@
|
||||||
"discord-rpc": "4.0.1",
|
"discord-rpc": "4.0.1",
|
||||||
"electron-log": "^4.4.8",
|
"electron-log": "^4.4.8",
|
||||||
"electron-updater": "^4.6.5",
|
"electron-updater": "^4.6.5",
|
||||||
"jassub": "1.5.12",
|
"jassub": "1.5.13",
|
||||||
"js-levenshtein": "^1.1.6",
|
"js-levenshtein": "^1.1.6",
|
||||||
"matroska-subtitles": "github:ThaUnknown/matroska-subtitles#redist",
|
"matroska-subtitles": "github:ThaUnknown/matroska-subtitles#redist",
|
||||||
"mime": "^3.0.0",
|
"mime": "^3.0.0",
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ specifiers:
|
||||||
electron-log: ^4.4.8
|
electron-log: ^4.4.8
|
||||||
electron-notarize: ^1.2.2
|
electron-notarize: ^1.2.2
|
||||||
electron-updater: ^4.6.5
|
electron-updater: ^4.6.5
|
||||||
jassub: 1.5.12
|
jassub: 1.5.13
|
||||||
js-levenshtein: ^1.1.6
|
js-levenshtein: ^1.1.6
|
||||||
matroska-subtitles: github:ThaUnknown/matroska-subtitles#redist
|
matroska-subtitles: github:ThaUnknown/matroska-subtitles#redist
|
||||||
mime: ^3.0.0
|
mime: ^3.0.0
|
||||||
|
|
@ -36,7 +36,7 @@ dependencies:
|
||||||
discord-rpc: 4.0.1
|
discord-rpc: 4.0.1
|
||||||
electron-log: 4.4.8
|
electron-log: 4.4.8
|
||||||
electron-updater: 4.6.5
|
electron-updater: 4.6.5
|
||||||
jassub: 1.5.12
|
jassub: 1.5.13
|
||||||
js-levenshtein: 1.1.6
|
js-levenshtein: 1.1.6
|
||||||
matroska-subtitles: github.com/ThaUnknown/matroska-subtitles/6241556509536ff09ba2ea3f050ceb7a3f12190a
|
matroska-subtitles: github.com/ThaUnknown/matroska-subtitles/6241556509536ff09ba2ea3f050ceb7a3f12190a
|
||||||
mime: 3.0.0
|
mime: 3.0.0
|
||||||
|
|
@ -1873,8 +1873,8 @@ packages:
|
||||||
minimatch: 3.1.2
|
minimatch: 3.1.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/jassub/1.5.12:
|
/jassub/1.5.13:
|
||||||
resolution: {integrity: sha512-CJiuNCXMMGqfmVVlaDyxqaKfOy3RIHW4HBwVWvbq8pl/d1/y1fgTarfR31whUUupHZCe7Tfq8XB7WDgdu6IHaA==}
|
resolution: {integrity: sha512-mQM88BcYgppvpPG6VE+DPQm7r6QS65EBedbm13RE4lRIhdrnQ+ihWhBOZXYZe3SlGhg+ROIDRK8uY4dm9ER2XQ==}
|
||||||
dependencies:
|
dependencies:
|
||||||
rvfc-polyfill: 1.0.4
|
rvfc-polyfill: 1.0.4
|
||||||
dev: false
|
dev: false
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { countdown, wrapEnter } from '@/modules/util.js'
|
import { countdown, since, wrapEnter } from '@/modules/util.js'
|
||||||
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')
|
||||||
|
|
@ -74,6 +74,11 @@
|
||||||
{'EP ' + card.media.nextAiringEpisode.episode + ' in ' + countdown(card.media.nextAiringEpisode.timeUntilAiring)}
|
{'EP ' + card.media.nextAiringEpisode.episode + ' in ' + countdown(card.media.nextAiringEpisode.timeUntilAiring)}
|
||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if card.date}
|
||||||
|
<span class='text-muted font-weight-bold'>
|
||||||
|
{since(card.date)}
|
||||||
|
</span>
|
||||||
|
{/if}
|
||||||
<p class='text-muted m-0 text-capitalize details'>
|
<p class='text-muted m-0 text-capitalize details'>
|
||||||
<span class='text-nowrap'>
|
<span class='text-nowrap'>
|
||||||
{#if card.media.format === 'TV'}
|
{#if card.media.format === 'TV'}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@
|
||||||
hasNext = items.length === limit
|
hasNext = items.length === limit
|
||||||
const media = await resolveFileMedia(items.map(item => item.querySelector('title').textContent))
|
const media = await resolveFileMedia(items.map(item => item.querySelector('title').textContent))
|
||||||
media.forEach((mediaInformation, index) => {
|
media.forEach((mediaInformation, index) => {
|
||||||
|
mediaInformation.date = new Date(items[index].querySelector('pubDate').textContent)
|
||||||
mediaInformation.onclick = () => {
|
mediaInformation.onclick = () => {
|
||||||
add(items[index].querySelector('link').textContent)
|
add(items[index].querySelector('link').textContent)
|
||||||
}
|
}
|
||||||
|
|
@ -290,7 +291,7 @@
|
||||||
const newData = await self.load(1, 6, false, false)
|
const newData = await self.load(1, 6, false, false)
|
||||||
if (newData) self.previewData = newData
|
if (newData) self.previewData = newData
|
||||||
}, 15000)
|
}, 15000)
|
||||||
self.previewData = await self.load(1, 6, false, false)
|
self.previewData = await self.load(1, 6, false, true)
|
||||||
}
|
}
|
||||||
return self.previewData
|
return self.previewData
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script context='module'>
|
<script context='module'>
|
||||||
import { DOMPARSER, wrapEnter } from '@/modules/util.js'
|
import { DOMPARSER, wrapEnter, since } from '@/modules/util.js'
|
||||||
import { set } from './Settings.svelte'
|
import { set } from './Settings.svelte'
|
||||||
import { addToast } from './Toasts.svelte'
|
import { addToast } from './Toasts.svelte'
|
||||||
import { alRequest } from '@/modules/anilist.js'
|
import { alRequest } from '@/modules/anilist.js'
|
||||||
|
|
@ -321,6 +321,7 @@
|
||||||
<th scope='col'>Seed</th>
|
<th scope='col'>Seed</th>
|
||||||
<th scope='col'>Leech</th>
|
<th scope='col'>Leech</th>
|
||||||
<th scope='col'>Downloads</th>
|
<th scope='col'>Downloads</th>
|
||||||
|
<th scope='col'>Released</th>
|
||||||
<th scope='col'>Play</th>
|
<th scope='col'>Play</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
@ -333,6 +334,7 @@
|
||||||
<td>{row.seeders}</td>
|
<td>{row.seeders}</td>
|
||||||
<td>{row.leechers}</td>
|
<td>{row.leechers}</td>
|
||||||
<td>{row.downloads}</td>
|
<td>{row.downloads}</td>
|
||||||
|
<td>{since(row.date)}</td>
|
||||||
<td class='material-icons font-size-20'>play_arrow</td>
|
<td class='material-icons font-size-20'>play_arrow</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,26 @@ export function countdown (s) {
|
||||||
return tmp.join(' ')
|
return tmp.join(' ')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function since (date) {
|
||||||
|
const formatter = new Intl.RelativeTimeFormat('en')
|
||||||
|
const ranges = {
|
||||||
|
years: 3600 * 24 * 365,
|
||||||
|
months: 3600 * 24 * 30,
|
||||||
|
weeks: 3600 * 24 * 7,
|
||||||
|
days: 3600 * 24,
|
||||||
|
hours: 3600,
|
||||||
|
minutes: 60,
|
||||||
|
seconds: 1
|
||||||
|
}
|
||||||
|
const secondsElapsed = (date.getTime() - Date.now()) / 1000
|
||||||
|
for (const key in ranges) {
|
||||||
|
if (ranges[key] < Math.abs(secondsElapsed)) {
|
||||||
|
const delta = secondsElapsed / ranges[key]
|
||||||
|
return formatter.format(Math.round(delta), key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const units = [' B', ' kB', ' MB', ' GB', ' TB']
|
const units = [' B', ' kB', ' MB', ' GB', ' TB']
|
||||||
export function fastPrettyBytes (num) {
|
export function fastPrettyBytes (num) {
|
||||||
if (isNaN(num)) return '0 B'
|
if (isNaN(num)) return '0 B'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue