Added defaultTitles feature to playlists
This commit is contained in:
parent
1167b2dd76
commit
1e905b3658
|
|
@ -106,8 +106,14 @@ module.exports = class{
|
||||||
|
|
||||||
//Iterate through playlist media
|
//Iterate through playlist media
|
||||||
for(let item of playlist.media){
|
for(let item of playlist.media){
|
||||||
//Rehydrate playlist item and push it into the media list
|
//Rehydrate a full phat media object from the flat DB entry
|
||||||
mediaList.push(item.rehydrate());
|
let mediaObj = item.rehydrate();
|
||||||
|
|
||||||
|
//Set media title from default titles
|
||||||
|
mediaObj.title = playlist.defaultTitles[Math.floor(Math.random() * playlist.defaultTitles.length)];
|
||||||
|
|
||||||
|
//Push rehydrated item on to the mediaList
|
||||||
|
mediaList.push(mediaObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Convert array of standard media objects to queued media objects, and push to schedule
|
//Convert array of standard media objects to queued media objects, and push to schedule
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue