瀏覽代碼

Fix seconds calculator

Colin Powell 2 年之前
父節點
當前提交
eeee6eea4e
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      vrobbler/apps/scrobbles/utils.py

+ 4 - 1
vrobbler/apps/scrobbles/utils.py

@@ -13,7 +13,10 @@ def convert_to_seconds(run_time: str) -> int:
     actually be in seconds so we'll convert it"""
     if ":" in run_time:
         run_time_list = run_time.split(":")
-        run_time = (int(run_time_list[1]) * 60) + int(run_time_list[2])
+        hours = int(run_time_list[0])
+        minutes = int(run_time_list[1])
+        seconds = int(run_time_list[2])
+        run_time = (((hours * 60) + minutes) * 60) + seconds
     return int(run_time)