Skip to content

Commit

Permalink
Merge pull request #546 from Androz2091/develop
Browse files Browse the repository at this point in the history
4.1.2
  • Loading branch information
SN0WF14K3 authored Jun 22, 2021
2 parents da5ab95 + fe1ef9d commit 082780c
Show file tree
Hide file tree
Showing 11 changed files with 362 additions and 410 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Bug report
about: Create a bug report to help us improve
title: "[BUG] "
title: ""
labels: bug
assignees: ''

Expand All @@ -13,9 +13,9 @@ assignees: ''
**To Reproduce**
Steps to reproduce the behavior:
<!-- 1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error -->
1. Click on '....'
2. Scroll down to '....'
3. See error -->

**Expected behavior**
<!-- A clear and concise description of what you expected to happen. -->
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature Request] "
title: ""
labels: enhancement
assignees: ''

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Question
about: Some questions related to this lib
title: "[QUESTION] "
title: ""
labels: question
assignees: ''

Expand Down
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"printWidth": 120,
"printWidth": 400,
"trailingComma": "none",
"singleQuote": true,
"tabWidth": 4
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discord-player",
"version": "4.1.1",
"version": "4.1.2",
"description": "Complete framework to facilitate music commands using discord.js",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -50,11 +50,11 @@
},
"homepage": "https://discord-player.js.org",
"dependencies": {
"discord-ytdl-core": "^5.0.3",
"discord-ytdl-core": "^5.0.4",
"soundcloud-scraper": "^5.0.0",
"spotify-url-info": "^2.2.0",
"youtube-sr": "^4.0.7",
"ytdl-core": "^4.8.0"
"spotify-url-info": "^2.2.3",
"youtube-sr": "^4.1.5",
"ytdl-core": "^4.8.2"
},
"devDependencies": {
"@babel/cli": "^7.13.16",
Expand All @@ -63,7 +63,7 @@
"@babel/preset-typescript": "^7.13.0",
"@discord-player/extractor": "^3.0.0",
"@discordjs/opus": "^0.5.0",
"@types/node": "^14.14.41",
"@types/node": "^15.6.1",
"@types/ws": "^7.4.1",
"discord.js": "^12.5.3",
"discord.js-docgen": "discordjs/docgen#ts-patch",
Expand Down
268 changes: 75 additions & 193 deletions src/Player.ts

Large diffs are not rendered by default.

27 changes: 3 additions & 24 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface PlayerOptions {
disableAutoRegister?: boolean;
disableArtistSearch?: boolean;
fetchBeforeQueued?: boolean;
volume?: number;
}

export type FiltersName = keyof QueueFilters;
Expand Down Expand Up @@ -67,19 +68,7 @@ export type QueueFilters = {
fadein?: boolean;
};

export type QueryType =
| 'soundcloud_track'
| 'soundcloud_playlist'
| 'spotify_song'
| 'spotify_album'
| 'spotify_playlist'
| 'youtube_video'
| 'youtube_playlist'
| 'vimeo'
| 'facebook'
| 'reverbnation'
| 'attachment'
| 'youtube_search';
export type QueryType = 'soundcloud_track' | 'soundcloud_playlist' | 'spotify_song' | 'spotify_album' | 'spotify_playlist' | 'youtube_video' | 'youtube_playlist' | 'vimeo' | 'facebook' | 'reverbnation' | 'attachment' | 'youtube_search';

export interface ExtractorModelData {
title: string;
Expand Down Expand Up @@ -131,17 +120,7 @@ export interface PlayerStats {
};
system: {
arch: string;
platform:
| 'aix'
| 'android'
| 'darwin'
| 'freebsd'
| 'linux'
| 'openbsd'
| 'sunos'
| 'win32'
| 'cygwin'
| 'netbsd';
platform: 'aix' | 'android' | 'darwin' | 'freebsd' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
cpu: number;
memory: {
total: string;
Expand Down
8 changes: 2 additions & 6 deletions src/utils/AudioFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,11 @@ const FilterList = {
},

get names() {
return Object.keys(this).filter(
(p) => !['names', 'length'].includes(p) && typeof this[p as FiltersName] !== 'function'
);
return Object.keys(this).filter((p) => !['names', 'length'].includes(p) && typeof this[p as FiltersName] !== 'function');
},

get length() {
return Object.keys(this).filter(
(p) => !['names', 'length'].includes(p) && typeof this[p as FiltersName] !== 'function'
).length;
return Object.keys(this).filter((p) => !['names', 'length'].includes(p) && typeof this[p as FiltersName] !== 'function').length;
},

toString() {
Expand Down
3 changes: 2 additions & 1 deletion src/utils/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ export const PlayerOptions: DP_OPTIONS = {
leaveOnEmptyCooldown: 0,
autoSelfDeaf: true,
enableLive: false,
ytdlDownloadOptions: {}
ytdlDownloadOptions: {},
volume: 100
};
5 changes: 1 addition & 4 deletions src/utils/Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ export class Util {
static alertFFmpeg(): void {
const hasFFmpeg = Util.checkFFmpeg();

if (!hasFFmpeg)
console.warn(
'[Discord Player] FFmpeg/Avconv not found! Install via "npm install ffmpeg-static" or download from https://ffmpeg.org/download.html'
);
if (!hasFFmpeg) console.warn('[Discord Player] FFmpeg/Avconv not found! Install via "npm install ffmpeg-static" or download from https://ffmpeg.org/download.html');
}

/**
Expand Down
Loading

0 comments on commit 082780c

Please sign in to comment.