Roon wrapped?

every year spotify delivers millions of people their very own wrapped. a wrapped, if you’re not aware, is essentially a recap of your listening habits over the last year. i’m a diehard roon user but i always wanted something like that. anyway, this year i built my own for roon. i just wanted to show it off… i’ll probably keep updating it too. would anyone be interested in this?




3 Likes

I just use Lastfm as it covers my usage in LMS and Plexamp too and includes accurate recommendations of new artists to trial.
The stats themselves don’t interest me personally.

1 Like

yah, used lastfm many many years ago. i bet i could implement recommendations, that’s a great idea

1 Like

Yes, me. Do you have a GitHub page?

1 Like

Yep I would be, is it configurable to show different time periods?

just published it earlier: GitHub - jeffweisbein/roon-wrapped: A Spotify Wrapped alternative for Roon

1 Like

just published earlier. it currently just shows one view (2025) but i’ll probably break out different time periods at some point.

2 Likes

@Jeff_Weisbein

Hello Jeff, I have a little problem:

zabodarski@plitvice:~/Projects/roon-wrapped$ node --version
v18.19.1
zabodarski@plitvice:~/Projects/roon-wrapped$ 

Prerequisites

  • :white_check_mark: Node.js 18.0.0 or later
  • :white_check_mark: A running Roon Core on your network
  • :white_check_mark: Roon extension enabled

hey dirk,

This error indicates that Next.js can’t find the @/components/ui/button module, which is typically a Shadcn UI component. To resolve this, you would need to:

  1. Install Shadcn UI and its button component by running these commands in your terminal:

npx shadcn-ui@latest init

Then after the initialization:

npx shadcn-ui@latest add button

This will:

  • Set up the necessary Shadcn UI configuration

  • Create the button component at components/ui/button.tsx

  • Add required dependencies to your project

The error is occurring because you’re trying to import a component that hasn’t been added to your project yet. Shadcn UI components need to be explicitly added to your project before they can be used, as they follow a copy-and-paste installation approach rather than being imported from a package.

hope that helps

@Jeff_Weisbein

Hello Jeff, thanks for your answer.
I have to admit that I struggled a bit because I’m not very comfortable with all this, but I managed to make your extension work.
The commands you gave me didn’t work as is but thanks to a readme and a little searching, it worked.
I don’t know if everything is useful, but here’s what I did:

zabodarski@plitvice:~/roon-wrapped$ npx node_modules/@shadcn/ui
Usage: @shadcn/ui [options] [command]

Add @shadcn/ui components to your project

Options:
  -v, --version   display the version number
  -h, --help      display help for command

Commands:
  add             add components to your project
  help [command]  display help for command
zabodarski@plitvice:~/roon-wrapped$ npx node_modules/@shadcn/ui add button
Running the following command will overwrite existing files.
Make sure you have committed your changes before proceeding.

✔ Which component(s) would you like to add? › button
✔ Where would you like to install the component(s)? … ./components/ui
Installing components...
✔ button

I don’t know if it’s possible, but for a stable version, you can contact Jan Koudijs to integrate your extension under his Roon Extension Manager.
Anyway, thanks for your work. dp

Edit: I forgot this point. I don’t know if there is not a small problem with cleaning the history. It destroys files that should not be it seems to me. Maybe I am not placed in the right directory to launch the server.

the history cleanup shouldn’t be removing anything that it needs. i know i also have it set to clean up old listening-history.json backups.

glad you got it working! would love to see a screenshot of your wrapped if you’re willing to share :slight_smile:

The script ~/roon-wrapped/scripts/cleanup-history.sh runs in the directory ~/roon-wrapped . It destroys all the files that are there.
To avoid this, I modified it:


Here are the logs produced by this script modified last night:

Found 36 backups, keeping newest 3
Deleting old backup: tailwind.config.ts
Deleting old backup: tsconfig.json
Deleting old backup: config.json
Deleting old backup: ecosystem.config.js
Deleting old backup: jsconfig.json
Deleting old backup: next.config.js
Deleting old backup: package.json
Deleting old backup: postcss.config.js
Deleting old backup: roon-wrapped.service
Deleting old backup: server.js
Deleting old backup: setup-service.sh
Deleting old backup: start-all.sh
Deleting old backup: start-frontend.sh
Deleting old backup: start-minimal.sh
Deleting old backup: start-server.sh
Deleting old backup: com.cackles.roon-wrapped-frontend.plist
Deleting old backup: com.cackles.roon-wrapped.plist
Deleting old backup: com.cackles.roon-wrapped-server.plist
Deleting old backup: components.json
Deleting old backup: com.roonwrapped.plist
Deleting old backup: LICENSE
Deleting old backup: README.md
Deleting old backup: yarn.lock
Deleting old backup: package-lock.json
Deleting old backup: node_modules
Deleting old backup: data
Deleting old backup: types
Deleting old backup: src
Deleting old backup: server
Deleting old backup: scripts
Deleting old backup: lib
Deleting old backup: components
Deleting old backup: app

Remaining backups:

Edit: I think I figured it out. I think the problem is that I don’t have any data/listening-history.json.* files.


1 Like

very, very cool!! if you have ideas for improvements, lemme know

What would be good on the interface side is to be able to filter by zone since this information is in the data.

  {
    "title": "The watcher",
    "artist": "Saqqarah",
    "album": "The runaway",
    "image_key": "eff9672ebc85ae9d37fc67ad13b0129c",
    "duration": 585,
    "zone": "Jardin",
    "timestamp": 1737446399441
  },

It would be nice to be able to do this per user as well, but unless I’m mistaken it’s not available in the Roon API.

Thx, dp

ya, nice idea! will think about it :slight_smile:

maybe like this?

1 Like

Yes, like that. Great ! :star_struck:


I tried to install this version but got several errors.
First with npm install:

> roon-wrapped@0.1.0 postinstall
> npm run setup && npm run validate:env
> roon-wrapped@0.1.0 setup
> ./scripts/setup.sh
./scripts/setup.sh: line 13: syntax error near unexpected token `}'
./scripts/setup.sh: line 13: `    }'
npm ERR! code 2
npm ERR! path /home/zabodarski/roon-wrapped.2
npm ERR! command failed
npm ERR! command sh -c npm run setup && npm run validate:env
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/zabodarski/.npm/_logs/2025-01-25T13_55_52_197Z-debug-0.log

I fixed the ./scripts/setup.sh at line 13. I ran npm install again, and I got the following error:

> roon-wrapped@0.1.0 postinstall
> npm run setup && npm run validate:env
> roon-wrapped@0.1.0 setup
> ./scripts/setup.sh
Setting up directory structure...
Creating empty listening history file...
Validating listening history file...
JSON structure is valid.
Setup complete! Directory structure:
data
├── backups
└── listening-history.json
> roon-wrapped@0.1.0 validate:env
> node scripts/check-env.js
❌ No .env or .env.example file found!
npm ERR! code 1
npm ERR! path /home/zabodarski/roon-wrapped.2
npm ERR! command failed
npm ERR! command sh -c npm run setup && npm run validate:env
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/zabodarski/.npm/_logs/2025-01-25T14_01_44_322Z-debug-0.log

To get this new version to work, I tried a bit of DIY. I looked at the modified and added source files, and updated only those.

…and it worked!

Thanks again for your work. dp

1 Like

@Jeff_Weisbein

Hello Jeff,
I’ve been playing with your program for 10 days now. I’m very happy with it.
That said, I think it will be necessary to introduce the time factor into the statistical queries.
Indeed, after 10 days if we have listened to the same albums several times, the display does not move much anymore.
The unit listens are masked by the multiple listens.
I got out of it by manipulating the listening-history.json file
I wrote a small piece of program to divide this file by date to have more detailed statistics.
And when I want to group all the data, I use the following jq command:

jq -s '[.[][]] | sort_by(.timestamp) | unique_by(.timestamp) | reverse' ./history/*.json > ./listening-history.json

dp

hey!! thanks so much for using it and your ideas! i agree with you, should add some time period capabilities.

also i’ve been working on a few smaller updates/improvements which i haven’t pushed yet