dotfiles/spicetify/extensions/autoSkipVideo.js

21 lines
565 B
JavaScript
Raw Normal View History

2022-01-18 01:25:46 -05:00
// @ts-check
// NAME: Auto Skip Video
// AUTHOR: khanhas
// DESCRIPTION: Auto skip video
/// <reference path="../globals.d.ts" />
(function SkipVideo() {
Spicetify.Player.addEventListener("songchange", () => {
const data = Spicetify.Player.data || Spicetify.Queue;
if (!data) return;
const meta = data.track.metadata;
// Ads are also video media type so I need to exclude them out.
if (meta["media.type"] === "video" && meta.is_advertisement !== "true") {
Spicetify.Player.next();
}
});
})();