Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help] Any way to set 2 digits for track number? #142

Open
Exspecto322 opened this issue Jun 26, 2024 · 7 comments
Open

[Help] Any way to set 2 digits for track number? #142

Exspecto322 opened this issue Jun 26, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@Exspecto322
Copy link

I need Help.

How to force 2 digits format for track numbers?

What operating system are you seeing the problem on?

Windows

Your settings

{"skip_existing": "False", "lyrics_embed": true, "lyrics_file": false, "video_download": true, "download_delay": true, "download_base_path": "H:\\Music\\TidalDLTemp", "quality_audio": "HI_RES_LOSSLESS", "quality_video": "1080", "format_album": "{album_artist}/{album_title}/{album_track_num}. {artist_name} - {track_title}{track_explicit}", "format_playlist": "Playlists/{playlist_name}/{artist_name} - {track_title}", "format_mix": "Mix/{mix_name}/{artist_name} - {track_title}", "format_track": "{album_artist}/{album_title}/{album_track_num}. {artist_name} - {track_title}{track_explicit}", "format_video": "Videos/{artist_name} - {track_title}{track_explicit}", "video_convert_mp4": false, "path_binary_ffmpeg": "C:\\Users\\Administrator\\Documents\\ffmpeg-7.0.1-full_build\\bin\\ffmpeg.exe", "metadata_cover_dimension": "1280", "extract_flac": true, "downgrade_on_hi_res": true}
@Exspecto322 Exspecto322 added the help wanted Extra attention is needed label Jun 26, 2024
@exislow exislow changed the title Any way to set 2 digits for track number? [Help] [Help] Any way to set 2 digits for track number? Jul 4, 2024
@exislow
Copy link
Owner

exislow commented Jul 10, 2024

This function already sets the necessary leading digits / zeroes for album_track_num:

case "album_track_num":
if isinstance(media, Track | Video):
num_tracks: int = media.album.num_tracks if hasattr(media, "album") else 1
count_digits: int = int(math.log10(num_tracks)) + 1
result = str(media.track_num).zfill(count_digits)

What exactly is your idea? What do you need this for?

@Exspecto322
Copy link
Author

I am using the exe for Windows, for me albums with less than 10 songs, will always be missing a 0, this happens with singles too
image
only if the album has more than 10 songs they will all get double digits
image
this makes it inconsistent, just wondering if there was a way to always have albums and singles named with two digits, from 01 to 09 instead of 1 to 9

@romner-set
Copy link

+1, I'd also prefer forcing 2-digit track numbers everywhere for consistency.

@ahuber86
Copy link

ahuber86 commented Oct 3, 2024

I am also having this same issue, using the Linux CLI version. I would also like a way to force the leading zero, or two-digit track number.

@loddar66
Copy link

loddar66 commented Oct 4, 2024

This function already sets the necessary leading digits / zeroes for album_track_num:

case "album_track_num":
if isinstance(media, Track | Video):
num_tracks: int = media.album.num_tracks if hasattr(media, "album") else 1
count_digits: int = int(math.log10(num_tracks)) + 1
result = str(media.track_num).zfill(count_digits)

What exactly is your idea? What do you need this for?

maybe using something like "max(2, int(math.log10(num_tracks)) + 1)" would yield the desired result (minimum 2 digits, even if the number of tracks is below 10)

@exislow
Copy link
Owner

exislow commented Nov 8, 2024

This only solves it for albums, but not for playlists.

Anyway... Why do you actually want leading zeroes if they are not necessary? I mean this app takes care about necessary leading zeroes so sorting will work just fine.

@exislow exislow added enhancement New feature or request and removed help wanted Extra attention is needed labels Nov 13, 2024
@exislow exislow removed their assignment Nov 13, 2024
@Huber1
Copy link

Huber1 commented Nov 20, 2024

+1 for consistency across the library

@exislow exislow self-assigned this Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants