Skip to content

Commit

Permalink
chore: just making sure we don't truncate
Browse files Browse the repository at this point in the history
  • Loading branch information
wolffshots committed May 24, 2024
1 parent 505933e commit 1830daf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/audiobookshelf/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ async def extract_library_details(data: dict) -> dict:

def get_total_duration(total_duration: float):
"""Calculate the total duration in hours and round it to 0 decimal places."""
return round(total_duration / 60 / 60, 0)
return round(total_duration / 60.0 / 60.0, 0)

def get_total_size(total_size: float):
return round(total_size / 1024 / 1024 / 1024, 2)
return round(total_size / 1024.0 / 1024.0 / 1024.0, 2)

async def fetch_library_stats(session, id):
"""Fetch data from a single endpoint."""
Expand Down

0 comments on commit 1830daf

Please sign in to comment.