Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
engine
Commits
462d707c
Commit
462d707c
authored
4 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Docs. #43 #44
parent
bd710e33
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/plugins/trackservice.py
+9
-6
9 additions, 6 deletions
modules/plugins/trackservice.py
with
9 additions
and
6 deletions
modules/plugins/trackservice.py
+
9
−
6
View file @
462d707c
...
@@ -216,10 +216,12 @@ class TrackServiceHandler():
...
@@ -216,10 +216,12 @@ class TrackServiceHandler():
class
Playlog
:
class
Playlog
:
"""
"""
Playlog keeps a short history of currently playing entries. It stores the recent
Playlog keeps a short history of currently playing entries. It stores the recent
active entries to a local cache `entry_history` being able to manage concurrently playing entries.
active entries to a local cache `history` being able to manage concurrently playing entries.
It also is in charge of resolving relevant meta information of the currently playing entry for
It also is in charge of resolving relevant meta information of the currently playing entry for
the TrackService handler.
the TrackService handler.
The records are stored in pre-formatted dictionary structure, allowing easy serialization when
posting them to the Engine API.
"""
"""
config
=
None
config
=
None
logger
=
None
logger
=
None
...
@@ -261,7 +263,8 @@ class Playlog:
...
@@ -261,7 +263,8 @@ class Playlog:
next_timeslot
=
self
.
engine
.
scheduler
.
get_next_timeslots
(
1
)
next_timeslot
=
self
.
engine
.
scheduler
.
get_next_timeslots
(
1
)
if
next_timeslot
:
next_timeslot
=
next_timeslot
[
0
]
if
next_timeslot
:
next_timeslot
=
next_timeslot
[
0
]
if
timeslot
:
# A valid timeslot from the scheduler is available
if
timeslot
:
self
.
assign_fallback_playlist
(
data
,
timeslot
)
self
.
assign_fallback_playlist
(
data
,
timeslot
)
data
[
"
schedule_id
"
]
=
timeslot
.
schedule_id
data
[
"
schedule_id
"
]
=
timeslot
.
schedule_id
data
[
"
schedule_start
"
]
=
timeslot
.
schedule_start
data
[
"
schedule_start
"
]
=
timeslot
.
schedule_start
...
@@ -275,8 +278,8 @@ class Playlog:
...
@@ -275,8 +278,8 @@ class Playlog:
self
.
current_timeslot
[
"
schedule_end
"
]
=
timeslot
.
schedule_start
self
.
current_timeslot
[
"
schedule_end
"
]
=
timeslot
.
schedule_start
self
.
previous_timeslot
=
self
.
current_timeslot
self
.
previous_timeslot
=
self
.
current_timeslot
else
:
# Defaults for a not existing timeslot
# Defaults are not existing timeslot
else
:
self
.
assign_fallback_playlist
(
data
,
None
)
self
.
assign_fallback_playlist
(
data
,
None
)
data
[
"
schedule_id
"
]
=
-
1
data
[
"
schedule_id
"
]
=
-
1
data
[
"
show_id
"
]
=
-
1
data
[
"
show_id
"
]
=
-
1
...
@@ -293,7 +296,7 @@ class Playlog:
...
@@ -293,7 +296,7 @@ class Playlog:
# Fake the end, because the timeslot is actually not existing
# Fake the end, because the timeslot is actually not existing
data
[
"
schedule_end
"
]
=
datetime
.
now
()
+
timedelta
(
hours
=
1
)
data
[
"
schedule_end
"
]
=
datetime
.
now
()
+
timedelta
(
hours
=
1
)
# A valid following timeslot is available
if
next_timeslot
:
if
next_timeslot
:
ns
=
{}
ns
=
{}
self
.
assign_fallback_playlist
(
ns
,
next_timeslot
)
self
.
assign_fallback_playlist
(
ns
,
next_timeslot
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment