set default truncate value to null for avoiding confusion

This commit is contained in:
Rafael Moraes 2024-08-03 02:00:23 -03:00
parent aa71239eba
commit 8c1a3dbe7d
2 changed files with 4 additions and 3 deletions

View File

@ -99,7 +99,7 @@ Config file values can be overridden using command line arguments.
| `--template-date` / `template_date` | Date tag template. | `%Y-%m-%dT%H:%M:%SZ` |
| `--exclude-tags` / `exclude_tags` | Comma-separated tags to exclude. | `null` |
| `--cover-size` / `cover_size` | Cover size. | `1200` |
| `--truncate` / `truncate` | Maximum length of the file/folder names. | `0` |
| `--truncate` / `truncate` | Maximum length of the file/folder names. | `null` |
| `--codec-song` / `codec_song` | Song codec. | `aac-legacy` |
| `--synced-lyrics-format` / `synced_lyrics_format` | Synced lyrics format. | `lrc` |
| `--codec-music-video` / `codec_music_video` | Music video codec. | `h264` |

View File

@ -55,7 +55,7 @@ class Downloader:
template_date: str = "%Y-%m-%dT%H:%M:%SZ",
exclude_tags: str = None,
cover_size: int = 1200,
truncate: int = 0,
truncate: int = None,
silent: bool = False,
):
self.apple_music_api = apple_music_api
@ -101,7 +101,8 @@ class Downloader:
)
def _set_truncate(self):
self.truncate = None if self.truncate < 4 else self.truncate
if self.truncate is not None:
self.truncate = None if self.truncate < 4 else self.truncate
def _set_subprocess_additional_args(self):
if self.silent: