Skip to content

Commit

Permalink
Merge pull request #393 from caorushizi/feat/package-version
Browse files Browse the repository at this point in the history
fix: 🐛  urlschema add headers params
  • Loading branch information
caorushizi authored Jan 1, 2025
2 parents c853dff + ba65323 commit fa41141
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions packages/renderer/src/pages/HomePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,28 @@ const HomePage: FC<Props> = ({ filter = DownloadFilter.list }) => {

// new
if (search.has("n")) {
const type = search.get("type");
const typeParam = search.get("type");
const silent = !!search.get("silent");
const url = search.get("url") || "";
const name = search.get("name") || randomName();
const type = isDownloadType(typeParam) ? typeParam : DownloadType.m3u8;
const headers = decodeURIComponent(search.get("headers") || "");

if (silent) {
const item: Omit<DownloadItem, "id"> = {
type: isDownloadType(type) ? type : DownloadType.m3u8,
url: search.get("url") || "",
name: search.get("name") || randomName(),
type,
url,
name,
headers,
};
downloadNow(item);
} else {
const item: DownloadFormType = {
batch: false,
type: isDownloadType(type) ? type : DownloadType.m3u8,
url: search.get("url") || "",
name: search.get("name") || randomName(),
type,
url,
name,
headers,
};
newFormRef.current?.openModal(item);
}
Expand Down

0 comments on commit fa41141

Please sign in to comment.