Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
engine-core
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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-core
Commits
719ae322
Commit
719ae322
authored
2 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Feat: Additional meta fields for fallback data
parent
883dcf5a
No related branches found
No related tags found
1 merge request
!3
Liquidsoap 2 migration
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/engine.liq
+7
-6
7 additions, 6 deletions
src/engine.liq
src/functions.liq
+16
-0
16 additions, 0 deletions
src/functions.liq
with
23 additions
and
6 deletions
src/engine.liq
+
7
−
6
View file @
719ae322
...
@@ -44,12 +44,12 @@ def on_metadata_notification(meta) =
...
@@ -44,12 +44,12 @@ def on_metadata_notification(meta) =
timeslot_id = list.assoc(default="-1", "timeslot_id", meta)
timeslot_id = list.assoc(default="-1", "timeslot_id", meta)
playlist_id = list.assoc(default="-1", "playlist_id", meta)
playlist_id = list.assoc(default="-1", "playlist_id", meta)
playlist_track_num = list.assoc(default="", "playlist_item", meta)
playlist_track_num = list.assoc(default="", "playlist_item", meta)
track_
duration = int_of_float(request.duration(meta["filename"])
)
track_
start = list.assoc(default=meta["track_start"], "on_air", meta
)
track_
type = (eval_track_type(
meta
["
track_
type"], meta["source"])
)
track_
duration = get_
meta
_
track_
duration(meta
)
track_
start = meta["on_air
"]
track_
type = eval_track_type(meta["track_type"], meta["source
"]
)
track_artist =
meta["artist"]
track_artist =
list.assoc(default=meta["track_artist"], "artist", meta)
track_album =
meta["album"]
track_album =
list.assoc(default=meta["track_album"], "album", meta)
track_title =
meta["title"]
track_title =
list.assoc(default=meta["track_title"], "title", meta)
source_type = eval_source_type(meta["source"])
source_type = eval_source_type(meta["source"])
if source_type == "fallback" then
if source_type == "fallback" then
...
@@ -121,6 +121,7 @@ stripped_stream = blank.strip(
...
@@ -121,6 +121,7 @@ stripped_stream = blank.strip(
)
)
output_source = attach_fallback_source(stripped_stream)
output_source = attach_fallback_source(stripped_stream)
output_source.on_metadata(on_metadata_notification)
#####################################
#####################################
...
...
This diff is collapsed.
Click to expand it.
src/functions.liq
+
16
−
0
View file @
719ae322
...
@@ -18,6 +18,22 @@
...
@@ -18,6 +18,22 @@
# Reads the track duration
# a.) when available from the file
# b.) as a fallback from the meta field "track_duration"
#
# Returns
# (int) duration in seconds
def get_meta_track_duration(meta) =
track_duration = int_of_float(request.duration(meta["filename"]))
if track_duration != -1 then
track_duration
else
int_of_string(meta["track_duration"])
end
end
# Posts a playlog to the Engine API
# Posts a playlog to the Engine API
def post_playlog(api_url, data) =
def post_playlog(api_url, data) =
json_data = json()
json_data = json()
...
...
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