Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Changelog
*********

v0.1.1
========================================

- Repeat mode added.



v0.1.0 (UNRELEASED)
========================================
Expand Down
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://learn.pimoroni.com/tutorial/sandyj/streaming-spotify-to-your-pi/>`_.
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 <https://learn.pimoroni.com/tutorial/sandyj/streaming-spotify-to-your-pi/>`_.


Installation
Expand All @@ -38,6 +38,7 @@ Mopidy-DefaultPlaylist to your Mopidy configuration file::
defaultplaylist_name = Top Hits
autoplay = true
shuffle = true
repeat = true

The default

Expand Down
1 change: 1 addition & 0 deletions mopidy_defaultplaylist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions mopidy_defaultplaylist/ext.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ enabled = true
defaultplaylist_name = Valerie
autoplay = true
shuffle = true
repeat = true
10 changes: 6 additions & 4 deletions mopidy_defaultplaylist/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -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
Expand Down