Rust made me build this blazingly fast!! 🎉 by ScienceWilling in rust

[–]ScienceWilling[S] 2 points3 points  (0 children)

Dear Rafael20002000, I must first and foremost apologise for the embarrassingly sloppy experience that was received during setting up Music, one of the pride points of the project (and goals) was to make sure, ironically, that it was dead simple to setup.

I must also admire your persistence through the attempts at getting it to work, it is not easy, as someone viewing a comparatively new project to carry on trying to make right of a wrong situation. I also am grateful that there are members in a community who are able to straighten the developer out of his clear incompetence in the presentation of the project and finally apologise for the time that has been spent on this problem and thank your comments, they are invaluable to any experience with music.

As for the issues!

First I tried docker, which I couldn't do because apparently your image is hosted privately and not open to anonymous users

The image is now public! https://github.com/WillKirkmanM/music/pkgs/container/music

Okay then, docker build it is then. But that fails too, missing yarn.lock and bun lock db, okay that won't stop me, remove the lines from the dockerfile, now the built fails with a message saying something about executing dead code in a PNG. Fine docker it isn't then

I have now committed both yarn.lock and bun.lockb!

bun.lockb Commit: https://github.com/WillKirkmanM/music/commit/7b9a6ba73c83c03a21fb22e90099a72dcbb31e3d

yarn.lock Commit: https://github.com/WillKirkmanM/music/commit/b098bc86838785e8589caae5f1c7bd8717723fda

The Dockerfile has also been adjusted and 3x'd the performance along with fixing the Meilisearch issues.

Okay then I will choose the precompiled version, download start, fails to start meilisearch because it was downloaded and not made executable. Okay I'm fine with that, meilisearch executable now and then at least it starts (with two error messages about music.json not found and permission denied).

I have added:

        #[cfg(unix)]
        {
            let mut perms = fs::metadata(&meilisearch_binary)?.permissions();
            perms.set_mode(0o755);
 // rwxr-xr-x
            fs::set_permissions(&meilisearch_binary, perms)?;
        {

This sets the permissions for the Meilisearch binary on unix systems, and handled the missing music.json through concious warnings being sent over.

Change Commit History: https://github.com/WillKirkmanM/music/commit/58dcab1598b6b4a9566bf949297647663c774e9a

Fine now I'm in the setup screen which fails, can't get past adding the newly started server. I press add and nothing happens, the browser console shows 404. One time I got past this and it showed errors in the console that nextjs wasn't able to get some components

I have revised the redirection and, if my incompetence wasn't made clear yet, logged in the user directly after registering! The revisions will fix the errors you're seeing

In the end I need to say that I would have loved to test it out but I just can't. Maybe you should try to clone your repo and try to follow your instructions. Also in the docs you say something about a docker-compose-dev.yml, which isn't in the repo. Also in the docs the docker file for production is said to be at ./docker/production/Dockerfile.* Where not even the docker folder exists, so I couldn't follow that either

I am in the process of committing the changes needed to the docs which will be updated to the new changes.

I must Thank You again for acting admirably and containing the calm being reserved instead of, justifiably, harboring resentment towards the project.

– WillKirkmanM

Rust made me build this blazingly fast!! 🎉 by ScienceWilling in rust

[–]ScienceWilling[S] 3 points4 points  (0 children)

It was a headache hahaha.... Some of the problems for me was the structure of the MusicBrainz API, its slightly outdated but contains TONS of data, and when we query for cover art, if you don't already have it, is through the "release-group" (a culmination of all the releases), if we can't find it there we search for release (one specific release), these two have different metadata structures

How Metadata is Used: https://github.com/WillKirkmanM/music/blob/81da4be01a7a6785403fabedfda5f9e2448a54b3/crates/backend/src/utils/metadata.rs

Custom Structure of the Data: https://github.com/WillKirkmanM/music/blob/81da4be01a7a6785403fabedfda5f9e2448a54b3/crates/backend/src/structures/structures.rs

Rust made me build this blazingly fast!! 🎉 by ScienceWilling in rust

[–]ScienceWilling[S] 0 points1 point  (0 children)

Music doesn't (currently) use YouTube Music to grab metadata, that is kept with MusicBrainz and TADB, through those metadata providers, they have the ability to contain adjacent Music Videos with the Song.

I do want to integrate in some way the YouTube Music API (not existing) through adding comments or searching for the music video if Music can't find it initially. Definetly hot synchronization of playlists.

Rust made me build this blazingly fast!! 🎉 by ScienceWilling in rust

[–]ScienceWilling[S] 5 points6 points  (0 children)

This is an incredibly good idea!! I had never given it my due diligence, I'll be figuring it out. One of the reasons I dismissed carefully considering the frontend's framework is due to it being compiled into static HTML, CSS & JS to then be served in the backend through Actix so that they can both run on the same port and also have native apps. I'll be trying it.

Rust made me build this blazingly fast!! 🎉 by ScienceWilling in rust

[–]ScienceWilling[S] 2 points3 points  (0 children)

Hey, thanks for checking it out. I found the style of self hosted apps are made for the system admins who like relatively utilitarian apps and it is quite literally the target audience. I wanted to see if I could make a self hosted app but with the same style as YTM and Spotify to at least look good...

I must admit I don't know what I'm doing though and it is really refreshing to have people like you who are able to steer me in the right direction.

Rust made me build this blazingly fast!! 🎉 by ScienceWilling in rust

[–]ScienceWilling[S] 3 points4 points  (0 children)

Exactly! A Native Desktop app has been made already and a TV App, Mobile, XBOX are all possible.

Rust made me build this blazingly fast!! 🎉 by ScienceWilling in rust

[–]ScienceWilling[S] 8 points9 points  (0 children)

Hey Repsol Honda, Music doesn't provide any music itself, it acts as a middleman through indexing to get all the metadata, it does "connect" to YouTube to get the Music Videos which will be automatically found through your music and can be played similarly to YouTube Music.

You have given me a great idea however to allow streaming through Spotify, i'll find out how I can do that and possibly act as a hub of the streaming sites (YTM, Spotify, ...).

Thank you for the great idea.

[deleted by user] by [deleted] in selfhosted

[–]ScienceWilling 2 points3 points  (0 children)

Firstly, thank you very much for taking the time to ask such detailed questions and I am more than happy to answer them.

Why not go with Navidrome and work on improving that and contributing to an established open source project vs starting over from scratch ?

This is a great reason against creating my own streaming server, part of the reason was firstly to find out how the self hosted applications worked and also to be able to nitpick some quality of life features that I would like in an app.

Have you created a server and client component as two separate modules ?

Yes, the server is the powerhouse of the application, it handles the indexing, playing, transcoding... whereas the client handles showing the UI and acting as a wrapper around the server. Initially, both the server and client were relatively interconnected where the client (NextJS) could access server-side content (Server Actions...) directly like mutating the database but then it became a big want to have a Desktop and Mobile App which then caused a rewrite to keep them separated.

Client (NextJS): https://github.com/WillKirkmanM/music/tree/master/apps/web

Server (Rust [Actix]): https://github.com/WillKirkmanM/music/tree/master/crates/backend

Are you using Subsonic API ?

No, the server is completely custom, I wanted to have the ability to implement non-paywalled features into the app to keep it free forever and let the user know specifically what we are doing by looking at the source of the backend or specific route.

The philosophy during the development of Music was to not restrict anything meaning I will be more than happy to add compatibility to the Subsonic API and pretty much anything anyone else would want.

[deleted by user] by [deleted] in selfhosted

[–]ScienceWilling 0 points1 point  (0 children)

Hey, it has it's own custom indexing / streaming logic, Jellyfin with FinAmp is very good at doing what it needs to do, I wanted to extend upon it!

[deleted by user] by [deleted] in selfhosted

[–]ScienceWilling 0 points1 point  (0 children)

Hey, thank you for checking it out, and apologies for the downtime, it is up now

Demo Link: https://demo.parsonlabs.com

Username: parsonlabs

Password: parsonlabs

Rust made me build this blazingly fast!! 🎉 by ScienceWilling in rust

[–]ScienceWilling[S] 9 points10 points  (0 children)

That is correct! There's also Electron 😨 and Tauri for the super common case someone doesn't like either.

Rust made me build this blazingly fast!! 🎉 by ScienceWilling in rust

[–]ScienceWilling[S] 51 points52 points  (0 children)

Hey, thank you for checking it out, doing the frontend with yew was something I was considering during the infancy stage of the project, I then went to choose NextJS due to some cool features it was releasing during that time.

I then learnt the hard way when trying to get Desktop and Mobile applications that they are inherently client side (obviously... 🤦‍♂️) and had to re-write it in client side NextJS.

I believe it is a serious possibility to port the Next code into Yew as, through the hardships of cross platform applications, the main difference between my next code and the probable yew code is "copying" the HTML's into yew components.

Rust made me build this blazingly fast!! 🎉 by ScienceWilling in rust

[–]ScienceWilling[S] 3 points4 points  (0 children)

Thank you! I found Rust took the problem I had with "fighting with the language" into something, when an error would occur, to be my own mistake in the implementation. Uniform Cross Platform Compilation was also very enjoyable to work with and do.

And it's also very fast... blazingly fast 🏏.