mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-06-06 05:38:44 +08:00
Update
This commit is contained in:
@@ -12,7 +12,10 @@ const STATIC_FILES = ["/common.css", "/scrollBar.css", "/sw.js", "/sw.js.map"];
|
||||
export async function handler(req: Request, ctx: MiddlewareHandlerContext) {
|
||||
const url = new URL(req.url);
|
||||
if (url.pathname == "/sw.js") {
|
||||
const base = import.meta.resolve("../static").slice(8);
|
||||
let base = import.meta.resolve("../static").slice(7);
|
||||
if (Deno.build.os === "windows") {
|
||||
base = base.slice(1);
|
||||
}
|
||||
const map_file = join(base, "sw.meta.json");
|
||||
if (!(await checkMapFile(map_file))) {
|
||||
const data = await build({
|
||||
@@ -57,7 +60,10 @@ export async function handler(req: Request, ctx: MiddlewareHandlerContext) {
|
||||
}
|
||||
}
|
||||
if (STATIC_FILES.includes(url.pathname)) {
|
||||
const base = import.meta.resolve("../static").slice(8);
|
||||
let base = import.meta.resolve("../static").slice(7);
|
||||
if (Deno.build.os === "windows") {
|
||||
base = base.slice(1);
|
||||
}
|
||||
const file = join(base, url.pathname.slice(1));
|
||||
const opts: GetFileResponseOptions = {};
|
||||
opts.range = req.headers.get("Range");
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Handlers } from "$fresh/server.ts";
|
||||
import { get_task_manager } from "../../../../../server.ts";
|
||||
import { get_export_zip_response } from "../../../../../server/export_zip.ts";
|
||||
import { parse_bool, parse_int } from "../../../../../server/parse_form.ts";
|
||||
import { ExportZipConfig } from "../../../../../tasks/export_zip.ts";
|
||||
import type { ExportZipConfig } from "../../../../../tasks/export_zip.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
async GET(req, ctx) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Handlers } from "$fresh/server.ts";
|
||||
import { EhFileMeta } from "../../db.ts";
|
||||
import type { EhFileMeta } from "../../db.ts";
|
||||
import { get_task_manager } from "../../server.ts";
|
||||
import { get_string, parse_bool, parse_int } from "../../server/parse_form.ts";
|
||||
import { return_data, return_error } from "../../server/utils.ts";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Handlers } from "$fresh/server.ts";
|
||||
import { get_task_manager } from "../../../server.ts";
|
||||
import { EhFiles } from "../../../server/files.ts";
|
||||
import type { EhFiles } from "../../../server/files.ts";
|
||||
import { return_data } from "../../../server/utils.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Handlers } from "$fresh/server.ts";
|
||||
import { get_task_manager } from "../../../server.ts";
|
||||
import { GalleryData } from "../../../server/gallery.ts";
|
||||
import type { GalleryData } from "../../../server/gallery.ts";
|
||||
import { return_data, return_error } from "../../../server/utils.ts";
|
||||
|
||||
export const handler: Handlers = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Handlers } from "$fresh/server.ts";
|
||||
import { get_task_manager } from "../../server.ts";
|
||||
import { StatusData } from "../../server/status.ts";
|
||||
import type { StatusData } from "../../server/status.ts";
|
||||
import { return_data } from "../../server/utils.ts";
|
||||
import { check_ffmpeg_binary } from "../../thumbnail/ffmpeg_binary.ts";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Handlers } from "$fresh/server.ts";
|
||||
import { get_task_manager } from "../../server.ts";
|
||||
import { Task, TaskProgress } from "../../task.ts";
|
||||
import {
|
||||
import type { Task, TaskProgress } from "../../task.ts";
|
||||
import type {
|
||||
TaskClientSocketData,
|
||||
TaskServerSocketData,
|
||||
} from "../../server/task.ts";
|
||||
|
||||
Reference in New Issue
Block a user