mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-03-11 22:15:35 +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",
|
||||
"version": "6.3.21",
|
||||
"version": "6.3.22",
|
||||
"license": "BUSL-1.1",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@9.14.4",
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
|
||||
$: 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) {
|
||||
if (!state) {
|
||||
|
|
@ -126,8 +126,8 @@
|
|||
async function startAnimation (searchRes: typeof searchResult) {
|
||||
if (!$settings.searchAutoSelect) return
|
||||
animating = false
|
||||
await searchRes
|
||||
if (searchRes === searchResult) animating = true
|
||||
const results = await searchRes
|
||||
if (searchRes === searchResult && results && results.results.length) animating = true
|
||||
}
|
||||
|
||||
function stopAnimation () {
|
||||
|
|
@ -160,7 +160,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='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'>
|
||||
<Input
|
||||
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
|
||||
}
|
||||
|
||||
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
|
||||
const workers = storage.workers
|
||||
if (!Object.values(workers).length) {
|
||||
|
|
@ -73,7 +73,7 @@ export const extensions = new class Extensions {
|
|||
|
||||
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 anidbAid = aniDBMeta?.mappings?.anidb_id
|
||||
|
|
@ -103,8 +103,7 @@ export const extensions = new class Extensions {
|
|||
try {
|
||||
const promises: Array<Promise<TorrentResult[]>> = []
|
||||
promises.push(worker.single(options))
|
||||
if (movie) promises.push(worker.movie(options))
|
||||
if (batch) promises.push(worker.batch(options))
|
||||
promises.push(movie ? worker.movie(options) : worker.batch(options))
|
||||
|
||||
for (const result of await Promise.allSettled(promises)) {
|
||||
if (result.status === 'fulfilled') {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ export default {
|
|||
searchQuality: '1080' as keyof typeof videoResolutions,
|
||||
rssFeedsNew: SUPPORTS.isAndroid ? [['New Releases', 'SubsPlease']] : [],
|
||||
searchAutoSelect: true,
|
||||
searchBatch: true,
|
||||
lookupPreference: 'quality' as 'quality' | 'size' | 'seeders',
|
||||
torrentSpeed: 40,
|
||||
torrentPersist: false,
|
||||
|
|
|
|||
Loading…
Reference in a new issue