]> kaliko git repositories - mpd-sima.git/commitdiff
Add option to prevent single|repeat to disable queuing (Closes #19)
authorkaliko <kaliko@azylum.org>
Tue, 21 Nov 2017 15:35:06 +0000 (16:35 +0100)
committerkaliko <kaliko@azylum.org>
Tue, 21 Nov 2017 15:35:06 +0000 (16:35 +0100)
data/man/mpd_sima.cfg.5
data/man/mpd_sima.cfg.5.xml
doc/Changelog
doc/examples/all_settings.cfg
sima/plugins/core/mpdoptions.py
sima/utils/config.py

index b696d6128cb3810b73a481454dab4e9940ed6ce9..5d5aba6ea8717166399d60e96151bb80ce90e90e 100644 (file)
@@ -212,6 +212,16 @@ Use MusicBrainzIdentifier to search music (mainly for artists)\&. Default is Tru
 Consider using these metadata as it enhances a lot artist/album/tracks identification\&. Use Picard to tag your file:
 \m[blue]\fB\%https://picard.musicbrainz.org/\fR\m[]\&.
 .RE
+.PP
+\fBrepeat_disable_queue=\fR\fItrue\fR
+.RS 4
+Prevent disabling queuing in repeat play mode\&.
+.RE
+.PP
+\fBsingle_disable_queue=\fR\fItrue\fR
+.RS 4
+Prevent disabling queuing in single play mode\&.
+.RE
 .SS "Crop section"
 .PP
 crop plugin\*(Aqs configuration:
index 3f7172f01d97eea0c4b8e56be70be450d8c53626..002b1413a635796a9001356ea6746faa4b9d12b5 100644 (file)
@@ -185,63 +185,77 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
                     <term><option>[sima]</option></term>
                     <listitem><para></para></listitem>
                 </varlistentry>
-            <variablelist>
-                <varlistentry> <!-- sima.contrib -->
-                    <term><option>contrib=</option><replaceable></replaceable></term>
-                    <listitem>
-                        <para></para>
-                    </listitem>
-                </varlistentry>
-                <varlistentry> <!-- sima.internal -->
-                    <term><option>internal=</option><replaceable>Lastfm, Random, Crop</replaceable></term>
-                    <listitem>
-                        <para>&dhpackage;'s plugin management for internal source plugin
-                            and contrib (ie. external plugins).<sbr /> Plugins list is a
-                            comma separated string list.<sbr /> Optional plugin's
-                            configuration lays in its own section.<sbr />For instance a
-                            "AwesomePlugin" declared here gets its configuration from the
-                            corresponding section "[awesomeplugin]".
-                        </para>
-                        <para>The default list of plugins to load at startup: <option>Lastfm</option>,<option>Random</option>,<option>Crop</option>.<sbr />
-                            <option>Crop</option> is an utility plugin, it does not queue any tracks (cf. below).<sbr />
-                            <option>Random</option> will queue a track at random if other plugins did not return any tracks.<sbr />
-                        </para>
-                        <para>You can add here as many plugins you want,
-                            currently shipping <option>Lastfm</option> only.<sbr />
-                            The priority may be used to order them.
-                        </para>
-                    </listitem>
-                </varlistentry>
-                <varlistentry> <!-- sima.history_duration -->
-                    <term><option>history_duration=</option><replaceable>8</replaceable></term>
-                    <listitem>
-                        <para>How far to look back in history to avoid to play
-                            twice the same track/title (duration in
-                            hours).<sbr />
-                            The <option>history_duration</option> is also used to give priority to not recently played artists.
-                        </para>
-                    </listitem>
-                </varlistentry>
-                <varlistentry> <!-- sima.queue_length -->
-                    <term><option>queue_length=</option><replaceable>2</replaceable></term>
-                    <listitem>
-                        <para>Threshold value triggering queue process.</para>
-                    </listitem>
-                </varlistentry>
-                <varlistentry> <!-- sima.musicbrainzid -->
-                    <term><option>musicbrainzid=</option><replaceable>true</replaceable></term>
-                    <listitem>
-                        <para>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.<sbr /> Consider using these metadata as it
-                            enhances a lot artist/album/tracks identification.
-                            Use Picard to tag your file: <ulink url="https://picard.musicbrainz.org/"/>.
-                        </para>
-                    </listitem>
-                </varlistentry>
-            </variablelist>
+                <variablelist>
+                    <varlistentry> <!-- sima.contrib -->
+                        <term><option>contrib=</option><replaceable></replaceable></term>
+                        <listitem>
+                            <para></para>
+                        </listitem>
+                    </varlistentry>
+                    <varlistentry> <!-- sima.internal -->
+                        <term><option>internal=</option><replaceable>Lastfm, Random, Crop</replaceable></term>
+                        <listitem>
+                            <para>&dhpackage;'s plugin management for internal source plugin
+                                and contrib (ie. external plugins).<sbr /> Plugins list is a
+                                comma separated string list.<sbr /> Optional plugin's
+                                configuration lays in its own section.<sbr />For instance a
+                                "AwesomePlugin" declared here gets its configuration from the
+                                corresponding section "[awesomeplugin]".
+                            </para>
+                            <para>The default list of plugins to load at startup: <option>Lastfm</option>,<option>Random</option>,<option>Crop</option>.<sbr />
+                                <option>Crop</option> is an utility plugin, it does not queue any tracks (cf. below).<sbr />
+                                <option>Random</option> will queue a track at random if other plugins did not return any tracks.<sbr />
+                            </para>
+                            <para>You can add here as many plugins you want,
+                                currently shipping <option>Lastfm</option> only.<sbr />
+                                The priority may be used to order them.
+                            </para>
+                        </listitem>
+                    </varlistentry>
+                    <varlistentry> <!-- sima.history_duration -->
+                        <term><option>history_duration=</option><replaceable>8</replaceable></term>
+                        <listitem>
+                            <para>How far to look back in history to avoid to play
+                                twice the same track/title (duration in
+                                hours).<sbr />
+                                The <option>history_duration</option> is also used to give priority to not recently played artists.
+                            </para>
+                        </listitem>
+                    </varlistentry>
+                    <varlistentry> <!-- sima.queue_length -->
+                        <term><option>queue_length=</option><replaceable>2</replaceable></term>
+                        <listitem>
+                            <para>Threshold value triggering queue process.</para>
+                        </listitem>
+                    </varlistentry>
+                    <varlistentry> <!-- sima.musicbrainzid -->
+                        <term><option>musicbrainzid=</option><replaceable>true</replaceable></term>
+                        <listitem>
+                            <para>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.<sbr /> Consider using these metadata as it
+                                enhances a lot artist/album/tracks identification.
+                                Use Picard to tag your file: <ulink url="https://picard.musicbrainz.org/"/>.
+                            </para>
+                        </listitem>
+                    </varlistentry>
+                    <varlistentry> <!-- sima.repeat_disable_queue -->
+                        <term><option>repeat_disable_queue=</option><replaceable>true</replaceable></term>
+                        <listitem>
+                            <para>Prevent disabling queuing in repeat play mode.
+                            </para>
+                        </listitem>
+                    </varlistentry>
+                    <varlistentry> <!-- sima.single_disable_queue -->
+                        <term><option>single_disable_queue=</option><replaceable>true</replaceable></term>
+                        <listitem>
+                            <para>Prevent disabling queuing in single play mode.
+                            </para>
+                        </listitem>
+                    </varlistentry>
+                </variablelist>
             </variablelist>
         </refsect2>
         <refsect2 id="crop">
index 8b5e7c3d9f9fb3c63f1ece472f2e2a8d3b3d0f74..9aa9442465fb2baf1d6048f86bf3cabfcfe6de9a 100644 (file)
@@ -2,6 +2,7 @@ MPD_sima v0.15.0
 
  * Remove EchoNest support (Closes #10)
  * Enhanced queuing behavior in random mode (Closes #16)
+ * Add option to prevent single & repeat mode to disable queuing (Closes #19)
 
 -- kaliko jack <kaliko@azylum.org> UNRELEASED
 
index b0df17f95adf4e4ea50e2ac3b401b6ada07d8c3a..a7203750c6d257e6fcb7cbbf299dec0fc6b17437 100644 (file)
@@ -106,6 +106,18 @@ queue_length = 2
 # description: Use of MusicBrainzIdentifier tag
 musicbrainzid = True
 
+## REPEAT_DISABLE_QUEUE
+# type: boolean
+# default: True
+# description: Prevent repeat play mode to disable queuing
+repeat_disable_queue = True
+
+## SINGLE_DISABLE_QUEUE
+# type: boolean
+# default: True
+# description: Prevent single play mode to disable queuing
+single_disable_queue  = True
+
 ######################### PLUGINS #####################################
 
 [crop]
index fe368bd1e01766f4ae810c8d7cdc430ab624b818..47b0c042e6fcbb5fbbdf67d234aa24c08a83d2d4 100644 (file)
@@ -18,7 +18,7 @@
 #
 #
 """
-    Deal with MPD options ‑ idle and repeat mode
+    Deal with MPD options ‑ single and repeat mode
 """
 
 # standard library import
@@ -44,11 +44,13 @@ class MpdOptions(Plugin):
         """
         player = self.daemon.player
         if player.playmode.get('single'):
-            self.log.info('MPD "single" mode activated.')
-            self.daemon.enabled = False
+            if self.daemon.config.getboolean('sima', 'single_disable_queue'):
+                self.log.info('MPD "single" mode activated.')
+                self.daemon.enabled = False
         elif player.playmode.get('repeat'):
-            self.log.info('MPD "repeat" mode activated.')
-            self.daemon.enabled = False
+            if self.daemon.config.getboolean('sima', 'repeat_disable_queue'):
+                self.log.info('MPD "repeat" mode activated.')
+                self.daemon.enabled = False
         else:
             if self.daemon.enabled is False:
                 self.log.debug('enabling queuing (leaving single|repeat mode)')
index 0f13cba8afa249f5242aa7327b40aa99bc085c2b..dfa91e73ebb335d8031b213d4522ac2309962e53 100644 (file)
@@ -53,6 +53,8 @@ DEFAULT_CONF = {
             'queue_length': 2,
             'var_dir': 'empty',
             'musicbrainzid': "true",
+            'repeat_disable_queue': "true",
+            'single_disable_queue': "true",
             },
         'daemon':{
             'daemon': False,