Skip to main content
Latest PyPI version CircleCI build status Test coverage

Provides bookmarks functionalities to mopidy.

Bookmarks are playlist that can be synced with the current playback state, so that you can easily stop listening to some tracklist, listen to something else, and later resume at the position where you stopped. This is most usefull when listening to audiobooks.

This extension can only be used with a compatible mopidy client. For now, only mopidy-mowecl is compatible.

Usage

Bookmarks are playlists saved in a sqlite database. When synchronising between a bookmark and playback state, the current track and current time will be saved periodically (every 0.5 second by default). As soon as the tracklist changes, or the stop_sync command is received, synchronisation will stop. A bookmark can then be resumed with the resume command, replacing the tracklist with the bookmark tracks, and resuming playback from the saved state.

To create a bookmark, use the Mopidy API, providing bookmark: as a uri_scheme. All the functions from the Playlist controller API are available.

Access to the bookmarks API is provided by a websocket server, which works in exactly the same way as the mopidy websocket server. It can thus be used with the Mopidy-js client by connecting to the address mopidy-host:port/bookmarks/ws.

The bookmarks API provides the following commands:

  • start_sync : Start synchronising a given bookmark with the current tracklist.

  • resume : Resumes playback from the given bookmark, and start syncing.

  • stop_sync : Stop synchronisation between the current bookmark and playback status.

  • get_current_bookmark : Get the current synchronising bookmark, if any.

See the API section for the API specification.

Moreover, the following event will be broadcasted to the connected websocket clients:

  • sync_status_update: When sync status changes.

    The event payload is an object of the form {bookmark: data}, where data is the name of the bookmark being synchronised, or null if synchronisation has stopped.

API

start_sync(uri): Starts syncing the given bookmark with the playback state.

The tracklist must correspond to the tracks of the bookmark.

Parameters

uristr

The uri of the bookmark to resume

Returns

bool

True if syncing started, else False

resume(uri): Resumes playback from a bookmark.

Populates the tracklist with the tracks of the bookmark, resumes playback from the saved position and sync the bookmark with the current playback state (track and time).

Parameters

uristr

The uri of the bookmark to resume

Returns

bool

True if a bookmark was found for the given uri, else False

get_current_bookmark(): Get the current synced bookmark if any.

Returns

mopidy.models.Ref or None

A ref to the current bookmark if any, else None

stop_sync(): Stop syncing the current bookmark.

Installation

Install by running:

python3 -m pip install Mopidy-Bookmarks

Note that this extension is a dependency of mopidy-mowecl, so it will already be installed if you are using this client.

Configuration

Mopidy-Bookmarks provides the following configuration keys (and their default values).

[bookmarks]
enabled = true

# sync period, in milliseconds
sync_period = 500

# set this to false to enable limits defined below
# (usefull if mopidy listens on a public network e.g.
disable_limits = true
# max number of bookmarks
max_bookmarks = 100
# max size of data for one bookmark
max_bookmark_length = 100000

# max number of items in store
max_store_items = 10
# max store item length
max_store_item_length = 1000

Project resources

Credits

Metadata

Release files for Mopidy-Bookmarks 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Mopidy-Bookmarks 0.1.4
File Size Uploaded
Mopidy-Bookmarks-0.1.4.tar.gz 17.8 kB Details

Release files / Mopidy-Bookmarks-0.1.4.tar.gz

Download URL Mopidy-Bookmarks-0.1.4.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
854985b95400f25bd0435e1a0c00597093a20a5f5bbcc7cef46f062555e61b37
BLAKE2b-256 checksum
How to use checksums
29e2ef0c8c180146aad290abd24d379a3d247df002ed8918bfdb0e8936f95400
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Release history Release notifications | RSS feed

This release

0.1.4 This release

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page