Skip to content

Commit 5e905ea

Browse files
committed
Merge branch 'develop'
2 parents 7b0f580 + 7ebe73c commit 5e905ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1091
-276
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ config/*.json
1212
config/*.bak
1313
/docs
1414
/logs
15+
.flatpak-builder
16+
flatpak/generated-sources.json
17+
flatpak/.flatpak-builder

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,5 @@ src/**/**.js
125125
src/**/**.js.map
126126

127127
*.bak
128+
.flatpak-builder
129+
flatpak/generated-sources.json

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
55
[![Docker Pulls](https://img.shields.io/docker/pulls/foxxmd/multi-scrobbler)](https://hub.docker.com/r/foxxmd/multi-scrobbler)
66

7+
<img src="/assets/icon.png" align="right"
8+
alt="multi-scrobbler logo" width="180" height="180">
9+
710
A javascript app to scrobble music you listened to, to [Maloja](https://github.com/krateng/maloja), [Last.fm](https://www.last.fm), and [ListenBrainz](https://listenbrainz.org)
811

912
* Supports scrobbling from many **Sources**
@@ -28,7 +31,7 @@ A javascript app to scrobble music you listened to, to [Maloja](https://github.c
2831
* Web server interface for stats, basic control, and detailed logs
2932
* Smart handling of credentials (persistent, authorization through app)
3033
* Easy configuration through ENVs or JSON
31-
* Docker images for x86/ARM
34+
* Install using [Docker images for x86/ARM](/docs/installation.md#docker), [flatpak](/docs/installation.md#flatpak), or [locally with NodeJS](/docs/installation.md#nodejs)
3235

3336
**Why should I use this over a browser extension and/or mobile app scrobbler?**
3437

assets/icon.png

4.21 KB
Loading

assets/icon.svg

Lines changed: 12 additions & 0 deletions
Loading

docs/installation.md

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# Installation
22

3-
## Local
3+
# Local
4+
5+
After installation see [service.md](/docs/service.md) to configure multi-scrobbler to run automatically in the background.
6+
7+
## Nodejs
48

59
Clone this repository somewhere and then install from the working directory
610

7-
```bash
11+
```shell
812
git clone https://github.com/FoxxMD/multi-scrobbler.git .
913
cd multi-scrobbler
1014
nvm use # optional, to set correct Node version
@@ -13,23 +17,49 @@ npm build
1317
npm start
1418
```
1519

16-
### Local Usage Examples
20+
### Usage Examples
1721

1822
* The web UI is served on port `9078`. This can be modified using the `PORT` environmental variable.
1923

2024
#### Using [file-based](/docs/configuration.md#file-based-configuration) configuration
2125

22-
```bash
26+
```shell
2327
npm start
2428
```
2529

2630
#### Using [env-based](/docs/configuration.md#env-based-configuration) configuration
2731

28-
```bash
32+
```shell
2933
SPOTIFY_CLIENT_ID=yourId SPOTIFY_CLIENT_SECRET=yourSecret MALOJA_URL="http://domain.tld" node src/index.js
3034
```
3135

32-
## [Docker](https://hub.docker.com/r/foxxmd/multi-scrobbler)
36+
## Flatpak
37+
38+
You must have [Flatpak](https://flatpak.org/) installed on your system.
39+
40+
```shell
41+
flatpak install flathub io.github.foxxmd.multiscrobbler
42+
```
43+
44+
### Usage Examples
45+
46+
#### Using [file-based](/docs/configuration.md#file-based-configuration) configuration
47+
48+
The config directory for multi-scrobbler as a flatpak can be found under `/home/YourUser/.var/app/io.github.foxxmd.multiscrobbler/config`
49+
50+
```shell
51+
flatpak run io.github.multiscrobbler
52+
```
53+
54+
#### Using [env-based](/docs/configuration.md#env-based-configuration) configuration
55+
56+
There are a few [options for running flatpak applications with temporary or permanent environmental variables.](https://ardasevinc.dev/launch-flatpak-apps-with-custom-args-and-environment-variables)
57+
58+
```shell
59+
flatpak run --env=SPOTIFY_CLIENT_ID=yourId --envSPOTIFY_CLIENT_SECRET=yourSecret --env=MALOJA_URL="http://domain.tld" io.github.foxxmd.multiscrobbler
60+
```
61+
62+
# [Docker](https://hub.docker.com/r/foxxmd/multi-scrobbler)
3363

3464
Cross-platform images are built for x86 (Intel/AMD) and ARM (IE Raspberry Pi)
3565

@@ -65,15 +95,15 @@ To get the UID and GID for the current user run these commands from a terminal:
6595
* `id -u` -- prints UID
6696
* `id -g` -- prints GID
6797

68-
### Docker Usage Examples
98+
## Docker Usage Examples
6999

70-
#### Using [env-based](/docs/configuration.md#env-based-configuration) configuration
100+
### Using [env-based](/docs/configuration.md#env-based-configuration) configuration
71101

72102
```bash
73103
docker run -e "SPOTIFY_CLIENT_ID=yourId" -e "SPOTIFY_CLIENT_SECRET=yourSecret" -e "MALOJA_URL=http://domain.tld" -e "MALOJA_API_KEY=1234" -e "PUID=1000" -e "PGID=1000" -p 9078:9078 -v /path/on/host/config:/config foxxmd/multi-scrobbler
74104
```
75105

76-
#### Using [file-based](/docs/configuration.md#file-based-configuration) configuration
106+
### Using [file-based](/docs/configuration.md#file-based-configuration) configuration
77107

78108
```bash
79109
docker run -e "PUID=1000" -e "PGID=1000" -p 9078:9078 -v /path/on/host/config:/config foxxmd/multi-scrobbler

docs/service.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
If you have multi-scrobbler installed [locally](/docs/installation.md#local) you can enable it to run as a background service when you login.
2+
3+
Before running as a service you should run it at least once in the foreground to ensure it can start up correctly!
4+
5+
# [Systemd](https://systemd.io/)
6+
7+
Systemd is system and service manager that is used by [most popular linux distros](https://en.wikipedia.org/wiki/Systemd#Adoption) including [Ubuntu](https://wiki.ubuntu.com/SystemdForUpstartUsers), [Fedora](https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/), Pop!_OS, [Debian](https://wiki.debian.org/systemd), and [Arch](https://wiki.archlinux.org/title/systemd).
8+
9+
This setup will create a [user service](https://wiki.archlinux.org/title/systemd/User) that runs on login.
10+
11+
## Create A Unit File
12+
13+
Create a new service file for multi-scrobbler under your HOME config:
14+
15+
```console
16+
mkdir -p ~/.config/systemd/user
17+
touch ~/.config/systemd/user/multi-scrobbler.service
18+
```
19+
20+
In a text editor add contents below to the file you created, `multi-scrobbler.service`:
21+
22+
```ini
23+
[Unit]
24+
Description=multi-scrobbler
25+
After=network.target
26+
27+
[Service]
28+
Type=simple
29+
ExecStart=flatpak run io.github.multiscrobbler
30+
Restart=no
31+
32+
[Install]
33+
WantedBy=default.target
34+
```
35+
36+
The above assumes you [installed multi-scrobbler using flatpak](/docs/installation.md#flatpak)
37+
38+
### Node.js Installs
39+
40+
If you are running multi-scrobbler directly with [nodejs from a clone repository directory](/docs/installation.md#nodejs) you should modify the `[Service]`:
41+
42+
```ini
43+
[Service]
44+
Type=simple
45+
WorkingDirectory=/path/to/multi-scrobbler/directory
46+
ExecStart=node src/index.js
47+
Restart=no
48+
```
49+
50+
## Start the Service
51+
52+
Save the file then run:
53+
54+
```console
55+
systemctl daemon-reload
56+
systemctl --user enable multi-scrobbler.service
57+
systemctl --user start multi-scrobbler.service
58+
```
59+
60+
This will
61+
62+
* scan for new services and pickup our multi-scrobbler user service
63+
* enable the service to run at login automatically
64+
* start the service now
65+
66+
# Other Service Methods
67+
68+
Open a PR if you would like to document setting up multi-scrobbler for other service managers!

flatpak/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
NOTE: This steps are for building the flatpak entirely locally, from source. If you want to install the application normally then [get it through flathub](/docs/installation.md#flatpak)
2+
3+
Flatpak build is a little convoluted until someone sets me straight...
4+
5+
# 1. Install Requirements
6+
7+
## Flatpak and flatpak-builder
8+
9+
Install [Flatpak](https://flatpak.org/setup/)
10+
11+
Install [flatpak-builder](https://docs.flatpak.org/en/latest/first-build.html#building-your-first-flatpak)
12+
13+
## [flatpak-node-generator](https://github.com/flatpak/flatpak-builder-tools/tree/master/node)
14+
15+
Requires python 3.7+, [pip](https://pip.pypa.io/en/stable/)/[pipx](https://pypa.github.io/pipx/)
16+
17+
# 2. Update Project source
18+
19+
Set the `branch` `tag` or `commit` to use for MS in the `git` source in [`io.github.foxxmd.multiscrobbler.yml`](/flatpak/io.github.foxxmd.multiscrobbler.yml)
20+
21+
# 3. Use `flatpak-node-generator` to generate sources
22+
23+
First, [make sure `node_modules` is deleted or empty.](https://github.com/flatpak/flatpak-builder-tools/issues/354#issuecomment-1478518442)
24+
25+
Then, from MS project root:
26+
27+
```
28+
flatpak-node-generator npm package-lock.json
29+
```
30+
31+
Move `generated-sources.json` into [`/flatpak`](/flatpak)
32+
33+
# 4. Build flatpak
34+
35+
From MS project root:
36+
37+
```console
38+
cd flatpak
39+
flatpak-builder --repo=/home/yourUser/multi-scrobbler-repo /home/yourUser/multi-scrobbler-build io.github.foxxmd.multiscrobbler.yml --force-clean
40+
```
41+
Add `--install --user` to have the app installed immediately.

flatpak/defaultConfig.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"logging": {
3+
"file": false
4+
}
5+
}

flatpak/icon.png

4.21 KB
Loading

0 commit comments

Comments
 (0)