mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-12 08:16:06 -07:00
Adds stream_duration to notification options
This commit is contained in:
parent
b2a7f639bb
commit
cba8608c23
1 changed files with 3 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
# This file is part of PlexPy.
|
||||
# This file is part of PlexPy.
|
||||
#
|
||||
# PlexPy is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -300,6 +300,7 @@ def build_notify_text(session, state):
|
|||
|
||||
duration = helpers.convert_milliseconds_to_minutes(item_metadata['duration'])
|
||||
view_offset = helpers.convert_milliseconds_to_minutes(session['view_offset'])
|
||||
stream_duration = 0 if state == 'play' else int((time.time() - helpers.cast_to_float(session['started']) - helpers.cast_to_float(session['paused_counter'])) / 60)
|
||||
|
||||
progress_percent = helpers.get_percent(view_offset, duration)
|
||||
|
||||
|
@ -323,6 +324,7 @@ def build_notify_text(session, state):
|
|||
'album_name': item_metadata['parent_title'],
|
||||
'rating': item_metadata['rating'],
|
||||
'duration': duration,
|
||||
'stream_duration': stream_duration,
|
||||
'progress': view_offset,
|
||||
'progress_percent': progress_percent
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue