mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-20 23:22:12 +00:00
fix: autoplay animation playing when no results are available
This commit is contained in:
parent
fb9ec3da12
commit
035e1dfdac
4 changed files with 7 additions and 10 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ui",
|
"name": "ui",
|
||||||
"version": "6.3.21",
|
"version": "6.3.22",
|
||||||
"license": "BUSL-1.1",
|
"license": "BUSL-1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@9.14.4",
|
"packageManager": "pnpm@9.14.4",
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
|
|
||||||
$: open = !!$searchStore.media
|
$: open = !!$searchStore.media
|
||||||
|
|
||||||
$: searchResult = !!$searchStore.media && extensions.getResultsFromExtensions({ media: $searchStore.media, episode: $searchStore.episode, batch: $settings.searchBatch, resolution: $settings.searchQuality })
|
$: searchResult = !!$searchStore.media && extensions.getResultsFromExtensions({ media: $searchStore.media, episode: $searchStore.episode, resolution: $settings.searchQuality })
|
||||||
|
|
||||||
function close (state = false) {
|
function close (state = false) {
|
||||||
if (!state) {
|
if (!state) {
|
||||||
|
|
@ -126,8 +126,8 @@
|
||||||
async function startAnimation (searchRes: typeof searchResult) {
|
async function startAnimation (searchRes: typeof searchResult) {
|
||||||
if (!$settings.searchAutoSelect) return
|
if (!$settings.searchAutoSelect) return
|
||||||
animating = false
|
animating = false
|
||||||
await searchRes
|
const results = await searchRes
|
||||||
if (searchRes === searchResult) animating = true
|
if (searchRes === searchResult && results && results.results.length) animating = true
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopAnimation () {
|
function stopAnimation () {
|
||||||
|
|
@ -160,7 +160,6 @@
|
||||||
<div class='gap-4 w-full relative h-full flex flex-col pt-6'>
|
<div class='gap-4 w-full relative h-full flex flex-col pt-6'>
|
||||||
<div class='px-4 sm:px-6 space-y-4'>
|
<div class='px-4 sm:px-6 space-y-4'>
|
||||||
<div class='font-weight-bold text-2xl font-bold text-ellipsis text-nowrap overflow-hidden pb-2'>{$searchStore.media ? title($searchStore.media) : ''}</div>
|
<div class='font-weight-bold text-2xl font-bold text-ellipsis text-nowrap overflow-hidden pb-2'>{$searchStore.media ? title($searchStore.media) : ''}</div>
|
||||||
|
|
||||||
<div class='flex items-center relative scale-parent'>
|
<div class='flex items-center relative scale-parent'>
|
||||||
<Input
|
<Input
|
||||||
class='pl-9 bg-background select:bg-accent select:text-accent-foreground shadow-sm no-scale placeholder:opacity-50'
|
class='pl-9 bg-background select:bg-accent select:text-accent-foreground shadow-sm no-scale placeholder:opacity-50'
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ export const extensions = new class Extensions {
|
||||||
return titles
|
return titles
|
||||||
}
|
}
|
||||||
|
|
||||||
async getResultsFromExtensions ({ media, episode, batch, resolution }: { media: Media, episode?: number, batch: boolean, resolution: keyof typeof videoResolutions }) {
|
async getResultsFromExtensions ({ media, episode, resolution }: { media: Media, episode?: number, resolution: keyof typeof videoResolutions }) {
|
||||||
await storage.modules
|
await storage.modules
|
||||||
const workers = storage.workers
|
const workers = storage.workers
|
||||||
if (!Object.values(workers).length) {
|
if (!Object.values(workers).length) {
|
||||||
|
|
@ -73,7 +73,7 @@ export const extensions = new class Extensions {
|
||||||
|
|
||||||
const movie = isMovie(media)
|
const movie = isMovie(media)
|
||||||
|
|
||||||
debug(`Fetching sources for ${media.id}:${media.title?.userPreferred} ${episode} ${batch} ${movie} ${resolution}`)
|
debug(`Fetching sources for ${media.id}:${media.title?.userPreferred} ${episode} ${movie} ${resolution}`)
|
||||||
|
|
||||||
const aniDBMeta = await this.ALToAniDB(media)
|
const aniDBMeta = await this.ALToAniDB(media)
|
||||||
const anidbAid = aniDBMeta?.mappings?.anidb_id
|
const anidbAid = aniDBMeta?.mappings?.anidb_id
|
||||||
|
|
@ -103,8 +103,7 @@ export const extensions = new class Extensions {
|
||||||
try {
|
try {
|
||||||
const promises: Array<Promise<TorrentResult[]>> = []
|
const promises: Array<Promise<TorrentResult[]>> = []
|
||||||
promises.push(worker.single(options))
|
promises.push(worker.single(options))
|
||||||
if (movie) promises.push(worker.movie(options))
|
promises.push(movie ? worker.movie(options) : worker.batch(options))
|
||||||
if (batch) promises.push(worker.batch(options))
|
|
||||||
|
|
||||||
for (const result of await Promise.allSettled(promises)) {
|
for (const result of await Promise.allSettled(promises)) {
|
||||||
if (result.status === 'fulfilled') {
|
if (result.status === 'fulfilled') {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ export default {
|
||||||
searchQuality: '1080' as keyof typeof videoResolutions,
|
searchQuality: '1080' as keyof typeof videoResolutions,
|
||||||
rssFeedsNew: SUPPORTS.isAndroid ? [['New Releases', 'SubsPlease']] : [],
|
rssFeedsNew: SUPPORTS.isAndroid ? [['New Releases', 'SubsPlease']] : [],
|
||||||
searchAutoSelect: true,
|
searchAutoSelect: true,
|
||||||
searchBatch: true,
|
|
||||||
lookupPreference: 'quality' as 'quality' | 'size' | 'seeders',
|
lookupPreference: 'quality' as 'quality' | 'size' | 'seeders',
|
||||||
torrentSpeed: 40,
|
torrentSpeed: 40,
|
||||||
torrentPersist: false,
|
torrentPersist: false,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue