not-jan/apex-tux

Issue with music display

Closed this issue · 6 comments

Hi I'm having an issue with the music length, I'm using Spotpris2 and it seems to send the length of the music in a type that isn't in u64.

Because if I change every u64 in that commit back to i64, it works fine.

So maybe one fix could be to try to get the length in u64 and if that fails, then also try in i64?

Please note I have no experience in rust so my fix could be impossible to do.

I have a fix for this but I'm currently lacking a Linux machine to actually compile / test the DBus code. I'll try to get it done by tonight.

My changes can be found here: https://github.com/not-jan/apex-tux/tree/feat/length-compat

It compiles but I can't test it atm. Can you maybe try the changes @jehendeoff ?

I just tried those changes however, it doesn't compile on my computer, it gives me that error :

error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
    --> apex-mpris2/src/player.rs:26:14
     |
26   |             .copied()
     |              ^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
     |
note: required by a bound in `Option::<&T>::copied`
    --> /home/jehende/.rustup/toolchains/nightly-2023-04-22-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:1830:12
     |
1830 |         T: Copy,
     |            ^^^^ required by this bound in `Option::<&T>::copied`
help: consider restricting type parameter `T`
     |
24   |     fn length_<T: std::marker::Copy>(&self) -> Result<T> {
     |                 +++++++++++++++++++

For more information about this error, try `rustc --explain E0277`.
error: could not compile `apex-mpris2` (lib) due to previous error

I have cargo nightly 1.71.0 (2023-04-16)

Ah, that's my bad. I've compiled the master branch and not the fix branch. I've pushed a fix for this error and now it compiles on my machine. Can you test it again, @jehendeoff ?

I just tried it and it works perfectly, thank you

Thank you for the testing, I'll close this issue and merge the branch.