Преглед на файлове

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

KrisVos130 преди 8 години
родител
ревизия
5da8f7afba
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  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) {