New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Stop sniffing mimetype on playlists and don't use playlist.once anymore #48
Conversation
Maybe we should use
Not entirely sure though. 😕 |
300210a
to
82e42dd
Compare
I changed it to |
82e42dd
to
0bf254b
Compare
Codecov Report
@@ Coverage Diff @@
## master #48 +/- ##
==========================================
- Coverage 78.90% 78.01% -0.89%
==========================================
Files 1 1
Lines 602 605 +3
Branches 141 141
==========================================
- Hits 475 472 -3
- Misses 110 114 +4
- Partials 17 19 +2
Continue to review full report at Codecov.
|
0bf254b
to
71de888
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for removing .once
for the prio playlist?
The rest looks good.
@@ -110,24 +110,24 @@ def check_next_func(r) = | |||
end | |||
|
|||
# Priority playlist for 'play next' feature | |||
prio = playlist.once(id="prio", reload_mode="watch", path.concat(DATA_DIR, "prio.m3u")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should leave the .once
, to double ensure that the prio playlist never loops.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
playlist.once
is deprecated in new versions of liquidsoap and it is recommended to replace it with reload_mode=once
. Since we are already using reload_mode=watch
and the prio.m3u file gets changed when it is used anyway I think that keeping the reload_mode as is makes sense. See my initial comment for a link to the liquidsoap PR that deprecates playlist.once
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. Thanks for the hint.
I think making sure that we never ever end up in a endless loop would be wise, especially when I'm looking at my hacky prio playlist code. I would suggest, that we add two more options to the playlist call: mode="normal"
and loop=false
. Better be safe than sorry.
This might also allow us to implement a priority queue with more than one entry in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added mode=normal
but didn't add loop=false
since loop only seems to be implemented in dev according to the docs.
71de888
to
4925c9b
Compare
I think we can close this one. Right? |
…list.once anymore
4925c9b
to
85000f3
Compare
At a glance, I don't think so... IMO we should still circumvent mimetype sniffing and get rid of |
As far as mime type sniffing goes, I tried this out some time ago with strange results. Manually setting the mime type makes |
This replaces the mime type sniffing that we are doing when loading a playlist with a hardcoded mime type. We can always assume that the generated m3u files have a
text/plain
mime type. With this assumption liquidsoap won't logWrong mime type application/octet-stream for playlist!
if the file is empty.We need to switch to not using
playlist.once
anymore since it is deprecated nowadays: savonet/liquidsoap#1015. I think we don't need to usereload_mode="once"
but can stick toreload_mode=watch
since the prio file is handled in a way that watching it leads to the behaviour we want.playlist.once anymore