Comparing version 0.2.10 to 0.2.11
30
index.ts
#!/usr/bin/env ts-node | ||
import * as DiscordRPC from 'discord-rpc'; | ||
import * as logger from 'winston'; | ||
import axios from 'axios'; | ||
import { platform } from 'os'; | ||
const DiscordRPC = require('discord-rpc'); | ||
const logger = require('winston'); | ||
const axios = require('axios'); | ||
const { platform } = require('os'); | ||
const nodeSpotifyWebhelper = require('./spotify-webhelper/spotify'); | ||
const [, , ...args] = process.argv; | ||
let nodeSpotifyWebhelper; | ||
if (platform().toString() === "win32") { | ||
nodeSpotifyWebhelper = require('./spotify-webhelper/windows'); | ||
} else { | ||
nodeSpotifyWebhelper = require('./spotify-webhelper/linux'); | ||
} | ||
const spotify = new nodeSpotifyWebhelper.SpotifyWebHelper(); | ||
const rpc = new DiscordRPC.Client({ transport: 'ipc' }); | ||
const clientID = '383639700994523137'; | ||
let compareURI: string; | ||
let compare: boolean; | ||
let compareURI; | ||
let compare; | ||
@@ -34,3 +28,3 @@ logger.configure({ | ||
spotify.getStatus((err: Error, res: any) => { | ||
spotify.getStatus((err, res) => { | ||
if (err) return logger.error(err.stack ? err.stack : err.toString()); | ||
@@ -82,6 +76,6 @@ if (!res.track || !res.track.track_resource) return logger.warn(`(${new Date().toLocaleTimeString()}) No track data, make sure Spotify is opened and a song is selected!`); | ||
function checkVersion() { | ||
let sVersion: string = require('./package.json').version; | ||
let sVersion = require('./package.json').version; | ||
let version = ~~(require('./package.json').version.split('.').join('')); | ||
axios.get('https://raw.githubusercontent.com/KurozeroPB/discotify/master/package.json') | ||
.then((res: any) => { | ||
.then((res) => { | ||
if (res.status !== 200) { | ||
@@ -94,3 +88,3 @@ return logger.error(`Failed to check for updates: ${res.data}`); | ||
} | ||
}).catch((err: any) => { | ||
}).catch((err) => { | ||
logger.error(err.stack ? err.stack : err.message ? err.message : err.toString()); | ||
@@ -111,3 +105,3 @@ }); | ||
rpc.login(clientID) | ||
.catch((err: Error) => logger.error(err.stack ? err.stack : err.toString())); | ||
.catch((err) => logger.error(err.stack ? err.stack : err.toString())); | ||
} else { | ||
@@ -114,0 +108,0 @@ console.log(` |
{ | ||
"name": "discotify", | ||
"version": "0.2.10", | ||
"version": "0.2.11", | ||
"description": "Discord Rich Presence for spotify in TypeScript", | ||
@@ -5,0 +5,0 @@ "homepage": "https://kurozero.xyz", |
@@ -1,2 +0,2 @@ | ||
# discotify `0.2.10` | ||
# discotify `0.2.11` | ||
Spotify Rich Presence for Discord in TypeScript<br/> | ||
@@ -6,3 +6,3 @@ *shows your currently playing song as a fancy rich presence in Discord* | ||
Install globally with:<br/> | ||
`npm install -g discotify@0.2.10` | ||
`npm install -g discotify@0.2.11` | ||
@@ -9,0 +9,0 @@ ## Requirements |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49656
8
362
1