mirror of https://github.com/calzoneman/sync.git
Remove unused media vars, fix double adds
This commit is contained in:
parent
d20e676443
commit
b43e485bb5
|
@ -1212,9 +1212,9 @@ Channel.prototype.addMedia = function(data, user) {
|
||||||
after: item.prev ? item.prev.uid : "prepend"
|
after: item.prev ? item.prev.uid : "prepend"
|
||||||
});
|
});
|
||||||
chan.broadcastPlaylistMeta();
|
chan.broadcastPlaylistMeta();
|
||||||
chan.cacheMedia(item.media);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if(isLive(data.type) && !this.hasPermission(user, "playlistaddlive")) {
|
if(isLive(data.type) && !this.hasPermission(user, "playlistaddlive")) {
|
||||||
user.socket.emit("queueFail", "You don't have permission to queue livestreams");
|
user.socket.emit("queueFail", "You don't have permission to queue livestreams");
|
||||||
|
|
18
media.js
18
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.
|
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
|
// Helper function for formatting a time value in seconds
|
||||||
// to the format hh:mm:ss
|
// to the format hh:mm:ss
|
||||||
function formatTime(sec) {
|
function formatTime(sec) {
|
||||||
|
@ -43,10 +41,6 @@ function formatTime(sec) {
|
||||||
|
|
||||||
exports.formatTime = formatTime;
|
exports.formatTime = formatTime;
|
||||||
|
|
||||||
function mediaHash(id) {
|
|
||||||
return hashlib.sha1(id + Date.now());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Represents a media entry
|
// Represents a media entry
|
||||||
var Media = function(id, title, seconds, type) {
|
var Media = function(id, title, seconds, type) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -57,16 +51,10 @@ var Media = function(id, title, seconds, type) {
|
||||||
this.seconds = 0;
|
this.seconds = 0;
|
||||||
}
|
}
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.queueby = "";
|
|
||||||
this.temp = false;
|
|
||||||
this.hash = mediaHash(id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Media.prototype.dup = function() {
|
Media.prototype.dup = function() {
|
||||||
var m = new Media(this.id, this.title, this.seconds, this.type);
|
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;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,9 +67,6 @@ Media.prototype.pack = function() {
|
||||||
seconds: this.seconds,
|
seconds: this.seconds,
|
||||||
duration: this.duration,
|
duration: this.duration,
|
||||||
type: this.type,
|
type: this.type,
|
||||||
queueby: this.queueby,
|
|
||||||
temp: this.temp,
|
|
||||||
hash: this.hash,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,9 +81,6 @@ Media.prototype.fullupdate = function() {
|
||||||
type: this.type,
|
type: this.type,
|
||||||
currentTime: this.currentTime,
|
currentTime: this.currentTime,
|
||||||
paused: this.paused,
|
paused: this.paused,
|
||||||
queueby: this.queueby,
|
|
||||||
temp: this.temp,
|
|
||||||
hash: this.hash
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue