Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
QOBUZ_API_BASE = https://www.qobuz.com/api.json/0.2/
QOBUZ_APP_ID =
QOBUZ_SECRET =
QOBUZ_AUTH_TOKENS = []
QOBUZ_AUTH_TOKENS = [""]

NEXT_PUBLIC_APPLICATION_NAME = Qobuz-DL
NEXT_PUBLIC_DISCORD =


#Leave these empty unless you know what you're doing
CORS_PROXY =
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ FROM node:alpine

WORKDIR /app

COPY . .
COPY package*.json ./

RUN npm install

COPY . .

RUN npm run build

EXPOSE 3000

CMD ["npm", "run", "dev"]
CMD ["npm", "start"]
9 changes: 5 additions & 4 deletions app/api/get-artist/route.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { NextRequest, NextResponse } from "next/server";
import { getArtist } from "@/lib/qobuz-dl";
import z from "zod";

const artistReleasesParamsSchema = z.object({
artist_id: z.string().min(1, "ID is required")
})

export async function GET(request: Request) {
const params = Object.fromEntries(new URL(request.url).searchParams.entries());
export async function GET(request: NextRequest) {
const params = Object.fromEntries(request.nextUrl.searchParams.entries());
try {
const { artist_id } = artistReleasesParamsSchema.parse(params);
const artist = await getArtist(artist_id);
return new Response(JSON.stringify({ success: true, data: { artist } }), { status: 200 });
return NextResponse.json({ success: true, data: { artist } }, { status: 200 });
} catch (error: any) {
return new Response(JSON.stringify({ success: false, error: error?.errors || error.message || "An error occurred parsing the request." }), { status: 400 });
return NextResponse.json({ success: false, error: error?.errors || error.message || "An error occurred parsing the request." }, { status: 400 });
}
}
2 changes: 1 addition & 1 deletion app/api/get-releases/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const releasesParamsSchema = z.object({
artist_id: z.string().min(1, "ID is required"),
release_type: z.enum(["album", "live", "compilation", "epSingle", "download"]).default("album"),
track_size: z.number().positive().default(1000),
offset: z.preprocess((a) => parseInt(a as string), z.number().positive().default(0)),
offset: z.preprocess((a) => parseInt(a as string), z.number().min(0).default(0)),
limit: z.preprocess((a) => parseInt(a as string), z.number().positive().default(10))
})

Expand Down
7 changes: 4 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { FaGithub } from '@react-icons/all-files/fa/FaGithub';
import { FFmpegProvider } from '@/lib/ffmpeg-provider';
import { Inter } from 'next/font/google';
import type { Metadata } from 'next';
import Script from 'next/script';
import { SettingsProvider } from '@/lib/settings-provider';
import { StatusBarProvider } from '@/lib/status-bar/context';
import { ThemeProvider } from '@/components/theme-provider';
Expand All @@ -21,7 +22,7 @@ const inter = Inter({
});

export const metadata: Metadata = {
metadataBase: new URL('https://www.qobuz-dl.com/'), // Site URL
metadataBase: new URL('https://www.qobuz-dl.com/'),
title: {
default: process.env.NEXT_PUBLIC_APPLICATION_NAME + " - A frontend browser client for downloading music for Qobuz.",
template: process.env.NEXT_PUBLIC_APPLICATION_NAME!
Expand Down Expand Up @@ -99,9 +100,9 @@ export default function RootLayout({ children }: Readonly<{ children: React.Reac
</ThemeProvider>
</SettingsProvider>
</StatusBarProvider>
<script src="https://cdn.jsdelivr.net/npm/@ffmpeg/ffmpeg@0.9.7/dist/ffmpeg.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/fflate@0.8.2/umd/index.js"></script>
</FFmpegProvider>
<Script src="https://cdn.jsdelivr.net/npm/@ffmpeg/ffmpeg@0.11.6/dist/ffmpeg.min.js" strategy="beforeInteractive" />
<Script src="https://cdn.jsdelivr.net/npm/fflate@0.8.2/umd/index.js" strategy="beforeInteractive" />
</body>
</html>
);
Expand Down
Loading