Alistral: Power tools for Listenbrainz

For the past few months I have been working on upgrading Listenbrainz Cli Tools to use a SQLite database, and now that the (release) dust as settled, time for a community annoucement!

The caching system as been completely redone using SQLite, which brings better performance, less used disk space, and most importantly, easier development.

A new command has been introduced, which allows you to see what your favorite Monstercat releases of this year are, and have an easier time voting for this yearā€™s Best of 2024!
Note: Plenty of releases are missing from Musicbrainz still. So go add them/map your listens. The command checks for the labels ā€œMonstercatā€, ā€œMonstercat Instinctā€, ā€˜Monstercat Uncagedā€™ and " Monstercat Silk".

This command is under the ā€œunstableā€ command. Unstable commands are commands which are either buggy, unpolished, need user testing, or too hardcoded. The plan being to finish them later, while still letting users experiment with them.

Some things were changed during the migration:
- The work stats do not recurse anymore. Next update I plan to add a new command to restore the previous behaviour.
- The underrated radio has been temporary disabled, as listenbrainz is still broken, and updating it without testing will lead to bugs (and Iā€™m lazy. This update is long overdue already)
- The listen mapper wasnā€™t upgraded, as Iā€™m not still certain if Iā€™m keeping it or it will be replaced by another way to map listens.
- Importing data dumps is disabled due to the new importer not providing MBID mapping anymore.

Lastly, new name! Itā€™s more like it has a proper name nowā€¦

Iā€™ll try to only use one topic (this one) to bring updates on the app. So subscribe if you are interested

Github:

Latest release:

6 Likes

sounds interresting, would it maybe be possible to create a mac build?

Iā€™ll try. I do know I wanted to make one on the first release, but I got problems.
I havenā€™t retried since then, so Iā€™ll retry

Itā€™s done. The new release has the macos build.
For the others, not need to update. Thereā€™s nothing significant updated

1 Like

how do i run it?
(i have no idea what iā€™m doing)

I havenā€™t touched a mac in my life so not that sure if itā€™s possible but:

Open a terminal in the folder where you put the file, so if you put it into your download folder, right click, open in terminal(?).
Or you can open your terminal, put cd <full path of your folder>, aka something like cd /home/rustynova/download

Then you can simply use alitral by typing alistral-macos <command>

The list of commands are here, or you can add --help to get a list of commands

And tip: rename alistral-macos to alistral to make it shorter to type~

Oh and good luck. 140000 listens must be a lot of recording to fetchā€¦ And the app is limited to one recording/second. My puny 25k already takes an hour to get only the recordings

Release v0.3.3

New features:

  • listens remap-mbid: Remap all the listens mapped to an mbid to another.
  • daily: Show ā€œtoday in historyā€ for your listens, and first discoveries birthdays
  • Radios: You can now restrict the seed listens to a shorter period with the --seed-listen-range argument. This will only use seed listens from this period. There is also --min-seed-listens to keep a minimum of listens (default 3) from before the period if there is not enough

Changes:

  • lookup now refresh the recording. So if you know thereā€™s changes on the data, you can use lookup to refresh it
  • lookup: Overdue score is now from 0. 1 now means that the recording is overdue. Fixes weird behaviours with bumps

Builds are cooking and will be ready soon

4 Likes

Release v0.4.0

Changelog:

  • The cache now properly migrate between versions. This require to recreate the whole cache, so expect to be refetching everything.
  • Now more names are being linked to musicbrainz/listenbrainz pages, and colors have been added to make it easier to read and distinguish entity types.
  • lookup now shows the total time a recording has been listened, and its rank in the top listen counts, and the global number of listens
  • Fixed a bug where stats werenā€™t properly fetching recording data
  • Updated the URL in the radio playlists
  • Migrated the underrated radio! (Global stats seems to be broken again tooā€¦)

Most of the work has been on removing the old cache and musicbrainz clippy. More on the later here

3 Likes

Release v0.4.1

Changelog:

  • lookup: fixed overdue line getting offset
  • Renamed ā€œTime listenedā€ to ā€œTotal Playtimeā€
  • Removed the print of the database path on start

And forgotten from the previous changelog:

  • You can now sort stats by total playtime instead of listens (recording-playtime).
2 Likes

Release v0.4.2

Listens tools

Added listens wrong-mapping. This tool finds listens that have been submitted with a different name than the mapped recording. This can be useful to find listens mapped to te wrong recording.

Radios

Added --at-listening-time argument to the overdue radio. This force the score of the recording to be calculated after the previous track have been listened to, instead of the current time. This makes the radio a lot more accurate for long playlist, but may slow down the generation a lot

Future

As Brainzplayer might loose the ability to play youtube videos, the next major release will focus on youtube export of playlists / radio generation. It will probably come in january.

