mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-04 05:10:11 +00:00
Merge pull request #36 from aronjanosch/feature/german-audible-region-and-regional-title
Add German Audible region
This commit is contained in:
@@ -166,6 +166,7 @@ export function AudiobookshelfSection({
|
|||||||
<option value="uk">United Kingdom</option>
|
<option value="uk">United Kingdom</option>
|
||||||
<option value="au">Australia</option>
|
<option value="au">Australia</option>
|
||||||
<option value="in">India</option>
|
<option value="in">India</option>
|
||||||
|
<option value="de">Germany</option>
|
||||||
</select>
|
</select>
|
||||||
<p className="text-sm text-gray-500 dark:text-gray-400">
|
<p className="text-sm text-gray-500 dark:text-gray-400">
|
||||||
Select the Audible region that matches your metadata engine (Audnexus/Audible Agent)
|
Select the Audible region that matches your metadata engine (Audnexus/Audible Agent)
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ export function PlexSection({
|
|||||||
<option value="uk">United Kingdom</option>
|
<option value="uk">United Kingdom</option>
|
||||||
<option value="au">Australia</option>
|
<option value="au">Australia</option>
|
||||||
<option value="in">India</option>
|
<option value="in">India</option>
|
||||||
|
<option value="de">Germany</option>
|
||||||
</select>
|
</select>
|
||||||
<p className="text-sm text-gray-500 dark:text-gray-400">
|
<p className="text-sm text-gray-500 dark:text-gray-400">
|
||||||
Select the Audible region that matches your metadata engine (Audnexus/Audible Agent)
|
Select the Audible region that matches your metadata engine (Audnexus/Audible Agent)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { RMABLogger } from '@/lib/utils/logger';
|
|||||||
|
|
||||||
const logger = RMABLogger.create('API.Admin.Settings.Audible');
|
const logger = RMABLogger.create('API.Admin.Settings.Audible');
|
||||||
|
|
||||||
const VALID_REGIONS = ['us', 'ca', 'uk', 'au', 'in'];
|
const VALID_REGIONS = ['us', 'ca', 'uk', 'au', 'in', 'de'];
|
||||||
|
|
||||||
export async function PUT(request: NextRequest) {
|
export async function PUT(request: NextRequest) {
|
||||||
return requireAuth(request, async (req: AuthenticatedRequest) => {
|
return requireAuth(request, async (req: AuthenticatedRequest) => {
|
||||||
@@ -24,7 +24,7 @@ export async function PUT(request: NextRequest) {
|
|||||||
if (!region || !VALID_REGIONS.includes(region)) {
|
if (!region || !VALID_REGIONS.includes(region)) {
|
||||||
logger.warn('Invalid region provided', { region });
|
logger.warn('Invalid region provided', { region });
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
{ success: false, error: 'Invalid Audible region. Must be one of: us, ca, uk, au, in' },
|
{ success: false, error: 'Invalid Audible region. Must be one of: us, ca, uk, au, in, de' },
|
||||||
{ status: 400 }
|
{ status: 400 }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ export function BackendSelectionStep({
|
|||||||
<option value="uk">United Kingdom</option>
|
<option value="uk">United Kingdom</option>
|
||||||
<option value="au">Australia</option>
|
<option value="au">Australia</option>
|
||||||
<option value="in">India</option>
|
<option value="in">India</option>
|
||||||
|
<option value="de">Germany</option>
|
||||||
</select>
|
</select>
|
||||||
<p className="text-sm text-gray-600 dark:text-gray-400">
|
<p className="text-sm text-gray-600 dark:text-gray-400">
|
||||||
Select the Audible region that matches your metadata engine (Audnexus/Audible Agent)
|
Select the Audible region that matches your metadata engine (Audnexus/Audible Agent)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Documentation: documentation/integrations/audible.md
|
* Documentation: documentation/integrations/audible.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export type AudibleRegion = 'us' | 'ca' | 'uk' | 'au' | 'in';
|
export type AudibleRegion = 'us' | 'ca' | 'uk' | 'au' | 'in' | 'de';
|
||||||
|
|
||||||
export interface AudibleRegionConfig {
|
export interface AudibleRegionConfig {
|
||||||
code: AudibleRegion;
|
code: AudibleRegion;
|
||||||
@@ -43,6 +43,12 @@ export const AUDIBLE_REGIONS: Record<AudibleRegion, AudibleRegionConfig> = {
|
|||||||
baseUrl: 'https://www.audible.in',
|
baseUrl: 'https://www.audible.in',
|
||||||
audnexusParam: 'in',
|
audnexusParam: 'in',
|
||||||
},
|
},
|
||||||
|
de: {
|
||||||
|
code: 'de',
|
||||||
|
name: 'Germany',
|
||||||
|
baseUrl: 'https://www.audible.de',
|
||||||
|
audnexusParam: 'de',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DEFAULT_AUDIBLE_REGION: AudibleRegion = 'us';
|
export const DEFAULT_AUDIBLE_REGION: AudibleRegion = 'us';
|
||||||
|
|||||||
Reference in New Issue
Block a user