diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index e609420..feb4775 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -2,6 +2,12 @@
Changelog
*********
+v0.1.1
+========================================
+
+- Repeat mode added.
+
+
v0.1.0 (UNRELEASED)
========================================
diff --git a/README.rst b/README.rst
index 2849ecf..4ad0475 100644
--- a/README.rst
+++ b/README.rst
@@ -14,7 +14,7 @@ Mopidy-DefaultPlaylist
:target: https://codecov.io/gh/michaelmeer/mopidy-defaultplaylist
:alt: Test coverage
-Sets a default playlist for Mopidy, and allows to start playing it automatically after start of the Mopidy service. Optionally allows to set shuffle mode on. This can be useful for projects like the `Pimoroni Pirate Radio `_.
+Sets a default playlist for Mopidy, and allows to start playing it automatically after start of the Mopidy service. Optionally allows to set shuffle and repeat mode on. This can be useful for projects like the `Pimoroni Pirate Radio `_.
Installation
@@ -38,6 +38,7 @@ Mopidy-DefaultPlaylist to your Mopidy configuration file::
defaultplaylist_name = Top Hits
autoplay = true
shuffle = true
+ repeat = true
The default
diff --git a/mopidy_defaultplaylist/__init__.py b/mopidy_defaultplaylist/__init__.py
index 63a1fa9..bbddd62 100644
--- a/mopidy_defaultplaylist/__init__.py
+++ b/mopidy_defaultplaylist/__init__.py
@@ -25,6 +25,7 @@ def get_config_schema(self):
schema["defaultplaylist_name"] = config.String()
schema["autoplay"] = config.Boolean()
schema["shuffle"] = config.Boolean()
+ schema["repeat"] = config.Boolean()
return schema
diff --git a/mopidy_defaultplaylist/ext.conf b/mopidy_defaultplaylist/ext.conf
index f8cf13b..899107b 100644
--- a/mopidy_defaultplaylist/ext.conf
+++ b/mopidy_defaultplaylist/ext.conf
@@ -3,3 +3,4 @@ enabled = true
defaultplaylist_name = Valerie
autoplay = true
shuffle = true
+repeat = true
diff --git a/mopidy_defaultplaylist/frontend.py b/mopidy_defaultplaylist/frontend.py
index 2b88a1d..db5df91 100755
--- a/mopidy_defaultplaylist/frontend.py
+++ b/mopidy_defaultplaylist/frontend.py
@@ -14,6 +14,7 @@ def __init__(self, config, core):
self.defaultplaylist_name = self.config["defaultplaylist_name"]
self.autoplay = self.config["autoplay"]
self.shuffle = self.config["shuffle"]
+ self.repeat = self.config["repeat"]
# Your frontend implementation
def on_start(self):
@@ -30,17 +31,18 @@ def on_start(self):
logger.info("Tracks: {0}".format(track_uris))
self.core.tracklist.add(uris=track_uris)
self.core.tracklist.set_random(self.shuffle)
+ self.core.tracklist.set_repeat(self.repeat)
if self.autoplay:
logger.info(
- "Loaded Playlist {}, autoplay on --> start playing tracklist, shuffle-mode {}".format(
- self.defaultplaylist_name, self.shuffle
+ "Loaded Playlist {}, autoplay on --> start playing tracklist, shuffle-mode {}, repeat-mode {}".format(
+ self.defaultplaylist_name, self.shuffle, self.repeat,
)
)
self.core.playback.play()
else:
logger.info(
- "Loaded Playlist {}, shuffle-mode {}".format(
- self.defaultplaylist_name, self.shuffle
+ "Loaded Playlist {}, shuffle-mode {}, repeat-mode {}".format(
+ self.defaultplaylist_name, self.shuffle, self.repeat,
)
)
else:
diff --git a/setup.cfg b/setup.cfg
index c055e7c..995244e 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = Mopidy-DefaultPlaylist
-version = 0.1.0
+version = 0.1.1
url = https://github.com/michaelmeer/mopidy-defaultplaylist
author = Michael Meer
author_email = michael.meer@gmail.com