<!ENTITY dhemail "kaliko@azylum.org">
<!ENTITY dhusername "&dhfirstname; &dhsurname;">
<!ENTITY dhpackage "mpd-sima">
- <!ENTITY release "0.12.3">
+ <!ENTITY release "0.13.0">
<!-- TITLE should be something like "User commands" or similar (see
http://www.tldp.org/HOWTO/Man-Page/q2.html). -->
<!ENTITY dhtitle "&dhpackage; &release; User Manual">
.\" Title: mpd-sima
.\" Author: Jack Kaliko <kaliko@azylum.org>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 11/24/2014
-.\" Manual: mpd-sima 0.12.3 User Manual
+.\" Date: 12/08/2014
+.\" Manual: mpd-sima 0.13.0 User Manual
.\" Source: mpd-sima
.\" Language: English
.\"
-.TH "MPD\-SIMA" "1" "11/24/2014" "mpd-sima" "mpd-sima 0.12.3 User Manual"
+.TH "MPD\-SIMA" "1" "12/08/2014" "mpd-sima" "mpd-sima 0.13.0 User Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" Title: mpd_sima.cfg
.\" Author: Jack Kaliko <kaliko@azylum.org>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 11/24/2014
-.\" Manual: mpd-sima 0.12.3 User Manual
+.\" Date: 12/09/2014
+.\" Manual: mpd-sima 0.13.0 User Manual
.\" Source: mpd-sima
.\" Language: English
.\"
-.TH "MPD_SIMA\&.CFG" "5" "11/24/2014" "mpd-sima" "mpd-sima 0.12.3 User Manual"
+.TH "MPD_SIMA\&.CFG" "5" "12/09/2014" "mpd-sima" "mpd-sima 0.13.0 User Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
This value triggers queue process if the queue length is less than specified queue_length\&.
.RE
.PP
+\fBmusicbrainzid=\fR\fItrue\fR
+.RS 4
+Use MusicBrainzIdentifier to search music (mainly for artists)\&. Consider using these metadata as it enhances a lot artist/album/tracks identification\&.
+.br
+
+Default is True, switch to False if you don\*(Aqt have MusicBrainzIdentifier set for at least 80% of you music library\&.
+.br
+
+Use Picard to tag your file:
+\m[blue]\fB\%https://picard.musicbrainz.org/\fR\m[]\&.
+.RE
+.PP
\fBuser_db=\fR\fIfalse\fR
.RS 4
Temporarily removed feature
queue_length.</para>
</listitem>
</varlistentry>
+ <varlistentry> <!-- sima.musicbrainzid -->
+ <term><option>musicbrainzid=</option><replaceable>true</replaceable></term>
+ <listitem>
+ <para>Use MusicBrainzIdentifier to search music (mainly
+ for artists). Consider using these metadata as it
+ enhances a lot artist/album/tracks identification.<sbr />
+ Default is True, switch to False if you don't have
+ MusicBrainzIdentifier set for at least 80% of you
+ music library.<sbr />
+ Use Picard to tag your file: <ulink url="https://picard.musicbrainz.org/"/>.
+ </para>
+ </listitem>
+ </varlistentry>
<varlistentry> <!-- sima.user_db -->
<term><option>user_db=</option><replaceable>false</replaceable></term>
<listitem>
.\" Title: simadb_cli
.\" Author: Jack Kaliko <kaliko@azylum.org>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 11/24/2014
-.\" Manual: mpd-sima 0.12.3 User Manual
+.\" Date: 12/08/2014
+.\" Manual: mpd-sima 0.13.0 User Manual
.\" Source: mpd-sima
.\" Language: English
.\"
-.TH "SIMADB_CLI" "1" "11/24/2014" "mpd-sima" "mpd-sima 0.12.3 User Manual"
+.TH "SIMADB_CLI" "1" "12/08/2014" "mpd-sima" "mpd-sima 0.13.0 User Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
MPD_sima v0.13.0
- *
+ * Use of MusicBrainzIdentifier by default
+ Please consider tagging your library with these metadata
-- kaliko jack <kaliko@azylum.org> UNRELEASED
# description: Queue length triggering tracks addition
queue_length = 1
+## MUSICBRAINZID
+# type: boolean
+# default: True
+# description: Use of MusicBrainzIdentifier tag
+musicbrainzid = True
+
######################### PLUGINS #####################################
[crop]
raise PlayerError('Could connect to "%s", '
'but command "%s" not available' %
(host, nddcmd))
+
+ # Controls use of MusicBrainzIdentifier
+ if Artist.use_mbid:
+ if 'MUSICBRAINZ_ARTISTID' not in self._client.tagtypes():
+ self.log.warning('Use of MusicBrainzIdentifier is set but MPD is '
+ 'not providing related metadata')
+ self.log.info(self._client.tagtypes())
+ else:
+ self.log.warning('Use of MusicBrainzIdentifier disabled!')
+ self.log.info('Consider using MusicBrainzIdentifier for your music library')
self._flush_cache()
def disconnect(self):
# local import
from . import core, info
from .lib.logger import set_logger
+from .lib.meta import Meta
from .lib.simadb import SimaDB
from .utils.config import ConfMan
from .utils.startopt import StartOpt
# Loading contrib plugins
load_plugins(sima, 'contrib')
+ # Set use of MusicBrainzIdentifier
+ if not config.getboolean('sima', 'musicbrainzid'):
+ logger.info('Disabling MusicBrainzIdentifier')
+ Meta.use_mbid = False
+
# Run as a daemon
if config.getboolean('daemon', 'daemon'):
if restart:
class WrongUUID4(MetaException):
pass
+def mbidfilter(func):
+ def wrapper(*args, **kwargs):
+ cls = args[0]
+ if not cls.use_mbid:
+ kwargs.pop('mbid', None)
+ kwargs.pop('musicbrainz_artistid', None)
+ kwargs.pop('musicbrainz_albumartistid', None)
+ func(*args, **kwargs)
+ return wrapper
+
class Meta:
"""Generic Class for Meta object
Meta(name=<str>[, mbid=UUID4])
"""
+ use_mbid = True
def __init__(self, **kwargs):
self.__name = None #TODO: should be immutable
class Artist(Meta):
+ @mbidfilter
def __init__(self, name=None, mbid=None, **kwargs):
"""Artist object built from a mapping dict containing at least an
"artist" entry:
return []
tolookfor = self.player.playlist[-1].Artist
self.log.info('Looking for artist similar to "{}"'.format(tolookfor))
+ self.log.debug(repr(tolookfor))
similar = self.ws_similar_artists(tolookfor)
if not similar:
self.log.info('Got nothing from {0}!'.format(self.ws.name))
'history_duration': 8,
'queue_length': 1,
'var_dir': 'empty',
+ 'musicbrainzid': "true",
},
'daemon':{
'daemon': False,