chore(*): use prettier for formatting
This commit is contained in:
parent
6c659fe1d0
commit
ce869012ef
73 changed files with 1393 additions and 794 deletions
|
@ -45,12 +45,14 @@ export const runJobsMenu = async () => {
|
|||
apiUrl: `${config.url}/api/artist-import.php`,
|
||||
tokenEnvVar: 'ARTIST_IMPORT_TOKEN',
|
||||
method: 'POST',
|
||||
paramsPrompt: [{
|
||||
type: 'input',
|
||||
name: 'artistId',
|
||||
message: 'Enter the Navidrome artist ID:',
|
||||
validate: input => input ? true : 'Artist ID is required'
|
||||
}]
|
||||
paramsPrompt: [
|
||||
{
|
||||
type: 'input',
|
||||
name: 'artistId',
|
||||
message: 'Enter the Navidrome artist ID:',
|
||||
validate: (input) => (input ? true : 'Artist ID is required')
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '📖 Import book',
|
||||
|
@ -58,12 +60,14 @@ export const runJobsMenu = async () => {
|
|||
apiUrl: `${config.url}/api/book-import.php`,
|
||||
tokenEnvVar: 'BOOK_IMPORT_TOKEN',
|
||||
method: 'POST',
|
||||
paramsPrompt: [{
|
||||
type: 'input',
|
||||
name: 'isbn',
|
||||
message: 'Enter the book\'s ISBN:',
|
||||
validate: input => input ? true : 'ISBN is required'
|
||||
}]
|
||||
paramsPrompt: [
|
||||
{
|
||||
type: 'input',
|
||||
name: 'isbn',
|
||||
message: "Enter the book's ISBN:",
|
||||
validate: (input) => (input ? true : 'ISBN is required')
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '📽 Import movie or show',
|
||||
|
@ -72,19 +76,20 @@ export const runJobsMenu = async () => {
|
|||
tokenEnvVar: 'WATCHING_IMPORT_TOKEN',
|
||||
method: 'POST',
|
||||
tokenIncludeInParams: true,
|
||||
paramsPrompt: [{
|
||||
type: 'input',
|
||||
name: 'tmdb_id',
|
||||
message: 'Enter the TMDB ID:',
|
||||
validate: (input) =>
|
||||
/^\d+$/.test(input) ? true : 'Please enter a valid TMDB ID'
|
||||
},
|
||||
{
|
||||
type: 'list',
|
||||
name: 'media_type',
|
||||
message: 'Is this a movie or a show?',
|
||||
choices: ['movie', 'show']
|
||||
}]
|
||||
paramsPrompt: [
|
||||
{
|
||||
type: 'input',
|
||||
name: 'tmdb_id',
|
||||
message: 'Enter the TMDB ID:',
|
||||
validate: (input) => (/^\d+$/.test(input) ? true : 'Please enter a valid TMDB ID')
|
||||
},
|
||||
{
|
||||
type: 'list',
|
||||
name: 'media_type',
|
||||
message: 'Is this a movie or a show?',
|
||||
choices: ['movie', 'show']
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '📺 Import upcoming TV seasons',
|
||||
|
@ -92,17 +97,20 @@ export const runJobsMenu = async () => {
|
|||
apiUrl: `${config.url}/api/seasons-import.php`,
|
||||
tokenEnvVar: 'SEASONS_IMPORT_TOKEN',
|
||||
method: 'POST'
|
||||
}];
|
||||
}
|
||||
];
|
||||
|
||||
const { selectedJob } = await inquirer.prompt([{
|
||||
type: 'list',
|
||||
name: 'selectedJob',
|
||||
message: 'Select a job to run:',
|
||||
choices: JOBS.map((job, index) => ({
|
||||
name: job.name,
|
||||
value: index
|
||||
}))
|
||||
}]);
|
||||
const { selectedJob } = await inquirer.prompt([
|
||||
{
|
||||
type: 'list',
|
||||
name: 'selectedJob',
|
||||
message: 'Select a job to run:',
|
||||
choices: JOBS.map((job, index) => ({
|
||||
name: job.name,
|
||||
value: index
|
||||
}))
|
||||
}
|
||||
]);
|
||||
|
||||
const job = JOBS[selectedJob];
|
||||
|
||||
|
@ -124,7 +132,7 @@ export const runJobsMenu = async () => {
|
|||
|
||||
const runCurl = async ({
|
||||
urlEnvVar,
|
||||
apiUrl = "",
|
||||
apiUrl = '',
|
||||
tokenEnvVar,
|
||||
method = 'POST',
|
||||
name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue