Giter Site home page Giter Site logo

ruby-ampache's Introduction

ruby-ampache

Ruby-ampache is a really simple command line player for the ampache music server.

Installation

You need to have mplayer installed to use ruby-ampache. Mplayer is used for playing music streams.

I’ve recently changed the way mplayer is invoked as mplayer slave mode is great, but not good to manage playlists.. I’m still testing it right now but it should work far better.

A few options have been added to the menu and most of all it is full of colors now!

Gem can be installed as usual

gem install ruby-ampache

Usage

First you have to write a .ruby-ampache file and save it in your $HOME

example file:

AMPACHE_HOST="http://path_to_your_ampache_host"
AMPACHE_USER="username"
AMPACHE_USER_PSW="userpsw"
#optional (default is /usr/bin/mplayer)
MPLAYER_PATH="/usr/bin/mplayer"

Simply execute ruby-ampache that should be found in you $PATH after installation

TODO

This is an alpha version and still has some issues. If you kill the application mplayer will continue to run in background. Also sometimes if mplayer get stucked playing a song the app does the same.

If you found more issues please let me know and I’ll try to fix them as soon as possible

  • fix encoding issues with file metadata retrieved from mplayer

Notes

Special thanks goes to the developer of mplayer-ruby gem. I’ve borrowed a couple of methods from his useful library

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 ghedmat. See LICENSE for details. Please drop me a line if you find this useful

ruby-ampache's People

Contributors

ghedamat avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ruby-ampache's Issues

fails with servers on ports other than 80

The server URI is parsed in such a way that it always attempts to make connections on port 80.

Simple patch:

--- lib-ampache.rb.orig 2012-09-05 15:57:19.000000000 +0100
+++ lib-ampache.rb  2012-09-05 15:40:00.000000000 +0100
@@ -24,13 +24,14 @@
     uri = URI.parse(host)
     @host = uri.host
     @path = uri.path
+    @port = uri.port
     @user = user
     @psw = psw
     @token = nil
     @token = getAuthToken(user, psw)
   end

-  attr_accessor :host, :path, :user, :psw, :token, :playlist
+  attr_accessor :host, :path, :user, :psw, :token, :playlist, :port

   # tryies to obtain an auth token
   def getAuthToken(user, psw)
@@ -57,7 +58,7 @@
     begin
       args['auth'] ||= token if token
       url = path + "/server/xml.server.php?action=#{method}&#{args.keys.collect { |k| "#{k}=#{args[k]}" }.join('&')}"
-      response = Net::HTTP.get_response(host, url)
+      response = Net::HTTP.get_response(host, url, port)
       return Nokogiri::XML(response.body)
     rescue Errno::ECONNREFUSED => e
       warn "Ampache closed with the following error"

Shuffle Feature

It would be nice to have a option in the menu to shuffle the current playlist. I don't think it need to shuffle automatically but it would be nice to have an option that just shuffles the order if you want to.

High cpu usage under Cygwin Ruby

Hi

When I use your tool, ruby .exe(under cygwin) is using %25 cpu and mplayer uses another %25 on dual core. This sounds alot of simply playing streaming video.

Anyways great tool, keep up the great work.

restore ticket

after two h of playing token expires and you have to quit ruby-ampache

please add a check and renew the ticket automagically

refresh ticket

after 2 h of playing ticket expires...

add a refresh ticket option to main menu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.