lib/ayadn/main.rb in ayadn-0.6.2 vs lib/ayadn/main.rb in ayadn-0.6.3
- old
+ new
@@ -427,22 +427,30 @@
end
puts "\n"
end
def ayadn_alias_channel(channel_id, channel_alias)
puts "\nAdding new alias: ".cyan + "#{channel_id} ".brown + "=> " + "#{channel_alias}\n".green
- if channel_id.is_integer? && channel_alias != nil
- $files.save_channel_alias(channel_id, channel_alias)
+ unless channel_id.nil? || channel_alias.nil?
+ if channel_id.is_integer?
+ $files.save_channel_alias(channel_id, channel_alias)
+ else
+ puts $status.errorSyntax
+ puts "List of saved aliases: \n".cyan
+ puts ayadn_list_aliases
+ exit
+ end
else
puts $status.errorSyntax
+ puts "List of saved aliases: \n".cyan
+ puts ayadn_list_aliases
exit
end
puts "List of saved aliases: \n".cyan
puts ayadn_list_aliases
puts "Done!\n\n".green
end
def ayadn_nowplaying
- case $tools.ayadn_configuration[:platform]
- when $tools.winplatforms
+ unless $tools.ayadn_configuration[:platform] =~ /darwin/
puts "\nThis feature only works with Mac OS X and iTunes. Sorry.\n\n".red
exit
end
begin
track = `osascript -e 'tell application "iTunes"' -e 'set trackName to name of current track' -e 'return trackName' -e 'end tell'`