Closed gAlleb closed 2 months ago
Hi @gAlleb,
I'd like to point out that check_next
is called before the request is resolved. So there will be no metadata until the request is resolved.
Ref: #3625.
I don't remember exactly why I created this issue, but it seems I have a lot of garbage in the music directory and want to discard files before decoding.
Hi, @vitoyucepi!
Hm. So many questions then. Why it works ok in 2.2.u-name-it? Why (when using autocue2 e.g. with 2.2.u-name-it) autocue nevertheless processes files and then track gets rejected if it's not due to play?
What should be done to make it work in 2.3.0?
Why it works ok in 2.2.u-name-it?
The behavior in 2.2.x hasn't been changed.
What should be done to make it work in 2.3.0?
Try request.resolve(r)
in your function, before request.metadata(r)
. Remember to handle the result of the resolve properly.
I've tried something like this (and a bunch of different iterations) but result is the same.
def check(r)
request.uri(r)
log.critical(label="request.uri","#{request.uri(r)}")
if request.resolve(r) then
log.critical(label="request.resolve","#{request.resolve(r)}")
m = request.metadata(r)
log.critical(label="request.metadata","#{request.metadata(r)}")
if l.last(m) < 7000. then
log(level=3,"Rejecting")
false
else
l.add(m)
true
end
else
false
end
end
2024/04/08 20:30:21 [request.uri:1] /Users/(2018) - Reiki Gold 2 [320]/04. Reiki Stillness and Rest.mp3
2024/04/08 20:30:21 [request.resolve:1] true
2024/04/08 20:30:21 [request.metadata:1] [("filename", "/Users/(2018) - Reiki Gold 2 [320]/04. Reiki Stillness and Rest.mp3"), ("initial_uri", "/Users/(2018) - Reiki Gold 2 [320]/04. Reiki Stillness and Rest.mp3"), ("rid", "11532"), ("status", "ready"), ("temporary", "false")]
2024/04/08 20:30:21 [lang:3] Rejecting
What am I doing wrong?
Could be another regression. I'll have a look shortly, thanks for reporting.
Ref: 28cceeccee26a1b170528857e8c0503069f75e03, 03f65e8f57676388a6068461aae679e70a0f6152, 25e7189ce5a34f5ff7697ccc4800396568dd54e2, #3874, d2a38cf31aa3ed999a45e5443f11c56008ee3c51
Many thanks!
I'm trying to make
check_next
work in 2.3.0. It works ok with defaultfilename
(with no extra parameters specified). But if I want to reject tracks by title/artist/etc... - it starts looping because metadata always returns empty. Log:In 2.2.5 - All is good.
Reproduction (every 2.3.0 version - packages and opam):