Remove unused media vars, fix double adds

This commit is contained in:
calzoneman 2013-07-03 19:11:38 -04:00
parent d20e676443
commit b43e485bb5
2 changed files with 1 additions and 19 deletions

View file

@ -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");

View file

@ -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
};
}