Sync DNS2 production changes - removed obsolete test suite and refactored structure
This commit is contained in:
@@ -14,7 +14,7 @@ module.exports = function(ctx, helpers) {
|
||||
|
||||
if (!plexToken) {
|
||||
return ctx.errorResponse(res, 400, 'No Plex token available. Claim your Plex server first.', {
|
||||
hint: 'Deploy Plex with a claim token or manually configure it.',
|
||||
hint: 'Deploy Plex with a claim token or manually configure it.'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ module.exports = function(ctx, helpers) {
|
||||
// Fetch libraries
|
||||
const libRes = await ctx.fetchT(`${plexUrl}/library/sections`, {
|
||||
headers: { 'X-Plex-Token': plexToken, 'Accept': 'application/json' },
|
||||
signal: AbortSignal.timeout(10000),
|
||||
signal: AbortSignal.timeout(10000)
|
||||
});
|
||||
|
||||
if (!libRes.ok) {
|
||||
@@ -45,7 +45,7 @@ module.exports = function(ctx, helpers) {
|
||||
title: dir.title,
|
||||
type: dir.type,
|
||||
count: parseInt(dir.count) || 0,
|
||||
scannedAt: dir.scannedAt,
|
||||
scannedAt: dir.scannedAt
|
||||
}));
|
||||
|
||||
// Get server name
|
||||
@@ -54,7 +54,7 @@ module.exports = function(ctx, helpers) {
|
||||
try {
|
||||
const identityRes = await ctx.fetchT(`${plexUrl}/identity`, {
|
||||
headers: { 'X-Plex-Token': plexToken, 'Accept': 'application/json' },
|
||||
signal: AbortSignal.timeout(5000),
|
||||
signal: AbortSignal.timeout(5000)
|
||||
});
|
||||
if (identityRes.ok) {
|
||||
const identity = await identityRes.json();
|
||||
@@ -66,7 +66,7 @@ module.exports = function(ctx, helpers) {
|
||||
// Store token for future use
|
||||
await ctx.credentialManager.store('arr.plex.token', plexToken, {
|
||||
service: 'plex', source: 'local', url: plexUrl,
|
||||
lastVerified: new Date().toISOString(),
|
||||
lastVerified: new Date().toISOString()
|
||||
});
|
||||
|
||||
res.json({ success: true, serverName, version, libraries });
|
||||
|
||||
Reference in New Issue
Block a user