From: kaliko Date: Tue, 19 Mar 2019 13:14:41 +0000 (+0100) Subject: Releasing 0.15.0 X-Git-Tag: 0.15.0 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=dc148034c495f0fb68ed0549d50ecb212e4c1783;p=mpd-sima.git Releasing 0.15.0 --- diff --git a/data/man/info.xml b/data/man/info.xml index dd53341..61b84c4 100644 --- a/data/man/info.xml +++ b/data/man/info.xml @@ -33,6 +33,8 @@ 2015 2016 2017 + 2018 + 2019 &dhusername; diff --git a/data/man/mpd-sima.1 b/data/man/mpd-sima.1 index 334c6bf..549dbcf 100644 --- a/data/man/mpd-sima.1 +++ b/data/man/mpd-sima.1 @@ -2,12 +2,12 @@ .\" Title: mpd-sima .\" Author: Jack Kaliko .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/21/2017 +.\" Date: 03/19/2019 .\" Manual: mpd-sima 0.15.0 User Manual .\" Source: mpd-sima .\" Language: English .\" -.TH "MPD\-SIMA" "1" "11/21/2017" "mpd-sima" "mpd-sima 0.15.0 User Manual" +.TH "MPD\-SIMA" "1" "03/19/2019" "mpd-sima" "mpd-sima 0.15.0 User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -303,7 +303,7 @@ Wrote this man page and is currently leading MPD_sima project\&. .RE .SH "COPYRIGHT" .br -Copyright \(co 2009-2017 Jack Kaliko +Copyright \(co 2009-2019 Jack Kaliko .br .PP This manual page was written for the Debian system (and may be used by others)\&. diff --git a/data/man/mpd_sima.1.html b/data/man/mpd_sima.1.html new file mode 100644 index 0000000..18c6329 --- /dev/null +++ b/data/man/mpd_sima.1.html @@ -0,0 +1,39 @@ +mpd-sima

Name

mpd-sima — mpd-sima will try to maintain some titles ahead in the queue following different policies.

Synopsis

mpd-sima [--daemon] [--config=conf_file] [--var-dir=var_directory] [--pid=pid_file] [--log=log_file] [--log-level=log_level] [--host=mpd_host] [--mpd_port=mpd_port]

mpd-sima --create-db [--var-dir=var_directory]

mpd-sima --generate-config []

mpd-sima { + { -h | --help } + --version + }

DESCRIPTION

This manual page documents briefly the + mpd-sima commands.

At start up default configuration is first overridden by user + configuration in mpd_sima.cfg (see the section called “FILES”) and finally + command lines options are honored. For instance you can override + default MPD_HOST set in defaults (localhost) or in your configuration + file with -S my_mpd_server option. For default + configuration see the section called “CONFIGURATION”. See also environment + variables special case for MPD host and port in the section called “ENVIRONMENT”. +

EXAMPLE

Launch as a system service (dæmon).

Here follows an example on how to launch mpd-sima as a service on your system, not attach to regular user configuration/database.

mpd-sima --daemon --conf=/etc/mpd_sima.cfg --var-dir=/var/cache/mpd-sima/ --pid=/run/mpd-sima.pid --log=/var/log/mpd-sima.log

Launch in user land

Launching mpd-sima from/whithin your user account is easy, you can simply call mpd-sima from your shell or one of the following command:

Background execution (dæmonise), log in the specified file, save pid:

mpd-sima --daemon --pid=$HOME/var/run/mpd-sima.pid --log=$HOME/var/log/mpd-sima.log

Foreground execution, connect my.mpd.server.org, log to std(out|err):

mpd-sima --host=my.mpd.server.org

OPTIONS

The program follows the usual GNU command line syntax, + with long options starting with two dashes (`-'). A summary of + options is included below.

-h, --help

Print help and exit.

--version

Print version and exit.

--daemon

Start as a daemon. Log redirected to /dev/null, usually setting --log and --pid options in daemon mode are a good idea to monitor/stop the process.

-p pid_file, --pid=pid_file

Use the specific file pid_file to store pid to.
Default is not to store pid info.

-l log_file, --log=log_file

Use the specific file log_file to log messages to.
Default is to log to stdout/stderr.

-v log_level, --log-level=log_level

Verbosity in [debug,info,warning,error].
Default is to log info messages.

-c conf_file, --config=conf_file

Use the specific file conf_file to set up + configuration instead of looking for the default user + configuration file.
Default is to look for + $XDG_CONFIG_HOME/mpd_sima/mpd_sima.cfg.
+ CLI option overrides any equivalent mentioned in configuration file, ie. launching mpd-sima with '--port' CLI option will ignore port setting in configuration file.
+ For more details on configuration file cf. + mpd_sima.cfg(5), see also the section called “FILES”.
+

--var-dir=var_directory

Use the specific path var_directory to look for (or create) var files (ie. database) instead of looking at the default user data location.
Default is to look in $XDG_DATA_HOME/mpd_sima/. Concerning $XDG_DATA_HOME see also the section called “FILES”

--generate-config

Generate a sample configuration file according to the current configuration. You can put other options with this one to get them in the generated configuration.

--create-db

Create the database and exit. Uses folder specified with --var-dir or default directory.
Default is to use $XDG_DATA_HOME/mpd_sima/. Concerning $XDG_DATA_HOME see also the section called “FILES”

-S mpd_host, --host=mpd_host

Use the specific host mpd_host as MPD server.
mpd_host can be an IP or a fully qualified domain name as long as your system can resolve it. This overrides MPD_HOST environment variable.
Default is localhost.

See also the section called “ENVIRONMENT”.

-P mpd_port, --port=mpd_port

Use the specific port number mpd_port on MPD server. This overrides MPD_PORT environment variable.
Default is 6600.

See also the section called “ENVIRONMENT”

FILES

${XDG_CONFIG_HOME}/mpd_sima/mpd_sima.cfg

Configuration file.

${XDG_DATA_HOME}/mpd_sima/sima.db

SQLite DB file.

${XDG_DATA_HOME}/mpd_sima/WEB_SERVICE/

Persistent http cache.

Usually XDG_DATA_HOME is set to + ${HOME}/.local/share and XDG_CONFIG_HOME to + ${HOME}/.config.
You may override them using + command line option --var-dir and --config (cf. + mpd-sima(1))

ENVIRONMENT

MPD_HOST, MPD_PORT

mpd-sima will look for MPD_HOST and + MPD_PORT to override built-in configuration + (set to "localhost:6600").

mpd-sima expects MPD_HOST syntax as documented in mpc manual, + cf. mpc(1). +
To use a password, provide a value of the form "password@host". +

HTTP_PROXY, HTTPS_PROXY

mpd-sima honors HTTP_PROXY environment variables.

CONFIGURATION

mpd_sima.cfg

mpd_sima.cfg is read if present. + Otherwise built-in defaults are used. An example should be + provided in the tarball within + doc/examples/. On Debian + system please look in + /usr/share/doc/mpd-sima.

DEFAULTS

Default is to look for MPD server at localhost:6600 (or MPD_HOST/MPD_PORT env. var. if set).

The get the defaults as detected by mpd-sima on your system you can run mpd-sima to print the config:

mpd-sima --generate-config

For details about mpd_sima.cfg refer to the manual + mpd_sima.cfg(5) +

FEEDBACK/BUGS

The maintainer would be more than happy to ear from you, don't hesitate to send feedback, http://kaliko.me/id/.

XMPP users are welcome to join the dedicated chat room at kaliko.me@conf.azylum.org.

SEE ALSO

mpc(1), mpd(1)

+ /usr/share/doc/mpd-sima/ +

diff --git a/data/man/mpd_sima.cfg.5 b/data/man/mpd_sima.cfg.5 index 3f24b61..2294468 100644 --- a/data/man/mpd_sima.cfg.5 +++ b/data/man/mpd_sima.cfg.5 @@ -2,12 +2,12 @@ .\" Title: mpd_sima.cfg .\" Author: Jack Kaliko .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 08/29/2018 +.\" Date: 03/19/2019 .\" Manual: mpd-sima 0.15.0 User Manual .\" Source: mpd-sima .\" Language: English .\" -.TH "MPD_SIMA\&.CFG" "5" "08/29/2018" "mpd-sima" "mpd-sima 0.15.0 User Manual" +.TH "MPD_SIMA\&.CFG" "5" "03/19/2019" "mpd-sima" "mpd-sima 0.15.0 User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -459,7 +459,7 @@ Wrote this man page and is currently leading MPD_sima project\&. .RE .SH "COPYRIGHT" .br -Copyright \(co 2009-2017 Jack Kaliko +Copyright \(co 2009-2019 Jack Kaliko .br .PP This manual page was written for the Debian system (and may be used by others)\&. diff --git a/data/man/mpd_sima.cfg.5.html b/data/man/mpd_sima.cfg.5.html new file mode 100644 index 0000000..5956e65 --- /dev/null +++ b/data/man/mpd_sima.cfg.5.html @@ -0,0 +1,128 @@ +mpd_sima.cfg

Name

mpd_sima.cfg — mpd-sima will try to maintain some titles ahead in the queue + following different policies. This manual document the + configuration file for mpd-sima.

DESCRIPTION

This manual page documents briefly mpd-sima + configuration options available in user configuration file + (see the section called “FILES”).

EXAMPLES

Album queue mode.

Here is an example of album queue configuration.

[MPD]
+host=example.org
+port=8000
+
+[sima]
+history_duration=48  # 2 days
+queue_length=5
+
+[lastfm]
+queue_mode=album
+album_to_add=2
+
+[crop]
+# keep 30 played tracks in playlist
+consume=30
+
+            

Configuration file

The configuration file consists of sections, led by a + [section] header and followed by name: value + entries, with continuations in the style of RFC 822 (see section + 3.1.1, “LONG HEADER FIELDS”); name=value is also accepted. Lines + beginning with '#' or ';' + are ignored and may be used to provide comments (Nota + Bene: inline comment are possible using '#').

The default values are used in the options lists below.

MPD section

This section is meant to configure MPD access, MPD host + address / port and password if necessary.

[MPD]
host=localhost

Set MPD host. Use IP or FQDN.

port=6600

Set host port to access MPD to.

password=s3cr3t

Set MPD password to use. Do not use this option + if you don't have enabled password protected access + on your MPD server.

log section

Configure logging.

[log]

logfile=

File to log to, usually in dæmon mode.
Defaut + (empty or unset) is to log to stdin/stdout.

verbosity=info

Logging verbosity among + debug, + info, + warning, + error.

Process daemonization

Configure process daemon.

[daemon]

daemon=false

whether to daemonize process or not.

pidfile=

Where to store process ID.

sima section

Core mpd_sima.cfg configuration.

contrib=

internal=Lastfm, Random, Crop

mpd-sima's plugin management for internal source plugin + and contrib (ie. external plugins).
Plugins list is a + comma separated string list.
Optional plugin's + configuration lays in its own section.
For instance a + "AwesomePlugin" declared here gets its configuration from the + corresponding section "[awesomeplugin]". +

The default list of plugins to load at startup: Lastfm,Random,Crop.
+ Crop is an utility plugin, it does not queue any tracks (cf. below).
+ Random will queue a track at random if other plugins did not return any tracks.
+

You can add here as many plugins you want, + currently shipping Lastfm only.
+ The priority may be used to order them. +

history_duration=8

How far to look back in history to avoid to play + twice the same track/title (duration in + hours).
+ The history_duration is also used to give priority to not recently played artists. +

queue_length=2

Threshold value triggering queue process.

musicbrainzid=true

Use MusicBrainzIdentifier to search music (mainly + for artists). + Default is True, switch to False if you don't have + MusicBrainzIdentifier set for at least 80% of you + music library.
Consider using these metadata as it + enhances a lot artist/album/tracks identification. + Use Picard to tag your file: https://picard.musicbrainz.org/. +

repeat_disable_queue=true

Prevent disabling queuing in repeat play mode. +

single_disable_queue=true

Prevent disabling queuing in single play mode. +

[sima]

Crop section

crop plugin's configuration:

[crop]
consume=10

How many played tracks to keep in the queue. + Allows you to maintain a fixed length queue. + Set to some negative integer to keep all played tracks. +

priority=10

+ Plugin priority +

Random section

Random plugin's configuration:

[random]
flavour=sensible

When no similar tracks are found, falling back to + random queuing. Different mode, aka random flavour, + are available: + pure, + sensible, + genre. +

  • pure, pure random choice, even among recently played track. +

  • sensible, use play history to filter chosen tracks. +

  • genre, Not implemented yet. +

+

priority=50

+ Plugin priority +

LastFm section

LastFM plugin's configuration.

[lastfm]
queue_mode=track

Queue mode to use among + track, + top and + album (see the section called “QUEUE MODES” for info about queue modes).

max_art=10

Number of similar artist to retrieve from local + media library.
When set to something superior + to zero, it tries to get as much similar artists + from media library.

depth=1

How many artists to base on similar artists + search.
The first is the last played artist + and so on back in the history. Highter depth + generates wider suggestions, it might help to + reduce looping over same artists. +

single_album=false

Prevent from queueing a track from the same album + (it often happens with OST).
+ Only relevant in "track" queue mode.

track_to_add=1

How many track(s) to add. Only relevant in + top and track + queue modes.

album_to_add=1

How many album(s) to add. Only relevant in + album queue modes.

cache=True

Whether or not to use on-disk persistent http + cache.
When set to "true", sima will use a + persistent cache for its http client. The cache is + written along with the dbfile in:
+ $XDG_CONFIG_HOME/mpd_sima/http/WEB_SERVICE.
+ If set to "false", caching is still done but in memory. +

priority=100

+ Plugin priority +

QUEUE MODES

mpd-sima offers different queue modes. All of them pick up + tracks from artists similar to the last track in the queue.

mpd-sima tries preferably to chose among unplayed artists or + at least not recently played artist. Concerning track and album + queue modes titles are chosen purely at random among unplayed + tracks.

track

Queue a similar track chosen at random from a similar artist.

top

Queue a track from a similar artist, chosen among + "top tracks" according to last.fm data mining.

album

Queue a whole album chosen at random from a similar artist.

Nota Bene:
Due to the + track point of view of database build upon tracks tags + an album lookup for a specific artist will return + albums as soon as this artist appears in a single track + of the album.
+ For instance looking for album from "The Velvet + Underground" will fetch "Last Days" and "Juno" OSTs + because the band appears on the soundtrack of these two + movies.
+ A solution is for you to set AlbumArtists tag to + something different than the actual artist of the + track. For compilations, OSTs etc. a strong convention + is to use "Various Artists" for this tag.

mpd-sima is currently looking for AlbumArtists tags + and avoid album where this tag is set with "Various + Artists". If a single track within an album is found + with AlbumArtists:"Various Artists" the complete album + is skipped and won't be queued.

FILES

${XDG_CONFIG_HOME}/mpd_sima/mpd_sima.cfg

Configuration file.

${XDG_DATA_HOME}/mpd_sima/sima.db

SQLite DB file.

${XDG_DATA_HOME}/mpd_sima/WEB_SERVICE/

Persistent http cache.

Usually XDG_DATA_HOME is set to + ${HOME}/.local/share and XDG_CONFIG_HOME to + ${HOME}/.config.
You may override them using + command line option --var-dir and --config (cf. + mpd-sima(1))

FEEDBACK/BUGS

The maintainer would be more than happy to ear from you, don't hesitate to send feedback, http://kaliko.me/id/.

XMPP users are welcome to join the dedicated chat room at kaliko.me@conf.azylum.org.

SEE ALSO

mpc(1), mpd(1)

+ /usr/share/doc/mpd-sima/ +

diff --git a/data/man/simadb_cli.1 b/data/man/simadb_cli.1 index ff3e8c4..46d5fda 100644 --- a/data/man/simadb_cli.1 +++ b/data/man/simadb_cli.1 @@ -2,12 +2,12 @@ .\" Title: simadb_cli .\" Author: Jack Kaliko .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 11/21/2017 +.\" Date: 03/19/2019 .\" Manual: mpd-sima 0.15.0 User Manual .\" Source: mpd-sima .\" Language: English .\" -.TH "SIMADB_CLI" "1" "11/21/2017" "mpd-sima" "mpd-sima 0.15.0 User Manual" +.TH "SIMADB_CLI" "1" "03/19/2019" "mpd-sima" "mpd-sima 0.15.0 User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -198,7 +198,7 @@ Wrote this man page and is currently leading MPD_sima project\&. .RE .SH "COPYRIGHT" .br -Copyright \(co 2009-2017 Jack Kaliko +Copyright \(co 2009-2019 Jack Kaliko .br .PP This manual page was written for the Debian system (and may be used by others)\&. diff --git a/data/man/simadb_cli.1.html b/data/man/simadb_cli.1.html new file mode 100644 index 0000000..62ed362 --- /dev/null +++ b/data/man/simadb_cli.1.html @@ -0,0 +1,42 @@ +simadb_cli

Name

simadb_cli — simadb_cli is a command line interface editor for the sima user DB.

Synopsis

simadb_cli --remove_artist=artist [ + --dbfile=db_file + ] [ + --reciprocal + ]

simadb_cli --purge_hist [ + --dbfile=db_file + ]

simadb_cli --view_all [ + --dbfile=db_file + ]

simadb_cli { --bl_curr_trk | --bl_curr_art | --bl_curr_alb | --bl_art=artist_name } [ + --dbfile=db_file + ] [ + --host=mpd_host + ] [ + --port=mpd_port + ]

simadb_cli --remove_bl=row_id [ + --dbfile=db_file + ]

simadb_cli --view_bl [ + --dbfile=db_file + ]

simadb_cli { + { -h | --help } + | --version }

DESCRIPTION

This manual page documents briefly the + simadb_cli commands.

simadb_cli is a command line interface to get and edit users + blacklist database used with MPD_sima. The default + database file (see the section called “FILES”) can be overridden if + you want.

EXAMPLE

Black list edition

Adding to black list. You can add a single + track, an album or an artist to the black list. The element to + black list is chosen from the currently playing track. Use + --bl_curr_trk to prevent simadb_cli to queue this + track, --bl_curr_alb or --bl_curr_art respectively for the album and the + artist. +

Remember you need access to your MPD server to retrieve + information to black list. Defaults are localhost:6600 or found in + environment variables but you may set it up from command + line: +

simadb_cli --bl_curr_art -S mympd.example.org

+ To black list a specific artist (not + currently playing) you can use --bl_ar="Artist name to black list". +

OPTIONS

The program follows the usual GNU command line syntax, + with long options starting with two dashes ("-"). A summary of + options is included below.

-h, --help

Print help and exit.

--version

Print version and exit.

--bl_art=artist_name

Use to black list artist_name. simadb_cli is checking artist_name is actually in MPD music library (cf -S and -P options to set MPD host/address if necessary).

If artist_name is not found the script print out a list of matching artists.

--bl_curr_trk | --bl_curr_art | --bl_curr_alb

Use to black list the currently playing track|artist|album. You need access to your MPD server, use -S and -P to set MPD host/address if necessary.

-d db_file, --dbfile=db_file

Use the specific file db_file as database.
Default is too use XDG_DATA_HOME (see the section called “FILES”).

--purge_hist

Purge history, you may supply an alternative DB file with --dbfile option.

--remove_bl=row_id

Use to remove a black list entry. To get the row_id to suppress use --view_bl option.

--view_bl

Get all entries in the black list.

-P mpd_port, --port=mpd_port

Use the specific port number mpd_port on MPD server. This overrides MPD_PORT environment variable.
Default is 6600.

-S mpd_host, --host=mpd_host

Use the specific host mpd_host as MPD server.
mpd_host can be an IP or a fully qualified domain name as long as your system can resolve it. This overrides MPD_HOST environment variable.
Default is localhost.

FILES

${XDG_DATA_HOME}/mpd_sima/sima.db

SQLite DB file. Usually XDG_DATA_HOME is set to ${HOME}/.local/share.

FEEDBACK/BUGS

The maintainer would be more than happy to ear from you, don't hesitate to send feedback, http://kaliko.me/id/.

XMPP users are welcome to join the dedicated chat room at kaliko.me@conf.azylum.org.

SEE ALSO

mpc(1), mpd(1)

+ /usr/share/doc/mpd-sima/ +

diff --git a/doc/Changelog b/doc/Changelog index 700cba1..383a70c 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -12,7 +12,7 @@ MPD_sima v0.15.0 Use the boolean option "mopidy_compat" in the sima section cf. https://gitlab.com/kaliko/sima/issues/21# --- kaliko jack UNRELEASED +-- kaliko jack Tue, 19 Mar 2019 13:58:49 +0100 MPD_sima v0.14.4 diff --git a/setup.py b/setup.py index 8241a4b..e891ac8 100755 --- a/setup.py +++ b/setup.py @@ -30,6 +30,7 @@ classifiers = [ "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", ] setup(name='MPD_sima', @@ -38,7 +39,7 @@ setup(name='MPD_sima', url='http://kaliko.me/code/mpd-sima', description='Automagically add titles to MPD playlist', author=AUTHOR, - author_email= EMAIL, + author_email=EMAIL, license='GPLv3', keywords='MPD', long_description=DESCRIPTION, @@ -52,7 +53,7 @@ setup(name='MPD_sima', 'console_scripts': ['mpd-sima = sima.launch:main',] }, test_suite="tests", -) + ) # VIM MODLINE # vim: ai ts=4 sw=4 sts=4 expandtab diff --git a/sima/core.py b/sima/core.py index ce1b078..5ec0492 100644 --- a/sima/core.py +++ b/sima/core.py @@ -31,6 +31,7 @@ from .lib.simadb import SimaDB from .lib.daemon import Daemon from .utils.utils import SigHup + class Sima(Daemon): """Main class, plugin and player management """