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

Download time with empty minutes and seconds #2

Closed
wants to merge 2 commits into from

Conversation

ureyNZB
Copy link
Contributor

@ureyNZB ureyNZB commented Jul 24, 2023

orig PR: nzbget/nzbget#800

Calculation of
Total time
Download time
Verification time
Repair time
Unpack time
was broken for python3. Everything except hours

def format_time_sec_orig(sec):
Hour = sec / 3600
Min = (sec - (sec / 3600) * 3600) / 60
Sec = (sec - (sec / 3600) * 3600) % 60
return '%d:%02d:%02d' % (Hour, Min, Sec)

def format_time_sec_new(sec):
Hour = sec / 3600
Min = (sec % 3600) / 60
Sec = (sec % 60)
return '%d:%02d:%02d' % (Hour, Min, Sec)

print("Orig: " + format_time_sec_orig(int(7199)))
print("New: " + format_time_sec_new(int(7199)))

Output:

1:00:00
1:59:59

Process finished with exit code 0

ureyDev and others added 2 commits July 24, 2023 13:11
Calculation of
Total time
Download time
Verification time
Repair time
Unpack time
was broken for python3. Everything except hours

def format_time_sec_orig(sec):
    Hour = sec / 3600
    Min = (sec - (sec / 3600) * 3600) / 60
    Sec = (sec - (sec / 3600) * 3600) % 60
    return '%d:%02d:%02d' % (Hour, Min, Sec)

def format_time_sec_new(sec):
    Hour = sec / 3600
    Min = (sec % 3600) / 60
    Sec = (sec % 60)
    return '%d:%02d:%02d' % (Hour, Min, Sec)

print("Orig: " + format_time_sec_orig(int(7199)))
print("New: " + format_time_sec_new(int(7199)))

Output:

1:00:00
1:59:59

Process finished with exit code 0
@ureyNZB ureyNZB closed this Sep 14, 2023
@ureyNZB ureyNZB deleted the empty-minutes-seconds branch September 14, 2023 13:38
phnzb added a commit that referenced this pull request Nov 9, 2023
phnzb added a commit that referenced this pull request Nov 9, 2023
@dnzbk dnzbk mentioned this pull request Mar 11, 2024
1 task
phnzb added a commit that referenced this pull request Jul 16, 2024
phnzb added a commit that referenced this pull request Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants