.\" Title: mpd_sima.cfg
.\" Author: Jack Kaliko <kaliko@azylum.org>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/08/2015
+.\" Date: 02/15/2015
.\" Manual: mpd-sima 0.14.0 User Manual
.\" Source: mpd-sima
.\" Language: English
.\"
-.TH "MPD_SIMA\&.CFG" "5" "02/08/2015" "mpd-sima" "mpd-sima 0.14.0 User Manual"
+.TH "MPD_SIMA\&.CFG" "5" "02/15/2015" "mpd-sima" "mpd-sima 0.14.0 User Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.RS 4
.RE
.PP
-\fBconsume=\fR\fI0\fR
+\fBconsume=\fR\fI10\fR
.RS 4
-How many played tracks to keep in the queue\&. Allows you to maintain a fixed length queue\&. Set to 0 to keep all played tracks\&.
+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\&.
.RE
.PP
\fBpriority=\fR\fI10\fR
<term><option>[crop]</option></term>
</varlistentry>
<varlistentry> <!-- crop.consume -->
- <term><option>consume=</option><replaceable>0</replaceable></term>
+ <term><option>consume=</option><replaceable>10</replaceable></term>
<listitem>
<para>How many played tracks to keep in the queue.
Allows you to maintain a fixed length queue.
- Set to 0 to keep all played tracks.
+ Set to some negative integer to keep all played tracks.
</para>
</listitem>
</varlistentry>
# default: 10
# description: How many played tracks to keep in the playlist.
# Allow to maintain a fixed length playlist.
+# Set a negative value to disable cropping (or remove plugin from sima/internal)
#consume = 10
[random]
self.target = None
if not self.plugin_conf:
return
- target = self.plugin_conf.get('consume', None)
+ target = self.plugin_conf.get('consume')
if not target:
return
- if not target.isdigit():
+ try:
+ if int(target) < 0:
+ self.log.info('Negative value for consume, not cropping')
+ return
+ except ValueError:
self.log.warning('Bad value for consume, '
'expecting an integer, not "{}"'.format(target))
else:
self.target = int(target)
+ self.log.debug('Cropping at 15')
def callback_next_song(self):
if not self.target: