Skip to content

Commit

Permalink
Add delete ID, volume commands. Doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
istnv committed Jul 24, 2021
1 parent 0bd65d4 commit c4143a3
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
2 changes: 2 additions & 0 deletions HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Action | Description
**Shuffle** | Toggle playlist shuffle (random) mode
**Repeat** | Toggle item repeat mode (cancels loop mode)
**Clear Playlist** | Clear all items from Playlist
**Delete ID** | Delete item with ID from Playlist
**Volume** | Adjust VLC playback volume. Can be Absolute (0-320) or Relative (+1, -5)
**Add Item** | Add item to Playlist
**Add and Play** | Add item to Playlist and Play

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,11 @@ See HELP.md and LICENSE
* Add variables for Time Elapsed

**V1.1.10**
* Add clear playlist, add to playlist, add to playlist and play
* Add clear playlist, add to playlist, add to playlist and play

**V1.1.11**
* Core updates / upgrade scripts

**V1.1.12**
* Add **delete** playlist ID
* Add **volume** adjust
31 changes: 31 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,28 @@ instance.prototype.actions = function(system) {
},
],
},
deleteID: {
label: 'Delete ID',
options: [
{
type: 'textinput',
label: 'Clip Number',
id: 'clip',
regex: self.REGEX_NUMBER,
},
],
},
volume: {
label: 'Set Volume',
options: [
{
type: 'textinput',
label: 'Value',
id: 'volume',
regex: self.REGEX_SIGNED_NUMBER
}
]
},
full: { label: 'Full Screen' },
loop: { label: 'Loop' },
shuffle: { label: 'Shuffle' },
Expand All @@ -1061,6 +1083,7 @@ instance.prototype.action = function(action) {
var cmd;
var opt = action.options;
var theClip = opt.clip;
var vol = opt.volume;

if (theClip) {
theClip = self.PlayIDs[theClip - 1];
Expand Down Expand Up @@ -1098,6 +1121,10 @@ instance.prototype.action = function(action) {
cmd = '?command=pl_empty';
break;

case 'deleteID':
cmd = '?command=pl_delete&id=' + theClip;
break;

case 'add':
cmd = '?command=in_enqueue&input=' + opt.mrl;
break;
Expand All @@ -1106,6 +1133,10 @@ instance.prototype.action = function(action) {
cmd = '?command=in_play&input=' + opt.mrl;
break;

case 'volume':
cmd = '?command=volume&val=' + vol;
break;

case 'full':
cmd = '?command=fullscreen';
break;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"legacy": [
"vlc"
],
"version": "1.1.11",
"version": "1.1.12",
"api_version": "1.0.0",
"keywords": [
"Video",
Expand Down

0 comments on commit c4143a3

Please sign in to comment.