agersant / polaris Goto Github PK
View Code? Open in Web Editor NEWPolaris is a music streaming application, designed to let you enjoy your music collection from any computer or mobile device.
License: MIT License
Polaris is a music streaming application, designed to let you enjoy your music collection from any computer or mobile device.
License: MIT License
In Chrome and the new Edge, the media controls currently looks like this:
This is customizable with javascript:
https://developers.google.com/web/updates/2017/02/media-session
Adding action handlers for for play
,pause
, previoustrack
and nexttrack
would greatly increase the usability of a web-based media player, allowing people to control the audio playback with their bluetooth headsets or with the media keys on their keyboard. Setting the thumbnail as well would make it pretty on Android.
BTW, what a great project! Finally a media player which allows me to browse the folder structure directly i can host on my NAS!
"Gapless playback" and crossfade between tracks are common options in similar software for e.g. live albums, vinyl rips, etc.
Can we add those?
Just tried compiling 0.10.0 on macOS and it fails with:
~/D/polaris-0.10.0 > make install
cargo build --release
Compiling migrations_internals v1.4.0
Compiling rocket v0.4.0
error[E0432]: unresolved import `std::boxed::FnBox`
--> /Users/andrewbanchich/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket-0.4.0/src/fairing/ad_hoc.rs:2:5
|
2 | use std::boxed::FnBox;
| ^^^^^^^^^^^^^^^^^ no `FnBox` in `boxed`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0432`.
error: Could not compile `rocket`.
warning: build failed, waiting for other jobs to finish...
error: build failed
make: *** [build] Error 101
Until version 0.11.0 version names start with a v
, since 0.12.0 the v
was removed, not is a big problem, but breaks automations.
With assets names is the same: polaris-0.11.0.tar.gz
Polaris_0.12.0.tar.gz
.
I think that you must choose one format and use it from now ๐
I've just tried building this using the current source and it seems to run ok, indexing the music library (I can see it looking at files via Resource Monitor) until eventually it gives this error and crashes.
"memory allocation of 18446744073709551584 bytes failed"
nothing logs, it just quits. like this:
void@voidcoinminer:~/polaris/polaris/release$ ~/.local/bin/polaris/polaris
void@voidcoinminer:~/polaris/polaris/release$
compiled from master
branch.
Preflighted requests in for CORS send a HTTP OPTIONS
requests to the server to ask for permission to use the resource cross origins. Polaris does not currently seem to handle OPTIONS
requests, nor provide any of the CORS headers.
Use case: Develop polaris-web
while using a remotely hosted polaris
api instance
If the API is meant to be public, then enabling CORS should not be an issue. At least as an optional flag.
It seems like the default behavior for Rocket on this topic have been debated for some years and the current situation is that they don't handle it at all. But there exist a nice crate called rocket_cors which might be the solution.
diff --git a/src/api.js b/src/api.js
--- a/src/api.js
+++ b/src/api.js
@@ -17,7 +17,7 @@ let request = function(endpoint, options) {
options = {};
}
options.credentials = "same-origin";
- return fetch("api" + endpoint, options)
+ return fetch("http://192.168.0.x:5050/api" + endpoint, options)
.then(res => {
if (res.status == 401) {
Router.push("/auth").catch(err => { });
@@ -29,11 +29,11 @@ let request = function(endpoint, options) {
export default {
makeAudioURL(path) {
- return "api/audio/" + encodeURIComponent(path);
+ return "http://192.169.0.x:5050/api/audio/" + encodeURIComponent(path);
},
makeThumbnailURL(path) {
- return "api/thumbnail/" + encodeURIComponent(path) + "?pad=false";
+ return "http://192.169.0.x:5050/api/thumbnail/" + encodeURIComponent(path) + "?pad=false";
},
initialSetup() {
@@ -42,7 +42,7 @@ export default {
},
login(username, password) {
- return fetch("api/auth", {
+ return fetch("http://192.168.0.x:5050/api/auth", {
method: "POST",
body: JSON.stringify({ username: username, password: password }),
headers: {
Going with the trend of modern applications nowadays, would it be possible to implement a dark theme to Polaris as a toggle?
I've hacked together a basic CSS override that works once a user is signed in (might need tweaking etc. for accessibility).
.paneHeader, .paneContent, player, router route auth {
background-color: rgb(27, 38, 44);
}
.paneContent * {
color: rgb(255, 255, 255);
}
.paneHeader * {
color: rgb(255, 255, 255);
}
breadcrumbs ul li, .paneContent button, .paneHeader button {
background-color: rgb(15, 76, 117);
color: rgb(255, 255, 255);
}
.paneHeader select, .paneHeader input, .paneContent select, .paneContent input {
color: rgb(0, 0, 0);
}
button {
border: 0 !important;
}
playlist tr:nth-child(2n) {
background-color: rgb(35, 46, 52);
}
player * {
color: rgb(255, 255, 255) !important;
}
router route settings div, router route browser div, router route playlists div, playlist, playlist div, router route player {
border-color: rgb(35, 46, 52) !important;
}
menu .selected {
background-color: rgb(15, 76, 117);
}
I see that in utils::get_audio_format there is a variant for MP4 but in metadata::read it is not handled.
I'm creating this issue to track support for MP4 files. It seems that what's missing is the ability to read the meta data from such files. I may have a go at implementing it since a large part of my library is m4a.
I found this project while checking out the awesome selfhosted list. I'm working on my own music streaming server and noticed we we're working towards similar goals.
Would you be interested in collaborating on some projects in the future? I noticed there are several devs working on similar projects, and if we worked together we could get a lot farther. I'm open to ideas for project to collaborate on, so let me know if you're interested.
Hi!
Are there any Android or iOS apps for Polaris? I believe this is the primary use case for most users.
Is there an API and is it documented? The Wiki link on GitHub does not work.
I tested .\polaris.exe -h
but nothing was printed.
This causes audio playback to stop after a few seconds in Chrome when using polaris-web.
User feedback from reddit: https://www.reddit.com/r/rust/comments/cmfo6e/polaris_a_music_streaming_web_application_written/ew2b5cg/
I took the latest git branch and ran
cargo +nightly build
./target/debug/polaris -p 8182 -f
When ever I go visit localhost:8182
in the browser I get 500 internal server error. I have a feeling there might be a config I am missing.
I am trying to bring Polaris on Qnap NAS servers but
Stuck on error on compilation
Compiling app_dirs v1.2.1
Compiling rand_isaac v0.1.1
Compiling rand_xorshift v0.1.1
Compiling rand_hc v0.1.0
Compiling rustc_version v0.2.3
Compiling log v0.3.9
Compiling want v0.0.6
Compiling lock_api v0.1.5
Compiling crossbeam-channel v0.3.8
Compiling tokio-executor v0.1.6
error: failed to run custom build command for pear_codegen v0.1.2
Caused by:
process didn't exit successfully: /SRC/.MYSCRIPT/tmp3/target/release/build/pear_codegen-57d5be294dbebc7c/build-script-build
(exit code: 101)
--- stderr
Error: Pear requires a nightly or dev version of Rust.
Installed version is: 1.38.0 (2019-09-23). Minimum required: 1.31.0-nightly (2018-10-05).
thread 'main' panicked at 'Aborting compilation due to incompatible compiler.', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/pear_codegen-0.1.2/build.rs:31:13
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace.
any help is welcome
cargo --version
cargo 1.38.0 (23ef9a4ef 2019-08-20)
rustc --version
rustc 1.38.0 (625451e37 2019-09-23)
I tried to do a system-wide install on Linux and it's a bit of a mess. I ended up with this:
/var/lib/polaris
/var/lib/polaris/.local
/var/lib/polaris/.local/share
/var/lib/polaris/.local/share/polaris
/var/lib/polaris/.local/share/polaris/polaris.log
/var/lib/polaris/.local/share/polaris/polaris.pid
/var/lib/polaris/.local/share/polaris/thumbnails
/var/lib/polaris/.local/share/polaris/thumbnails/12698004523255186174.jpg
/var/lib/polaris/.local/share/polaris/thumbnails/11339598049783905663.jpg
/var/lib/polaris/.local/share/polaris/thumbnails/17518483773397318633.jpg
/var/lib/polaris/.local/share/polaris/db.sqlite
The .local/share
part shouldn't be there, the log file should be under /var/log
, and the PID file should be under /var/run
.
This one isn't great, but it would be nice to include a systemd
unit in the package. This can be used as a starting point.
[Unit]
Description=Polaris
After=network.target
[Service]
User=polaris
ExecStart=/usr/bin/polaris -f -w /usr/share/polaris/web -s /usr/share/polaris/swagger
WorkingDirectory=/var/lib/polaris
[Install]
WantedBy=default.target
I'd love to have a self-contained Docker image of Polaris to run on my Synology. I've found a Rust base image but as I don't know Rust, I'm missing the next steps to make it work.
It would be awesome if you could offer an image at some point in the future.
Some stuff to be aware of: http://beets.io/blog/sqlite-nightmare.html
In Linux, doing cargo build --release
I have the following error.
Compiling notify v4.0.9
Compiling h2 v0.1.16
Compiling id3 v0.2.5
Compiling devise_core v0.2.0
error[E0554]: #![feature] may not be used on the stable release channel
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/devise_core-0.2.0/src/lib.rs:1:1
|
1 | #![feature(proc_macro_diagnostic, proc_macro_span)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0554]: #![feature] may not be used on the stable release channel
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/devise_core-0.2.0/src/lib.rs:2:1
|
2 | #![feature(crate_visibility_modifier)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0554]: #![feature] may not be used on the stable release channel
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/devise_core-0.2.0/src/lib.rs:3:1
|
3 | #![feature(concat_idents)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0554`.
error: Could not compile `devise_core`.
warning: build failed, waiting for other jobs to finish...
error: build failed
I'm using cargo version 1.31.1 and rust 1.31.1.
The program version is 0.11.0
built from tar.gz in the Release page.
19:40:24 [INFO] rocket::rocket: [~/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket-0.4.2/src/rocket.rs:205] GET /api/browse/:
19:40:24 [INFO] _: [~/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket-0.4.2/src/rocket.rs:289] Matched: GET /api/browse (browse_root)
19:40:24 [INFO] _: [~/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket-0.4.2/src/rocket.rs:297] Outcome: Failure
19:40:24 [WARN] _: [~/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket-0.4.2/src/rocket.rs:318] Responding with 401 Unauthorized catcher.
19:40:24 [INFO] _: [~/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket-0.4.2/src/rocket.rs:120] Response succeeded.
I haven't checked, but it might be some sort of CSRF protection. I couldn't find a log out link, so I had to clear my cookies to be able to log in again.
Update: it was Rocket's encrypted cookies.
After #41, this no longer happens, but it would be nice if:
You might want to consider uploading the current version to crates.io, or at least squatting the crate name.
I'm planning on building a home NAS with freenas, and it is based on FreeBSD. Will I be able to run polaris on it?
What the title says. I'd like to test Polaris, but it's a bit slow at scanning my media library. Being able to share the library with mpd
would be really nice.
Title was: Add optional seed to /random
in api, have webui use it
In the web ui, you access /#random
to see a list of random albums, expanding this to /#random-{seed}
would make the ui more predictably when going forward and backward in the browser history, allowing you to queue more than one of the albums from the current selection. This could perhaps be done by adding an optional seed
query parmaters to the /random
api endpoint.
The sqlite query however is a bit more difficult to change because you need a way to make random numbers from a seed, which sqlite does not support.
One option is demonstrated here where they use fancy sql to compute random values. It is however not very clean in my option.
An another option is to implement your own random function in rust and have sqlite use it as shown here with C. I'm not familiar with rust and diesel, but from some quick googling, i determined it should be possible, with lots of nice macros to make the code more easy to read.
It's pretty good at playing music (using it via docker on OSX).
Would be really great if it ordered by track number please.
Rust already has binding for libopus https://docs.rs/opus/0.2.1/opus/
I don't know if this would help anyhow, but opus support for polaris would be very nice :)
Pending a more stable/bug-free version of https://github.com/passcod/notify or equivalent.
Most music formats can have album art embedded in the music file themselves. It would be great if it was supported as it's used a lot these days.
been looking for a replacement for logitech mediaserver and found this and was really impressed the only thing im missing is a progress indicator for scanning so im adding this issue to the tracker in hopes of it becoming a feature request
As the title says, the program starts with an error: "The program can't start because SSLEAY32MD.dll is missing from your computer. Try reinstalling the program to fix this problem."
I'm on Windows 10, running version 1607. This is with Polaris 0.2.0.
This should:
username
and admin
cookies client-sidePolaris takes quite some time to build. It's not terrible, but I feel we could do better.
Some low-hanging fruit is:
syn
, each taking around 37 seconds to buildfunction_name
) comes to mindThe web ui downloads fonts from google. Could you please store them locally?
I think you've already implemented actix-web
backend (then removed it, probably due to the controversy around it).
How would you feel about trying warp
? I know that Rocket will likely build on stable in a couple of months, but I'm pretty wary of procedural macros because of the build time cost. warp
is nice in that it doesn't require any macros, though it does have an unusual API.
I've started a warp
backend and implemented a couple of routes, but it's okay if you're not interested in trying it.
logs:
20:54:09 [ERROR] iron::iron: [/home/void/.cargo/registry/src/github.com-1ecc6299db9ec823/iron-0.6.0/src/iron.rs:177] Error handling:
Request {
url: Url { generic_url: "http://192.168.86.123:5050/api/lastfm/now_playing/void%20-%20Music/Deezloader/Frijo%20-%20Tiimmy%20Turner%20(Remix)/1%20-%20Tiimmy%20Turner%20(Remix).flac" }
method: Put
remote_addr: V4(192.168.86.222:46106)
local_addr: V4(0.0.0.0:5050)
}
Error was: NoRoute
20:56:20 [ERROR] iron::response: [/home/void/.cargo/registry/src/github.com-1ecc6299db9ec823/iron-0.6.0/src/response.rs:130] Error writing response: Broken pipe (os error 32)
20:56:20 [ERROR] iron::response: [/home/void/.cargo/registry/src/github.com-1ecc6299db9ec823/iron-0.6.0/src/response.rs:130] Error writing response: Connection reset by peer (os error 104)
firefox devtools shows the request isn't completed. like "haven't recieved status code yet" state.
Upstream issue: rust-lang/rust#68264
Workaround: ee71df9
In terms of Big Hairy Audacious goals, I'd love Sonos support in Polaris. The Sonos API is SOAP (yup), but documented on their site: https://developer.sonos.com/reference/sonos-music-api/
Would you be open to Sonos support in polaris
, or would you rule that as being a feature you don't want to maintain?
Every time I try to scan for media, the button just turns red and says "Error :(".
The error message in the log is as follows:
Error while writing to index command buffer: sending on a closed channel
Skipping DDNS update because credentials are missing
Skipping DDNS update because credentials are missing
Starting up database
Database file path: /home/media/.local/share/polaris/db.sqlite
Mounting API on /api
Beginning library index update
Mounting static files on /
Starting up server
Starting up UI (headless)
Skipping DDNS update because credentials are missing
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /checkout/src/libcore/option.rs:335:21
note: Run with `RUST_BACKTRACE=1` for a backtrace.
My media is on a NAS, and I've tried everything. Accessing it through a UNC path on both windows and linux, Mounting it as a network drive on windows, mounting it into a folder using CIFS on linux. I'm totally out of ideas.
PS. I know the NAS is accessible because emby can see it using any of the above methods on the exact same computer.
is there a reason for songs not having them? if not I can submit a PR in the next couple days adding them to the formats that support them (from what i see both id3
and metaflac
have support=
cheers :)
rust-openssl 0.9
doesn't work with openssl 1.1+
. could you please upgrade it to 0.10+
so it works on debian sid
?
related issue: sfackler/rust-openssl#987
There is currently no way to tell how the API works other than reading the api.rs source file. What needs documentation:
Hello again. I recently had to start from scratch with Polaris again and it wouldn't build on Linux this time around even though it had built successfully on the same hardware a couple months back. Here's why:
This change to Rust created a regression in Pear (a Rocket subdependency), but thankfully a bugfix has been released. After following the directions in the above PR to take advantage of the bugfix, the build succeeded.
Basically, we need to update Pear to its latest version in the Cargo.lock
file for Polaris to successfully build with Rust Nightly.
Something like cargo update -p pear && cargo update
should do it, then we can put up a PR with the Cargo file changes.
Would you like to handle this, or for me to put up a PR?
rwf2/Rocket#965 has now been fixed, we can use the nicer static files serving API in Rocket.
We should do a new release of Polaris since it currently does not compile with the latest rust compiler and rocket being in version 0.4.0.
id3 with some mp3 files panics due an unwrap() that has since been removed
0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:69
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/backtrace.rs:58
at src/libstd/panicking.rs:381
3: std::panicking::default_hook
at src/libstd/panicking.rs:397
4: std::panicking::begin_panic
at src/libstd/panicking.rs:577
5: std::panicking::begin_panic
at src/libstd/panicking.rs:538
6: std::panicking::try::do_call
at src/libstd/panicking.rs:522
7: std::panicking::try::do_call
at src/libstd/panicking.rs:498
8: <core::ops::range::Range<Idx> as core::fmt::Debug>::fmt
at src/libcore/panicking.rs:71
9: <core::ops::range::Range<Idx> as core::fmt::Debug>::fmt
at src/libcore/panicking.rs:51
10: <core::option::Option<T>>::unwrap
at /Users/travis/build/rust-lang/rust/src/libcore/macros.rs:20
11: <core::iter::TakeWhile<I, P> as core::iter::iterator::Iterator>::size_hint
at /Users/jxs/.cargo/registry/src/github.com-1ecc6299db9ec823/id3-0.2.0/src/frame/mod.rs:76
12: id3::stream::frame::v2::decode
at /Users/jxs/.cargo/registry/src/github.com-1ecc6299db9ec823/id3-0.2.0/src/stream/frame/v2.rs:22
13: id3::stream::frame::decode
at /Users/jxs/.cargo/registry/src/github.com-1ecc6299db9ec823/id3-0.2.0/src/stream/frame/mod.rs:16
14: id3::stream::tag::decode
at /Users/jxs/.cargo/registry/src/github.com-1ecc6299db9ec823/id3-0.2.0/src/stream/tag.rs:76
15: id3::tag::Tag::read_from
at /Users/jxs/.cargo/registry/src/github.com-1ecc6299db9ec823/id3-0.2.0/src/tag.rs:1359
16: id3::tag::Tag::read_from_path
at /Users/jxs/.cargo/registry/src/github.com-1ecc6299db9ec823/id3-0.2.0/src/tag.rs:1365
17: polaris::metadata::read_id3
at src/metadata.rs:36
18: polaris::metadata::read
at src/metadata.rs:28
19: polaris::index::IndexBuilder::populate_directory
at src/index.rs:223
20: polaris::index::IndexBuilder::populate_directory
at src/index.rs:289
21: polaris::index::populate
at src/index.rs:373
22: polaris::index::update
at src/index.rs:386
23: polaris::index::update_loop
at src/index.rs:415
24: polaris::run::{{closure}}
at src/main.rs:179
I tried to update id3 to version 0.2.2
but due to it using a newer byteorder
version (1.1.0) cargo refuses to compile with:
error: failed to select a version for `byteorder` (required by `id3`):
all possible versions conflict with previously selected versions of `byteorder`
version 1.0.0 in use by byteorder v1.0.0
version 0.4.2 in use by byteorder v0.4.2
possible versions to select: 1.1.0
rust-ape
uses version 0.4.2
so I tried to update rust-ape to byteorder 1.0.0
and depend on that rust-ape version, but i get a similar error:
error: failed to select a version for `byteorder` (required by `id3`):
all possible versions conflict with previously selected versions of `byteorder`
version 1.0.0 in use by byteorder v1.0.0
version 1.0.0 in use by byteorder v1.0.0
possible versions to select: 1.1.0
Do you have any idea on how to solve this?
meanwhile ring
also started to give conflicts due to also having multiple versions being used, I was able to solve that by updating the main ring dependency, i will make a PR with those updates
thanks
In Linux, doing cargo build --release
I have the following error.
Compiling simplelog v0.5.2
Compiling error-chain v0.12.0
Compiling tokio-threadpool v0.1.7
Compiling rusqlite v0.14.0
error[E0658]: use of unstable library feature 'duration_extras' (see issue #46507)
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/rusqlite-0.14.0/src/busy.rs:26:49
|
26 | .and_then(|t| t.checked_add(timeout.subsec_millis().into()))
| ^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.
error: Could not compile `rusqlite`.
warning: build failed, waiting for other jobs to finish...
error: build failed
I'm using cargo version 1.26.0
Just testing this, seems the cookie still works even when a user is deleted.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.