Remove some legacy cruft

This commit is contained in:
Calvin Montgomery 2021-08-19 20:44:57 -07:00
parent 7214b7c474
commit 394f03ee1c
7 changed files with 15 additions and 90 deletions

View file

@ -158,15 +158,19 @@ PlaylistModule.prototype.load = function (data) {
}
} else if (item.media.type === "gd") {
delete item.media.meta.gpdirect;
} else if (["vm", "jw", "mx"].includes(item.media.type)) {
} else if (["vm", "jw", "mx", "im"].includes(item.media.type)) {
// JW has been deprecated for a long time
// VM shut down in December 2017
// Mixer shut down in July 2020
// Dunno when imgur album embeds stopped working but they don't work either
LOGGER.warn(
"Dropping playlist item with deprecated type %s",
item.media.type
);
return;
} else if (item.media.meta.embed && item.media.meta.embed.tag !== 'iframe') {
LOGGER.warn("Dropping playlist item with flash embed");
return;
}
var m = new Media(item.media.id, item.media.title, item.media.seconds,

View file

@ -340,23 +340,6 @@ var Getters = {
callback(false, media);
},
/* imgur.com albums */
im: function (id, callback) {
/**
* TODO: Consider deprecating this in favor of custom embeds
*/
var m = id.match(/([\w-]+)/);
if (m) {
id = m[1];
} else {
callback("Invalid ID", null);
return;
}
var title = "Imgur Album - " + id;
var media = new Media(id, title, "--:--", "im");
callback(false, media);
},
/* custom embed */
cu: function (id, callback) {
var media;

View file

@ -177,7 +177,7 @@
};
},
root.formatLink = function (id, type, meta) {
root.formatLink = function (id, type, _meta) {
switch (type) {
case "yt":
return "https://youtu.be/" + id;
@ -193,8 +193,6 @@
return "https://twitch.tv/" + id;
case "rt":
return id;
case "im":
return "https://imgur.com/a/" + id;
case "us":
return "https://ustream.tv/channel/" + id;
case "gd":
@ -211,12 +209,6 @@
return "https://clips.twitch.tv/" + id;
case "cm":
return id;
case "mx":
if (meta !== null) {
return `https://mixer.com/${meta.mixer.channelToken}`;
} else {
return `https://mixer.com/${id}`;
}
default:
return "";
}
@ -229,10 +221,8 @@
case "us":
case "rt":
case "cu":
case "im":
case "hb":
case "hl":
case "mx":
return true;
default:
return false;