Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iTunes is dead, Music emerged! #19

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

<a name="2.3.1"></a>
## [2.3.1](https://github.com/mischah/itunes-remote/compare/2.3.0...2.3.1) (2020-03-27)



<a name="2.3.0"></a>
# [2.3.0](https://github.com/mischah/itunes-remote/compare/v2.2.0...v2.3.0) (2017-07-20)

Expand Down
42 changes: 21 additions & 21 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
var vorpal = require('vorpal')();
var ora = require('ora');
var chalk = require('chalk');
var itunesRemote = require('./');
var musicRemote = require('./');

vorpal
.history('itunes-remote')
.delimiter('iTunes:')
.history('music-remote')
.delimiter('Music:')
.show();

vorpal.find('exit').description('Exit itunes-remote.');
vorpal.find('exit').description('Exit music-remote.');

vorpal
.command('play', 'Start playing the current selection.')
.alias('start')
.option('-E, --exit', 'exit itunes-remote after executing the command')
.option('-E, --exit', 'exit music-remote after executing the command')
.action(function (args, callback) {
var self = this;
var spinner = ora().start();
itunesRemote('play', function (response) {
musicRemote('play', function (response) {
spinner.stop();
if (args.options.exit) {
vorpal.execSync('exit');
Expand All @@ -35,7 +35,7 @@ vorpal
var self = this;
var spinner = ora('Getting artists').start();

itunesRemote('getData', function (response) {
musicRemote('getData', function (response) {
var artists = [];
spinner.stop();
artists = response.artists;
Expand All @@ -48,7 +48,7 @@ vorpal
}, function (result) {
var selectedArtist = result.artist;
var spinner = ora('Searching for songs by ' + chalk.blue(result.artist)).start();
itunesRemote('search', function (response) {
musicRemote('search', function (response) {
spinner.stop();
self.log(response);
callback();
Expand All @@ -66,7 +66,7 @@ vorpal
var self = this;
var spinner = ora('Getting albums').start();

itunesRemote('getData', function (response) {
musicRemote('getData', function (response) {
var albums = [];
spinner.stop();
albums = response.albums;
Expand All @@ -79,7 +79,7 @@ vorpal
}, function (result) {
var selectedAlbum = result.album;
var spinner = ora('Searching for albums named ' + chalk.blue(result.album)).start();
itunesRemote('search', function (response) {
musicRemote('search', function (response) {
spinner.stop();
self.log(response);
callback();
Expand All @@ -93,11 +93,11 @@ vorpal

vorpal
.command('stop', 'Stop playing the current selection')
.option('-E, --exit', 'exit itunes-remote after executing the command')
.option('-E, --exit', 'exit music-remote after executing the command')
.action(function (args, callback) {
var self = this;
var spinner = ora().start();
itunesRemote('stop', function (response) {
musicRemote('stop', function (response) {
spinner.stop();
self.log(response);
if (args.options.exit) {
Expand All @@ -109,11 +109,11 @@ vorpal

vorpal
.command('pause', 'Pause playing the current selection')
.option('-E, --exit', 'exit itunes-remote after executing the command')
.option('-E, --exit', 'exit music-remote after executing the command')
.action(function (args, callback) {
var self = this;
var spinner = ora().start();
itunesRemote('pause', function (response) {
musicRemote('pause', function (response) {
spinner.stop();
self.log(response);
if (args.options.exit) {
Expand All @@ -125,11 +125,11 @@ vorpal

vorpal
.command('next', 'Advance to the next track in the current playlist.')
.option('-E, --exit', 'exit itunes-remote after executing the command')
.option('-E, --exit', 'exit music-remote after executing the command')
.action(function (args, callback) {
var self = this;
var spinner = ora().start();
itunesRemote('next', function (response) {
musicRemote('next', function (response) {
spinner.stop();
self.log(response);
if (args.options.exit) {
Expand All @@ -142,11 +142,11 @@ vorpal
vorpal
.command('previous', 'Return to the previous track in the current playlist.')
.alias('prev')
.option('-E, --exit', 'exit itunes-remote after executing the command')
.option('-E, --exit', 'exit music-remote after executing the command')
.action(function (args, callback) {
var self = this;
var spinner = ora().start();
itunesRemote('previous', function (response) {
musicRemote('previous', function (response) {
spinner.stop();
self.log(response);
if (args.options.exit) {
Expand All @@ -158,11 +158,11 @@ vorpal

vorpal
.command('back', 'Reposition to beginning of current track or go to previous track if already at start of current track.')
.option('-E, --exit', 'exit itunes-remote after executing the command')
.option('-E, --exit', 'exit music-remote after executing the command')
.action(function (args, callback) {
var self = this;
var spinner = ora().start();
itunesRemote('back', function (response) {
musicRemote('back', function (response) {
spinner.stop();
self.log(response);
if (args.options.exit) {
Expand All @@ -181,7 +181,7 @@ vorpal
.action(function (args, callback) {
var self = this;
var spinner = ora('Searching …').start();
itunesRemote('search', function (response) {
musicRemote('search', function (response) {
spinner.stop();
self.log(response);
callback();
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,6 @@ module.exports = function (command, callback, args) {
});
break;
default:
throw new Error('You have to call itunesRemote with a command');
throw new Error('You have to call musicRemote with a command');
}
};
2 changes: 1 addition & 1 deletion lib/back.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module.exports = {
method: function () {
var app = Application('iTunes'); // eslint-disable-line new-cap
var app = Application('Music'); // eslint-disable-line new-cap

app.run();
app.backTrack();
Expand Down
2 changes: 1 addition & 1 deletion lib/getLibraryData.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module.exports = {
method: function () {
(function () {
var app = Application('iTunes'); // eslint-disable-line new-cap
var app = Application('Music'); // eslint-disable-line new-cap
var library = app.libraryPlaylists[0];
var tracks;
var artists = [];
Expand Down
2 changes: 1 addition & 1 deletion lib/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module.exports = {
method: function () {
var app = Application('iTunes'); // eslint-disable-line new-cap
var app = Application('Music'); // eslint-disable-line new-cap

app.run();
app.nextTrack();
Expand Down
2 changes: 1 addition & 1 deletion lib/pause.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module.exports = {
method: function () {
var app = Application('iTunes'); // eslint-disable-line new-cap
var app = Application('Music'); // eslint-disable-line new-cap

app.run();
app.pause();
Expand Down
2 changes: 1 addition & 1 deletion lib/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module.exports = {
method: function () {
var app = Application('iTunes'); // eslint-disable-line new-cap
var app = Application('Music'); // eslint-disable-line new-cap
var playlist = '{{playlist}}';

app.run();
Expand Down
2 changes: 1 addition & 1 deletion lib/previous.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module.exports = {
method: function () {
var app = Application('iTunes'); // eslint-disable-line new-cap
var app = Application('Music'); // eslint-disable-line new-cap

app.run();
app.previousTrack();
Expand Down
4 changes: 2 additions & 2 deletions lib/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
module.exports = {
method: function () {
(function () {
var playlistName = 'itunes-remote';
var app = Application('iTunes'); // eslint-disable-line new-cap
var playlistName = 'music-remote';
var app = Application('Music'); // eslint-disable-line new-cap
var searchTerm = "{{searchTerm}}"; // eslint-disable-line quotes
var library = app.libraryPlaylists[0];
var result;
Expand Down
2 changes: 1 addition & 1 deletion lib/stop.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module.exports = {
method: function () {
var app = Application('iTunes'); // eslint-disable-line new-cap
var app = Application('Music'); // eslint-disable-line new-cap

app.run();
app.stop();
Expand Down
Loading