Skip to content

Commit

Permalink
3.6.2 (#76)
Browse files Browse the repository at this point in the history
* Fixes

* prisma generate fix
  • Loading branch information
yowmamasita authored Sep 24, 2023
1 parent ae0801c commit fa7bdbb
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "debrid-media-manager",
"version": "3.6.1",
"version": "3.6.2",
"private": false,
"scripts": {
"dev": "next dev",
Expand Down
44 changes: 40 additions & 4 deletions src/pages/troubleshooting.tsx
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -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`);
Expand Down Expand Up @@ -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
);
};

Expand All @@ -95,6 +130,7 @@ function TroubleshootingPage() {
</button>
)}
{testRunning && <pre>{testResults}</pre>}
<Toaster position="bottom-right" />
</div>
);
}
Expand Down
5 changes: 5 additions & 0 deletions src/utils/toastOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ export const libraryToastOptions = {
...globalToastOptions,
icon: '📚',
};

export const genericToastOptions = {
...globalToastOptions,
icon: '📢',
};

0 comments on commit fa7bdbb

Please sign in to comment.