Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

add padded options for season and episode numbers #84

Closed
wants to merge 0 commits into from

Conversation

adracea
Copy link
Contributor

@adracea adracea commented Dec 18, 2022

adds support for {padded_episode_number} and {padded_season_number}

@adracea
Copy link
Contributor Author

adracea commented Dec 18, 2022

Will add the documentation part of it later today, if you guys agree with this as an option.

I looked into doing something a bit more complex but it would require we use either a templating engine or do something else. fmt needs to know the format string at compile time.

@IchBinLeoon
Copy link
Contributor

What about anime that have more than 99 episodes?

@adracea
Copy link
Contributor Author

adracea commented Dec 18, 2022

What about anime that have more than 99 episodes?

That's where a template/templating engine comes into use.

@adracea
Copy link
Contributor Author

adracea commented Dec 18, 2022

What about anime that have more than 99 episodes?

That's where a template/templating engine comes into use.

As per purely 99 episode an higher, anything over ep 99 will stop being padded in any way. i.e.
s1e9 ends up as s01e09, but s123e123 ends up as s123e123, subsequently all episodes and seasons with <2 digits will end up getting a 0 as padding.

@IchBinLeoon
Copy link
Contributor

Yeah, I am aware of that. I just wanted to say I personally think in this case this:

S1E001
...
S1E123

would make more sense than this:

S1E01
...
S1E123

Probably also has to do with personal preferences.

@bytedream
Copy link
Member

What about anime that have more than 99 episodes?

That's where a template/templating engine comes into use.

As per purely 99 episode an higher, anything over ep 99 will stop being padded in any way. i.e. s1e9 ends up as s01e09, but s123e123 ends up as s123e123, subsequently all episodes and seasons with <2 digits will end up getting a 0 as padding.

I'm agreeing with this. Given that the old (golang) versions are all using the 0<2 padding too and most anime doesn't have 100+ episodes this is the most useful implementation.
Padding depending of the total amount of episodes would also be an option but to archive this way too much request must be made (since cr doesn't provide a number of the total episode amount themself) so this isn't really worth it

@IchBinLeoon
Copy link
Contributor

I totally agree that this would probably be the best and easiest solution. Just wanted to point out that it could happen that an anime has more than 99 episodes, it's fairly unlikely but not impossible.

Copy link
Member

@bytedream bytedream left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep the help more readable, every format option has to be indented the same

So

{resolution}     → Resolution of the video\n  \
{padded_season_number}  → Number of the season padded to double digits\n  \
{season_number}  → Number of the season\n  \
{padded_episode_number} →  Number of the episode padded to double digits\n  \
{episode_number} → Number of the episode\n  \

would be

{resolution}            → Resolution of the video\n  \
{padded_season_number}  → Number of the season padded to double digits\n  \
{season_number}         → Number of the season\n  \
{padded_episode_number} → Number of the episode padded to double digits\n  \
{episode_number}        → Number of the episode\n  \

crunchy-cli-core/src/cli/archive.rs Outdated Show resolved Hide resolved
crunchy-cli-core/src/cli/download.rs Outdated Show resolved Hide resolved
@adracea
Copy link
Contributor Author

adracea commented Dec 19, 2022

I pushed my fork to current master, will redo the PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants