Git Product home page Git Product logo

mpd_client's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mpd_client's Issues

Getting state_changes fails with "you don't have permission for idle" on password protected MPD

I'm trying to connect to a MPD with everything password protected. I provide correct password with "password" command. Executing commands such as "next" works, but when trying to get state change with state_changes.next() I get this error:

Error: ErrorMessage(Error { code: 4, command_index: 0, current_command: Some("idle"), message: "you don't have permission for "idle"" })

Perhaps this has something to do with mpd_client sending "idle" command before it is even possible to send password to MPD. Or maybe I'm missing something? (I'm new with rust)

Add support for `sticker` commands

https://mpd.readthedocs.io/en/latest/protocol.html#stickers

I've started work on this myself but wanted to log it here for the sake of completion or in case you have any opinions.

As far as I can tell, the sticker command is the only one in the protocol to have subcommands in this fashion. It seems a bit silly/fiddly to add a dedicated commands::Sticker command, so instead I'm opting to go for commands::StickerGet, commands::StickerGet, etc.

I'll get a draft PR open once things are in a semi-decent state.

Connection closed despite successful command

I can successfully create a connection with mpd and ask for the protocol version e.g. but as soon as I send a command the connection is closed. Due to ConnectionClosed being an error in the Result from running a command, if I query the status e.g., i won't actually get it. However, the commands have an effect on the mpd server: stop works and I can see status data being sent back over TCP.

By running tcpdump I can see that to the end of a TCP connection, this library sends an empty message over TCP, which is followed by an empty TCP message by mpd and again, and empty TCP message by this library:

โ€ฆ
song: 0
songid: 186
OK

23:10:02.763061 IP localhost.35920 > localhost.mshvlm: Flags [F.], seq 68, ack 173, win 260, options [nop,nop,TS val 1105770442 ecr 1105770441], length 0
E..4.<@[email protected]...#c._+.`.....(.....
A...A...
23:10:02.763212 IP localhost.mshvlm > localhost.35920: Flags [F.], seq 173, ack 69, win 260, options [nop,nop,TS val 1105770442 ecr 1105770442], length 0
E..4:.@[email protected]_+.`.#c......(.....
A...A...
23:10:02.763275 IP localhost.35920 > localhost.mshvlm: Flags [.], ack 174, win 260, options [nop,nop,TS val 1105770442 ecr 1105770442], length 0
E..4.=@[email protected]...#c._+.a.....(.....
A...A...

Afaik sending an empty message means that you are shutting down the TCP connection.

build failed

    Updating crates.io index
   Compiling proc-macro2 v1.0.52
   Compiling libc v0.2.140
   Compiling unicode-ident v1.0.8
   Compiling quote v1.0.26
   Compiling syn v1.0.109
   Compiling cfg-if v1.0.0
   Compiling memchr v2.5.0
   Compiling log v0.4.17
   Compiling autocfg v1.1.0
   Compiling once_cell v1.17.1
   Compiling version_check v0.9.4
   Compiling pin-project-lite v0.2.9
   Compiling bytes v1.4.0
   Compiling minimal-lexical v0.2.1
   Compiling tracing-core v0.1.30
   Compiling tokio v1.26.0
   Compiling ahash v0.7.6
   Compiling nom v7.1.3
   Compiling getrandom v0.2.8
   Compiling num_cpus v1.15.0
   Compiling socket2 v0.4.9
   Compiling mio v0.8.6
   Compiling tracing-attributes v0.1.23
   Compiling tokio-macros v1.8.2
   Compiling tracing v0.1.37
   Compiling mpd_protocol v1.0.0 (/home/m/adata/util/mpd_client/mpd_protocol)
   Compiling mpd_client v1.1.0 (/home/m/adata/util/mpd_client/mpd_client)
error[E0658]: default values for const generic parameters are experimental
   --> mpd_client/src/commands/definitions.rs:704:32
    |
704 | pub struct List<const N: usize = 0> {
    |                                ^^^
    |
    = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `mpd_client` due to previous error

I'm getting this error when trying to build. I don't know rust and that issue mentioned in the end of the error log doesn't tell me much Is it a problem on my end?

Patch: Added shuffle command and expanded Queue command

Hi,

I added a few things in the attached patch:

  • Expanded the queue command to allow a song ID, a song position and a range as optional parameters (will generate a playlistid or playlistinfo command with the appropriate arguments)
  • Added a shuffle command with an optional song range

I tried to create a pull request, but am stuck not being able to publish my branch (happy to create a branch and pull request, if you prefer - but will need a few pointers on how to do that).

Thanks for your work on this crate - it's very helpful to me. :)
shuffle_playlist.zip

Playlist (.m3u) in MPD database causes `ListAllIn` to fail

If a playlist is present in the MPD database (e.g. a .m3u file) then issuing a ListAllIn command results in the following error: InvalidTypedResponse(TypedResponseError { field: "file", kind: UnexpectedField("playlist") }).

This probably also affects other commands? Not sure whether this is something people using MPD usually do. (I personally wouldn't but this happened when throwing MPD against an unorganized collection.)

Error: UnexpectedField "Last-Modified" on directory

Fetching the songs from my database gives me:

Error: InvalidTypedResponse(TypedResponseError { field: "file", kind: UnexpectedField("Last-Modified") })

I tracked down the point where it occurs in the code and then checked the actual frame.
Looks something like this:

parse_frame:
- directory: The Lumineers
- Last-Modified: 2021-04-27T08:24:23Z
- directory: The Lumineers/Cleopatra
- Last-Modified: 2021-02-22T13:09:32Z
- file: The Lumineers/Cleopatra/01-Sleep on the Floor.flac
- Last-Modified: 2021-02-22T11:08:42Z
- Format: 44100:16:2
- Title: Sleep on the Floor
- Artist: The Lumineers
- AlbumArtist: The Lumineers
- Album: Cleopatra
- Disc: 1
- Date: 2016
- Track: 1
- Genre: Folk Pop
- Time: 213
- duration: 212.800

I have a PR in the works to resolve this.

Comparison to async-mpd?

๐Ÿ‘‹ I see this is an active project. I'm looking for an mpd backend and considered this versus https://lib.rs/crates/async-mpd .

One thing I noticed is that your lib doesn't use any unsafe code (๐Ÿ‘)

Is there any other reason that you're not just using the existing project?

Thanks in advance!

InvalidMessage when playing a song

Hi, I was trying to use mpd-discord-rpc, which uses this library, and I'm getting this error when I play a song:

image

I opened an issue in that repo and the author told me the error seems to be coming from this library so I should post it here. I'm on macOS Monterey by the way. Let me know if you need any extra info.

Add tests

Currently just verified by a "seems to work" integration test.

Backpressure

Commands are infinitely & immediately buffered (both by the channel used to send them and the internal command queue).

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.