我如何在Icecast中获得即将发布的歌曲?(使用MySQL)



我正在用iccast开发一个网络广播。想法是,你点击歌曲,你得到信息(通过mysql -比元数据更多的信息)。

到目前为止,我无法找到一种方法来"查看"即将到来的列表,所以我正在考虑通过MySQL"手动"完成它。

A. I will create a list in the SQL with all info I need with a uuid
for each song, then I will add the uuid to the mp3 metada.
B. I will create a playlist with the exact order of the SQL and will
upload it to icecast. 
C.  I will display the song in the html and while playing I can grab
the uuid and mark it as “playing now”.

我现在唯一能想到的问题是我不能播放列表,但这对我的项目来说是次要的。

为了避免上述所有情况,是否有一种方法可以"看到"?我的播放列表中即将播放的歌曲(例如10首下一首歌曲)?

可以。

请注意,行SQL表中没有固有秩序。如果您希望它们按一定的顺序排列,则必须在SELECT语句中包含order BY。所以

SELECT uuid, album, title, artist, tracknumber 
FROM catalog
WHERE albumnumber = 42
ORDER BY tracknumber

按顺序显示专辑中的歌曲。

随机洗牌,使用ORDER BY RAND()代替。

注意:如果您将ORDER BY RAND()用于结果集中的几百行以上,那么它的性能将非常糟糕。

最新更新