chore(cli): formatting + version consistency
This commit is contained in:
parent
fdd556df83
commit
970061ff9d
15 changed files with 83 additions and 34 deletions
|
@ -31,11 +31,13 @@ const overwriteImageDownloadPrompt = async (url, finalPath, fileName) => {
|
|||
|
||||
if (!overwrite) {
|
||||
console.log(`⚠️ Skipped existing file: ${fileName}`);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
await downloadImage(url, finalPath);
|
||||
|
||||
console.log(`✅ Saved to: ${finalPath}`);
|
||||
};
|
||||
|
||||
|
@ -53,7 +55,8 @@ export const downloadWatchingImages = async () => {
|
|||
});
|
||||
|
||||
if (!tmdbId) {
|
||||
console.warn('⚠️ TMDB ID is required.')
|
||||
console.warn('⚠️ TMDB ID is required.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -62,6 +65,7 @@ export const downloadWatchingImages = async () => {
|
|||
message: 'Enter the poster url:',
|
||||
validate: (val) => {
|
||||
if (!val) return true;
|
||||
|
||||
return isValidTMDBUrl(val);
|
||||
}
|
||||
},
|
||||
|
@ -70,6 +74,7 @@ export const downloadWatchingImages = async () => {
|
|||
message: 'Enter the backdrop url:',
|
||||
validate: (val) => {
|
||||
if (!val) return true;
|
||||
|
||||
return isValidTMDBUrl(val);
|
||||
}
|
||||
}]);
|
||||
|
@ -84,6 +89,7 @@ export const downloadWatchingImages = async () => {
|
|||
|
||||
if (!targetSubPath) {
|
||||
console.error(`❌ Missing path for ${mediaType}/${type}. Check your config.`);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -102,7 +108,8 @@ export const downloadArtistImage = async () => {
|
|||
});
|
||||
|
||||
if (!artistName) {
|
||||
console.warn('⚠️ Artist name is required.')
|
||||
console.warn('⚠️ Artist name is required.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -112,6 +119,7 @@ export const downloadArtistImage = async () => {
|
|||
validate: (val) => {
|
||||
try {
|
||||
new URL(val);
|
||||
|
||||
return true;
|
||||
} catch {
|
||||
return '❌ Must be a valid url.';
|
||||
|
@ -138,6 +146,7 @@ export const downloadAlbumImage = async () => {
|
|||
|
||||
if (!artistName) {
|
||||
console.warn('⚠️ Artist name is required.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -148,6 +157,7 @@ export const downloadAlbumImage = async () => {
|
|||
|
||||
if (!albumName) {
|
||||
console.warn('⚠️ Album name is required.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -157,6 +167,7 @@ export const downloadAlbumImage = async () => {
|
|||
validate: (val) => {
|
||||
try {
|
||||
new URL(val);
|
||||
|
||||
return true;
|
||||
} catch {
|
||||
return '❌ Must be a valid url.';
|
||||
|
@ -188,6 +199,7 @@ export const downloadBookImage = async () => {
|
|||
|
||||
if (!bookTitle) {
|
||||
console.warn('⚠️ Book title is required.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -197,6 +209,7 @@ export const downloadBookImage = async () => {
|
|||
validate: (val) => {
|
||||
try {
|
||||
new URL(val);
|
||||
|
||||
return true;
|
||||
} catch {
|
||||
return 'Must be a valid URL';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue