Giter VIP home page Giter VIP logo

subs's Introduction

subs

subs is a client-server based music player for Subsonic-compliant music servers.

Its interface is modelled after mpc, the terminal control for the mpd music server.

Installing

subs is not yet on crates.io, so installation is currently done manually.

$ git clone https://github.com/Azphreal/subs
$ cd subs
$ cargo build --release
$ sudo mkdir -p /usr/local/bin
$ sudo cp ./target/release/subs /usr/local/bin/subs

Dependencies

  • rust
  • cargo
  • some combination of GStreamer and plugins (yet to be confirmed; apologies)

Usage

subs creates a local daemon to handle playing music, sending requests to the Subsonic server, and so on.

$ export SUBS_URL="<your Subsonic website>"
$ export SUBS_USERNAME="<your Subsonic user>"
$ export SUBS_PASSWORD="<your Subsonic password>"
$ subs daemon start

The daemon will start in the foreground on the current terminal. Starting the daemon without the above environment variables will connect you to the demo server at https://demo.subsonic.org/.

$ subs help
USAGE:
    subs [FLAGS] <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information
    -v, --verbose    Sets the verbosity

SUBCOMMANDS:
    add        Add a song to the current playlist
    addnext    Add a song to play after the current song
    clear      Clear the current playlist
    crop       Remove all but the currently playing song
    current    Display the currently playing song
    daemon     Control the client daemon
    help       Prints this message or the help of the given subcommand(s)
    list       List information from the library
    load       Load a playlist as the current playlist
    next       Play the next song in the current playlist
    pause      Suspend playback of the current playlist
    play       Play the current playlist
    prev       Play the previous song in the current playlist
    random     Load a number of random songs
    search     Search the library; default returns only songs
    shuffle    Shuffle the curent playlist
    status     Display the status of the daemon
    toggle     Toggle between playing or paused states
    update     Initiate a scan of the library

Note that some of the functionality is not yet implemented, and new functionality will likely be added.

Examples of basic operations:

$ subs random 50 # adds 50 random songs to the queue
$ subs play

$ subs addnext bad micheal jackson
Adding Bad.
$ subs next

$ subs search micheal jackson # default only searches for songs
Panic! at the Disco feat. Lolo - Too Weird to Live, Too Rare to Die! [2013] - Miss Jackson
Michael Jackson - The Essential Michael Jackson [2005] - Smooth Criminal
The Jackson 5 - The Essential Michael Jackson [2005] - Enjoy Yourself
The Jackson 5 - The Essential Michael Jackson [2005] - Blame It on the Boogie
...

$ subs search -a micheal jackson # artists
Micheal Jackson

$ subs search -b micheal jackson # albums
Michael Jackson - The Essential Michael Jackson [2005]
Michael Jackson - XSCAPE [2014]

$ subs status
Micheal Jackson - Bad
[playing]  #2/51  1:24/4:07 (33%)

License

Licensed under the Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0).

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

subs's People

Contributors

meskio avatar xeals avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

meskio

subs's Issues

Figure out how to determine duration when it's not given

So it seems that some Subsonic doesn't parse ID3 tags properly for some media formats. Prime examples in my personal library are ogg files. Examples for an ogg file here and flac here. These are fully tagged in my beets library, and this is what Subsonic returns to me (for reference, the ogg is 132Kbps and 221 seconds).

The duration tag is parsed as a None, and thus the playback loop fails spectacularly because I have to guess how long the song is, and status crashes the server because it panics unwrapping the duration (or would error if I did it properly).

Simple math does work here, but luckily for me (/s) Subsonic also doesn't return bit rate with info on these media formats, so I can't guess at their duration by (file size / bit rate).

Forcing a fixed streaming bit rate works to a point, as you can't upsample a song; this works if the source is above whatever limit is set, but fails anyway if it's lower. I could make this a run-time variable and leave it to people to pick something lower than the lowest bit rate in their collection, but that sounds bad.

Looking for opinions on how to solve this (if it's even possible).

Build fails

I just tried to build the project because it seems quite interesting, however it fails with the following error:

    Updating registry `https://github.com/rust-lang/crates.io-index`
error: failed to load source for a dependency on `sunk`                                                                                            

Caused by:
  Unable to update file:///home/heyarne/Downloads/sunk

Caused by:
  failed to read `/home/heyarne/Downloads/sunk/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

subs play doesn't do anything

Hi!

I find the whole idea of managing my airsonic instance via terminal quite cool. I don't know what the status of this cli is but I thought I'd give it a go. I can search for songs and subs add them. When I run subs play however nothing happens. Is this not implemented yet?
There was another cli in the airsonic community, airsonic-cli, but it was only briefly developed and is now abandoned. What's the general plan for this if there is any?

Anyways, thanks for your work on this so far!

Feedback for usage; listing collection contents

Planning to have functions to list albums/songs in artists/albums (directly related to what the Subsonic API returns). May also implement "list all songs for artist" by recursively searching through the artist's albums.

Looking for ideas on how to name these functions:

  • list playlists / artists / albums should be obvious to intent
  • list songs; not sure if this is appropriate. Current thought is to have a flag to determine what to list from (playlist, artist, or album), defaulting to album.

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.