From 8ff7acfc38207883f1df655113f4f22598e88748 Mon Sep 17 00:00:00 2001 From: krateng Date: Tue, 5 Apr 2022 05:48:23 +0200 Subject: [PATCH] Readme and minor fixes --- README.md | 9 +++++---- maloja/database/sqldb.py | 3 ++- maloja/proccontrol/tasks/import_scrobbles.py | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f90742f..465b420 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ You can check [my own Maloja page](https://maloja.krateng.ch) to see what it loo * [Requirements](#requirements) * [PyPI](#pypi) * [From Source](#from-source) - * [Docker](#docker) + * [Docker / Podman](#docker-podman) * [Extras](#extras) * [How to use](#how-to-use) * [Basic control](#basic-control) @@ -84,9 +84,9 @@ Then install all the requirements and build the package, e.g.: pip install . ``` -### Docker +### Docker / Podman -Pull the [latest image](https://hub.docker.com/r/krateng/maloja) or check out the repository and use the included Dockerfile. +Pull the [latest image](https://hub.docker.com/r/krateng/maloja) or check out the repository and use the included Containerfile. Of note are these settings which should be passed as environmental variables to the container: @@ -94,7 +94,7 @@ Of note are these settings which should be passed as environmental variables to * Mount a [volume](https://docs.docker.com/engine/reference/builder/#volume) to the specified directory to access these files outside the container (and to make them persistent) * `MALOJA_FORCE_PASSWORD` -- Set an admin password for maloja -You must publish a port on your host machine to bind to the container's web port (default 42010). The Docker version uses IPv4 per default. +You must publish a port on your host machine to bind to the container's web port (default 42010). The container uses IPv4 per default. An example of a minimum run configuration to access maloja via `localhost:42010`: @@ -141,6 +141,7 @@ If you would like to import your previous scrobbles, use the command `maloja imp * a Last.fm export generated by [benfoxall's website](https://benjaminbenben.com/lastfm-to-csv/) ([GitHub page](https://github.com/benfoxall/lastfm-to-csv)) * an official [Spotify data export file](https://www.spotify.com/us/account/privacy/) +* the export of another Maloja instance To backup your data, run `maloja backup`, optional with `--include_images`. diff --git a/maloja/database/sqldb.py b/maloja/database/sqldb.py index 974b73a..3be437d 100644 --- a/maloja/database/sqldb.py +++ b/maloja/database/sqldb.py @@ -48,7 +48,8 @@ DB['trackartists'] = sql.Table( 'trackartists', meta, sql.Column('id',sql.Integer,primary_key=True), sql.Column('artist_id',sql.Integer,sql.ForeignKey('artists.id')), - sql.Column('track_id',sql.Integer,sql.ForeignKey('tracks.id')) + sql.Column('track_id',sql.Integer,sql.ForeignKey('tracks.id')), + sql.UniqueConstraint('artist_id', 'track_id') ) DB['associated_artists'] = sql.Table( diff --git a/maloja/proccontrol/tasks/import_scrobbles.py b/maloja/proccontrol/tasks/import_scrobbles.py index b706ad6..2b4e92a 100644 --- a/maloja/proccontrol/tasks/import_scrobbles.py +++ b/maloja/proccontrol/tasks/import_scrobbles.py @@ -14,7 +14,7 @@ outputs = { "UNCERTAIN_IMPORT": lambda msg: print(col['orange'](msg)), #"CONFIDENT_SKIP": lambda msg: print(col['ffcba4'](msg)), "CONFIDENT_SKIP": lambda msg: None, - "UNCERTAIN_SKIP": lambda msg: print(col['orange'](msg)), + "UNCERTAIN_SKIP": lambda msg: print(col['indianred'](msg)), "FAIL": lambda msg: print(col['red'](msg)), } @@ -102,7 +102,7 @@ def import_scrobbles(inputf): msg = f"Skipped {result['CONFIDENT_SKIP'] + result['UNCERTAIN_SKIP']} scrobbles" if result['UNCERTAIN_SKIP'] > 0: - warningmsg = col['orange'](f"{result['UNCERTAIN_SKIP']} Warning{'s' if result['UNCERTAIN_SKIP'] != 1 else ''}!") + warningmsg = col['indianred'](f"{result['UNCERTAIN_SKIP']} Warning{'s' if result['UNCERTAIN_SKIP'] != 1 else ''}!") msg += f" ({warningmsg})" print(msg)