From b43e485bb5e9541c8a407a9caa9675d84a81542f Mon Sep 17 00:00:00 2001 From: calzoneman Date: Wed, 3 Jul 2013 19:11:38 -0400 Subject: [PATCH] Remove unused media vars, fix double adds --- channel.js | 2 +- media.js | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/channel.js b/channel.js index 13008196..de64b687 100644 --- a/channel.js +++ b/channel.js @@ -1212,9 +1212,9 @@ Channel.prototype.addMedia = function(data, user) { after: item.prev ? item.prev.uid : "prepend" }); chan.broadcastPlaylistMeta(); - chan.cacheMedia(item.media); } }); + return; } if(isLive(data.type) && !this.hasPermission(user, "playlistaddlive")) { user.socket.emit("queueFail", "You don't have permission to queue livestreams"); diff --git a/media.js b/media.js index 9ee2ea6f..3febcf6e 100644 --- a/media.js +++ b/media.js @@ -9,8 +9,6 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -var hashlib = require("node_hash"); - // Helper function for formatting a time value in seconds // to the format hh:mm:ss function formatTime(sec) { @@ -43,10 +41,6 @@ function formatTime(sec) { exports.formatTime = formatTime; -function mediaHash(id) { - return hashlib.sha1(id + Date.now()); -} - // Represents a media entry var Media = function(id, title, seconds, type) { this.id = id; @@ -57,16 +51,10 @@ var Media = function(id, title, seconds, type) { this.seconds = 0; } this.type = type; - this.queueby = ""; - this.temp = false; - this.hash = mediaHash(id); } Media.prototype.dup = function() { var m = new Media(this.id, this.title, this.seconds, this.type); - m.queueby = this.queueby; - m.temp = this.temp; - m.hash = this.hash; return m; } @@ -79,9 +67,6 @@ Media.prototype.pack = function() { seconds: this.seconds, duration: this.duration, type: this.type, - queueby: this.queueby, - temp: this.temp, - hash: this.hash, }; } @@ -96,9 +81,6 @@ Media.prototype.fullupdate = function() { type: this.type, currentTime: this.currentTime, paused: this.paused, - queueby: this.queueby, - temp: this.temp, - hash: this.hash }; }