Enhanced setup and settings pages with full configuration
- Extended SetupRequest model to include all configuration fields - Updated setup API endpoint to handle comprehensive configuration - Created new setup.html with organized configuration sections - Enhanced config modal in index.html with all settings - Updated JavaScript modules to use unified config API - Added backup configuration section - Documented new features in features.md and instructions.md
This commit is contained in:
@@ -92,8 +92,16 @@ AniWorld.NFOConfig = (function() {
|
||||
return;
|
||||
}
|
||||
|
||||
const nfoConfig = {
|
||||
tmdb_api_key: tmdbKey ? tmdbKey.value.trim() : null,
|
||||
// Get current config
|
||||
const configResponse = await AniWorld.ApiClient.get(AniWorld.Constants.API.CONFIG);
|
||||
if (!configResponse) {
|
||||
throw new Error('Failed to load current configuration');
|
||||
}
|
||||
const config = await configResponse.json();
|
||||
|
||||
// Update NFO settings
|
||||
config.nfo = {
|
||||
tmdb_api_key: tmdbKey ? tmdbKey.value.trim() || null : null,
|
||||
auto_create: autoCreate ? autoCreate.checked : false,
|
||||
update_on_scan: updateOnScan ? updateOnScan.checked : false,
|
||||
download_poster: downloadPoster ? downloadPoster.checked : true,
|
||||
@@ -103,13 +111,7 @@ AniWorld.NFOConfig = (function() {
|
||||
};
|
||||
|
||||
// Save configuration
|
||||
const response = await AniWorld.ApiClient.request(
|
||||
API.CONFIG,
|
||||
{
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ nfo: nfoConfig })
|
||||
}
|
||||
);
|
||||
const response = await AniWorld.ApiClient.put(AniWorld.Constants.API.CONFIG, config);
|
||||
|
||||
if (response) {
|
||||
AniWorld.UI.showToast('NFO configuration saved successfully', 'success');
|
||||
|
||||
Reference in New Issue
Block a user