Skip to content

Commit

Permalink
fix: incorrect audio files if click from search (close AlistGo/alist#…
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Dec 31, 2023
1 parent a8866ce commit f1fc0f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pages/home/folder/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const SearchResult = (props: { node: SearchNode; keywords: string }) => {
cursor="pointer"
px="$2"
as={LinkWithBase}
href={props.node.path}
href={`${props.node.path}?from=search`}
encode
onMouseEnter={() => {
setPathAs(props.node.path, props.node.is_dir)
Expand Down
5 changes: 3 additions & 2 deletions src/pages/home/previews/audio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ import "./audio.css"
import APlayer from "aplayer"
import { Box } from "@hope-ui/solid"
import { onCleanup, onMount } from "solid-js"
import { useLink } from "~/hooks"
import { useLink, useRouter } from "~/hooks"
import { getSetting, getSettingBool, objStore } from "~/store"
import { ObjType, StoreObj } from "~/types"
import { baseName } from "~/utils"

const Preview = () => {
const { proxyLink, rawLink } = useLink()
const { searchParams } = useRouter()
let audios = objStore.objs.filter((obj) => obj.type === ObjType.AUDIO)
if (audios.length === 0) {
if (audios.length === 0 || searchParams["from"] === "search") {
audios = [objStore.obj]
}
let ap: any
Expand Down

0 comments on commit f1fc0f9

Please sign in to comment.