You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can someone help me figure out why I can't access the last_metadata() method of the selected() source of a fallback? Other methods like time() and duration() don't work either but I can get around those by using source.time(actualSource) or source.duration(actualSource)
source script:
silence = blank(id="silence")
me = fallback([silence])
def onTick() =
actualSource = me.selected() ?? silence
meta = actualSource.last_metadata() ?? []
print(meta)
end
thread.run(every=1., onTick)
output.dummy(me)
INFO: Loading Sdl_image, Target = linux
INFO: Loading Sdl_ttf, Target = linux
At debug/fallback.liq, line 7, char 9-21:
meta = actualSource.last_metadata() ?? []
Error 5: this value has type
source('A)
.{
buffered? : () -> [string * float],
duration? : () -> float,
elapsed? : () -> float,
fallible? : bool,
id? : () -> string,
is_active? : () -> bool,
is_ready? : () -> bool,
is_up? : () -> bool,
last_metadata? : () -> [string * string]?,
log? :
{level : (() -> int?).{set : (int) -> unit}
},
on_metadata? : ((([string * string]) -> unit)) -> unit,
on_shutdown? : ((() -> unit)) -> unit,
on_track? : ((([string * string]) -> unit)) -> unit,
on_wake_up? : ((() -> unit)) -> unit,
remaining? : () -> float,
seek? : (float) -> float,
self_sync? : () -> bool,
skip? : () -> unit,
time? : () -> float
} where 'A is a set of internal tracks (inferred at debug/fallback.liq, line 6, char 17-41)
but it should be a subtype of the type of the value at debug/fallback.liq, line 7, char 9-37
'A.{last_metadata : 'B}
on
Liquidsoap 2.2.2
Copyright (c) 2003-2023 Savonet team
Liquidsoap is open-source software, released under GNU General Public License.
See <http://liquidsoap.info> for more information.
and
Liquidsoap 2.2.3+git@fece51da6
Copyright (c) 2003-2023 Savonet team
Liquidsoap is open-source software, released under GNU General Public License.
See <http://liquidsoap.info> for more information.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Can someone help me figure out why I can't access the last_metadata() method of the selected() source of a fallback? Other methods like time() and duration() don't work either but I can get around those by using
source.time(actualSource)
orsource.duration(actualSource)
source script:
on
and
Beta Was this translation helpful? Give feedback.
All reactions