- Introduce a CoreState class that holds all core states
- Move xState classes to internal
- Use validation.check_instance for consistent error messages
- Store tlid instead of TlTrack to restore last played track
- storage.save: Don't modify data. mopidy.__version__ has to be added by caller.
- storage.load: Added a Todo. Postponed decision, if load() shall raise an exception in case of error. See PR #310.
Persist following properties:
mopidy.core.tracklist
_tl_tracks
_next_tlid
get_consume()
get_random()
get_repeat()
get_single()
mopidy.core.history
_history
mopidy.core.playlist
get_current_tl_track()
get_time_position()
mopidy.core.mixer
get_volume()
Details:
- moved json export/import write_library()/load_library() from mopidy/local to mopidy/models
- new core methods save_state(), load_state()
- save_state(), load_state() accessible via rpc
- save state to disk at stop
- load state from disk at start
- new config: core.restore_state ("off", "load", "play")
TODO:
- seek to play position does not work. Timing issue.
- use extra thread to load state from disk at start?
This is done by checking for the presence of the organization tag typically set
by web streams. This might be a bit to strict and a bad heuristic, but it's
currently better than wrongly emitting stream titles for non streams IMO.
The API I really want for this to support regular tracks, stream updates and
dynamic playlists is still unclear to me. As such I'm taking the KISS approach
and reducing this to just the stream title and nothing else.
If all goes as planed this will be replaced by playback_track_changed(tlid, ref)
style events and other improvements in a later version.
- Adds tests for new behaviors in core.
- Adds stream name to MPD format (fixes#944)
- Adds 'stream_changed' core event (needs a new name/event)
- Adds 'get_stream_reference' (which I'm also unsure about)
The bits I'm unsure about are mostly with respect to #270, but I'm going ahead
with this commit so we can discuss the details in PR with this code as an
example.
The warnings appear as warning level log messages if running Python on
the mopidy/ directory like this:
python -W all mopidy -v
or:
python -W all mopidy -o loglevels/py.warnings=warning
We don't suppress warnings when Pykka is the caller in general, but just
when Pykka is looking at all properties to create its actor proxies.
When a deprecated property is used from another Pykka actor, only the
stack for the current actor thread is available for inspection, so the
warning cannot show where the actual call site in the other actor thread
is. Though, if the warnings are made exceptions with:
python -W error mopidy
then the stack traces will include the frames from all involved actor
threads, showing where the original call site is.
- Adds stream changed handler to core
- Moves playback started trigger to stream changed
- Made about to finish store next track in _pending_tl_track
- Set the pending track as current in stream changed
- Adds tests for all of this and fixes existing tests