2 Likes

hi, thanks for your work, Itā€™s really useful. Is there a way to achieve something like a playlist that mixes songs listened to by 2 users? Something similar to Spotify Blend

Not yet, but I do plan to add some compatibility based radios. I just have an ever increasing backlog -_-ā€™

Might try to do it for the next release as I already got a way to get common recordings, but itā€™s not the priority RN

i think you can already do something like that with LB Radio.

if you use stats:
ā€œstats:volpit::weekā€ ā†’ will create a playlist with songs from your statistics from last week.

and you can add multiple things together:
ā€œstats:volpit::week stats:sanojjonas::weekā€ will create a playlist with songs that you played and songs that i played.

but i guess what you want is the songs that we both played and not a playlist with some songs from me and some songs from you

1 Like

It would also need to care about the amount of common listens. You donā€™t really want to listens to songs that you listened once and disliked it. It would be more of something youā€™ll both jam to.

I did work on it, and will be there next version, but I got severely distracted and tried remaking the whole radio generator and failed. Oops.

Release v0.4.3

Listenbrainz

Daily

  • You can now see the fresh releases of the last 7 days.

Stats:

  • Reimplemented the recursive work stats. This add the parent works of the listened works, so you can see the stats number of listens of the original works and/or the number of listens of a soundtrack.
    • Use alistral stats work-recursive
    • If the counts are way off, please run alistral cache refresh-data.

Radios

  • Radios now have a number after their name to disambiguate them.
  • Added shared radio. This generate a playlist of recordings both listened by the two provided users.

Config

  • Added the option to set the listenbrainz server url. Set listenbrainz_url in the config file to point to the new api (Should look like this: ā€œListenBrainzā€)

Cache

  • Added top level argument --no-cleanup to prevent cleanup between runs
  • Added cache refresh-data. This reload all the listened recordings

Musicbrainz:

No changes.


Builds are baking, and should be there soon. A new release should come in the next few days when the listenbrainz update and fixes the listen exports

2 Likes

Release v0.4.4

Fixes

  • Linux builds no longer require GLIBC 2.39 to run. If it ran prior to 0.4.3 then it should work now.
  • Re-added user export imports.
  • Fixed not being able to fetch a work with a GMR ID
1 Like

Release v0.5.0

This update is probably the second biggest refactor since 0.3.0, so watch out for regressions

Listenbrainz

Radios

You can now export your radios to Youtube. This require bringing your own api key. Set up can be found here

Config

You can now set a custom URL for the musicbrainz server.

Meta

Added a wiki at stats - Alistral Manual. This is pretty barebone right now, but will get improved as I go

Improved the logging, Progress bars should be a bit more stable now. A new verbosity flag as been added for debuging release builds

The app has been split into more library crates again, making parts more reusable.

  • alistral_core: The common utilities of the crates, and everything that doesnā€™t revolve around config and interface.
  • interzic: Translation layer for music apps and services. It query multiple providers to link tracks together, and if able to export playlists
  • tuillez: Utilities for the interface / logging

Others

Plans

Next update should bring a total refactor of the radios (again), to allow creating radios out of a few lines of json. This will allow sharing presets / creating your dream radio without learning to learn rust (Youā€™ll still need to learn the syntax, but itā€™s easier).

Iā€™ll continue to split the app more, notably to move musicbrainz clippy to its own library crate (symphonize), and radios as well (no name for now. I accept suggestions)

I wonā€™t add any new music services to interzic for now, as Listenbrainz already have Spotify and Apple Music covered. However I donā€™t mind helping if someone wants to help expand it.

Builds are roasting, and will be available soon

2 Likes

Release v0.5.1

Listenbrainz

Listens

  • Added manual listen submission. Useful when you listened to a track yet you canā€™t add it in LB due to it not being in MB. (This was not made out of spite. No sir). Usage: Help - Alistral Manual

Interzic

  • Added commands to interact with the interzic database
    • get-mapping: get the mapping of a track
    • reload: reload the mappings from Musicbrainz
    • reverse-mapping: find what MB recording is associated to this track
    • overwrite: overwrite a mapping for your user
2 Likes

Release v0.5.2

Small hotfix. Messed up the SQL indexes

Listenbrainz

Playlists

  • Added a playlist converter. This currently only send from LB to Youtube usage

Interzic

  • Fixed reload not working
3 Likes

Release v0.5.3

Listenbrainz

  • Fixed listen fetching timing out.
  • Fetching latest listens will now fetch up to 3 days before the last cached listen to refresh some mappings
  • Added listens reload to reload all the cached listens of an user

Meta

  • Updated ring to fix security vulnerabilities.
  • A lot of moving code around for v0.6.0
4 Likes