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
2b96eeeb
Verified
Commit
2b96eeeb
authored
8 months ago
by
David Trattnig
Committed by
Ole Binder
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
refactor: Init timeslots with virtual state
parent
a169d7e6
No related branches found
No related tags found
1 merge request
!46
Steering playout schema and virtual timeslot integration
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/aura_engine/scheduling/api.py
+29
-17
29 additions, 17 deletions
src/aura_engine/scheduling/api.py
with
29 additions
and
17 deletions
src/aura_engine/scheduling/api.py
+
29
−
17
View file @
2b96eeeb
...
@@ -174,32 +174,44 @@ class ApiFetcher(threading.Thread):
...
@@ -174,32 +174,44 @@ class ApiFetcher(threading.Thread):
id
=
api_ts
.
show
.
id
,
id
=
api_ts
.
show
.
id
,
name
=
api_ts
.
show
.
name
,
name
=
api_ts
.
show
.
name
,
)
)
episode
=
Episode
(
id
=
ep
.
id
,
title
=
ep
.
title
)
if
(
ep
:
=
api_ts
.
episode
)
and
ep
else
None
episode
=
None
memo
=
None
if
api_ts
.
timeslot
:
memo
=
api_ts
.
timeslot
.
memo
if
(
ep
:
=
api_ts
.
episode
)
and
ep
:
episode
=
Episode
(
id
=
ep
.
id
,
title
=
ep
.
title
,
memo
=
memo
)
# TODO resolve timeslot referenced by `repetition_id`
# TODO resolve timeslot referenced by `repetition_id`
timeslot
=
Timeslot
(
timeslot
=
Timeslot
(
id
=
api_ts
.
id
,
id
=
api_ts
.
id
,
virtual
=
False
if
api_ts
.
timeslot_id
else
True
,
repetition_id
=
api_ts
.
timeslot
.
repetition_of_id
if
api_ts
.
timeslot
else
None
,
repetition_id
=
api_ts
.
timeslot
.
repetition_of_id
if
api_ts
.
timeslot
else
None
,
start
=
api_ts
.
start
.
timestamp
(),
start
=
api_ts
.
start
.
timestamp
(),
end
=
api_ts
.
end
.
timestamp
(),
end
=
api_ts
.
end
.
timestamp
(),
show
=
show
,
show
=
show
,
episode
=
episode
,
episode
=
episode
,
)
)
# Fetch playlists for timeslot
playlist_timeslot
=
None
# Virtual timeslot do not have media-sources assigned,
playlist_schedule
=
None
# therefore no playlists need to be fetched.
playlist_show
=
None
if
not
timeslot
.
is_virtual
():
if
(
ts
:
=
api_ts
.
timeslot
)
and
ts
and
(
plid
:
=
ts
.
playlist_id
)
and
plid
:
# Fetch playlists for timeslot
playlist_timeslot
=
self
.
fetch_playlist
(
plid
)
playlist_timeslot
=
None
if
(
sc
:
=
api_ts
.
schedule
)
and
sc
and
(
plid
:
=
sc
.
default_playlist_id
)
and
plid
:
playlist_schedule
=
None
playlist_schedule
=
self
.
fetch_playlist
(
plid
)
playlist_show
=
None
if
(
sh
:
=
api_ts
.
show
)
and
sh
and
(
plid
:
=
sh
.
default_playlist_id
):
playlist_show
=
self
.
fetch_playlist
(
plid
)
if
(
ts
:
=
api_ts
.
timeslot
)
and
ts
and
(
plid
:
=
ts
.
playlist_id
)
and
plid
:
playlist_timeslot
=
self
.
fetch_playlist
(
plid
)
timeslot
.
set_playlists
(
playlist_timeslot
,
playlist_schedule
,
playlist_show
)
if
(
sc
:
=
api_ts
.
schedule
)
and
sc
and
(
plid
:
=
sc
.
default_playlist_id
)
and
plid
:
self
.
expand_item_duration
(
playlist_timeslot
)
playlist_schedule
=
self
.
fetch_playlist
(
plid
)
self
.
expand_item_duration
(
playlist_schedule
)
if
(
sh
:
=
api_ts
.
show
)
and
sh
and
(
plid
:
=
sh
.
default_playlist_id
):
self
.
expand_item_duration
(
playlist_show
)
playlist_show
=
self
.
fetch_playlist
(
plid
)
timeslot
.
set_playlists
(
playlist_timeslot
,
playlist_schedule
,
playlist_show
)
self
.
expand_item_duration
(
playlist_timeslot
)
self
.
expand_item_duration
(
playlist_schedule
)
self
.
expand_item_duration
(
playlist_show
)
timeslots
.
append
(
timeslot
)
timeslots
.
append
(
timeslot
)
return
timeslots
return
timeslots
...
...
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