Explorar o código

Fixed bug where officialplaylist cache didn't get initialized on station initialize.

KrisVos130 %!s(int64=8) %!d(string=hai) anos
pai
achega
5da8f7afba
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      backend/logic/stations.js

+ 6 - 0
backend/logic/stations.js

@@ -56,6 +56,12 @@ module.exports = {
 		_this.getStation(stationId, (err, station) => {
 			if (!err) {
 				if (station) {
+					cache.hget('officialPlaylists', stationId, (err, playlist) => {
+						if (err || !playlist) {
+							_this.calculateOfficialPlaylistList(stationId, station.playlist, ()=>{});
+						}
+					});
+
 					let notification = notifications.subscribe(`stations.nextSong?id=${station._id}`, _this.skipStation(station._id), true);
 					if (!station.paused ) {
 						/*if (!station.startedAt) {