|
|
|
@ -348,6 +348,15 @@ class Match(SideStoreModel): |
|
|
|
return format_seconds(self.smart_time_played()) |
|
|
|
return format_seconds(self.smart_time_played()) |
|
|
|
|
|
|
|
|
|
|
|
def smart_time_played(self): |
|
|
|
def smart_time_played(self): |
|
|
|
|
|
|
|
if self.start_date: |
|
|
|
|
|
|
|
if self.end_date: |
|
|
|
|
|
|
|
return self.__smart_duration() |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
return (timezone.now() - self.start_date).total_seconds() |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
return 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __smart_duration(self): |
|
|
|
seconds = (self.end_date - self.start_date).total_seconds() |
|
|
|
seconds = (self.end_date - self.start_date).total_seconds() |
|
|
|
average_duration = self.average_seconds_duration() |
|
|
|
average_duration = self.average_seconds_duration() |
|
|
|
|
|
|
|
|
|
|
|
|