From fa7bdbb9f9f204a85df1b236f2efab60d7b6e784 Mon Sep 17 00:00:00 2001 From: Ben Adrian Sarmiento Date: Sun, 24 Sep 2023 19:16:27 +0200 Subject: [PATCH] 3.6.2 (#76) * Fixes * prisma generate fix --- Dockerfile | 3 ++- package-lock.json | 4 ++-- package.json | 2 +- src/pages/troubleshooting.tsx | 44 +++++++++++++++++++++++++++++++---- src/utils/toastOptions.ts | 5 ++++ 5 files changed, 50 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3dc924e..cd2bb19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,13 +15,14 @@ RUN npm install # ---- Build ---- FROM dependencies AS build COPY . . -RUN npm run prisma:generate RUN npm run build # --- Release ---- FROM base AS release # copy production node_modules COPY --from=dependencies /app/prod_node_modules ./node_modules +# generate prisma client in node_modules +RUN npm run prisma:generate # copy app sources COPY . . # copy build files from build image diff --git a/package-lock.json b/package-lock.json index 6d27853..3b32712 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "debrid-media-manager", - "version": "3.6.1", + "version": "3.6.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "debrid-media-manager", - "version": "3.6.1", + "version": "3.6.2", "dependencies": { "@ctrl/video-filename-parser": "^4.12.0", "@octokit/rest": "^19.0.7", diff --git a/package.json b/package.json index 4874251..5fabf25 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "debrid-media-manager", - "version": "3.6.1", + "version": "3.6.2", "private": false, "scripts": { "dev": "next dev", diff --git a/src/pages/troubleshooting.tsx b/src/pages/troubleshooting.tsx index d11c7df..6f57318 100644 --- a/src/pages/troubleshooting.tsx +++ b/src/pages/troubleshooting.tsx @@ -1,9 +1,11 @@ import { useAllDebridApiKey, useRealDebridAccessToken } from '@/hooks/auth'; import { getMagnetStatus } from '@/services/allDebrid'; import { getUserTorrentsList } from '@/services/realDebrid'; +import { genericToastOptions } from '@/utils/toastOptions'; import { withAuth } from '@/utils/withAuth'; import getConfig from 'next/config'; import { useState } from 'react'; +import toast, { Toaster } from 'react-hot-toast'; function TroubleshootingPage() { const { publicRuntimeConfig: config } = getConfig(); @@ -16,6 +18,38 @@ function TroubleshootingPage() { const [testRunning, setTestRunning] = useState(false); const startTest = async () => { + let cachedRdDownloads = JSON.parse( + localStorage.getItem('rd:downloads')?.toString() || '{}' + ); + setTestResults( + (prev) => + prev + `Real-Debrid cached downloads: ${Object.keys(cachedRdDownloads).length}\n` + ); + localStorage.removeItem('rd:downloads'); + + cachedRdDownloads = JSON.parse(localStorage.getItem('rd:downloads')?.toString() || '{}'); + setTestResults( + (prev) => + prev + `Real-Debrid refreshed downloads: ${Object.keys(cachedRdDownloads).length}\n` + ); + setTestResults((prev) => prev + `-----\n`); + + let cachedAdDownloads = JSON.parse( + localStorage.getItem('ad:downloads')?.toString() || '{}' + ); + setTestResults( + (prev) => + prev + `AllDebrid cached downloads: ${Object.keys(cachedAdDownloads).length}\n` + ); + localStorage.removeItem('ad:downloads'); + + cachedAdDownloads = JSON.parse(localStorage.getItem('ad:downloads')?.toString() || '{}'); + setTestResults( + (prev) => + prev + `AllDebrid refreshed downloads: ${Object.keys(cachedAdDownloads).length}\n` + ); + setTestResults((prev) => prev + `-----\n`); + setTestRunning(true); if (rdKey) { setTestResults((prev) => prev + `Real-Debrid base URL: ${config.realDebridHostname}\n`); @@ -79,10 +113,11 @@ function TroubleshootingPage() { } setTestResults((prev) => prev + `-----\n`); } - setTestResults( - (prev) => - prev + - `Test complete. Copy this and send to r/debridmediamanager or send to my Discord @ yowmamasita\n` + setTestResults((prev) => prev + `Test complete!\n`); + + toast( + 'Copy this and send to r/debridmediamanager or send to my Discord @ yowmamasita', + genericToastOptions ); }; @@ -95,6 +130,7 @@ function TroubleshootingPage() { )} {testRunning &&
{testResults}
} + ); } diff --git a/src/utils/toastOptions.ts b/src/utils/toastOptions.ts index 9a94068..5760922 100644 --- a/src/utils/toastOptions.ts +++ b/src/utils/toastOptions.ts @@ -16,3 +16,8 @@ export const libraryToastOptions = { ...globalToastOptions, icon: '📚', }; + +export const genericToastOptions = { + ...globalToastOptions, + icon: '📢', +};