Commit Graph

1875 Commits

Author SHA1 Message Date
Stein Magnus Jodal
e3f2e368c7 m3u: Add playlists.get_items() 2015-03-23 00:44:39 +01:00
Stein Magnus Jodal
4bae9c874c m3u: Add playlists.as_list() 2015-03-23 00:44:39 +01:00
Stein Magnus Jodal
5693b454ee m3u: Use lookup() instead of playlists prop in tests 2015-03-23 00:44:39 +01:00
Stein Magnus Jodal
bd2e4f7af0 core: Reimplement get_playlists() using new backend API 2015-03-23 00:44:39 +01:00
Stein Magnus Jodal
4f3a0839b3 core: Add playlists.as_list() and playlists.get_items(uri) 2015-03-23 00:44:39 +01:00
Stein Magnus Jodal
55b1eb7383 backend: Add playlists.as_list() and playlists.get_items(uri) 2015-03-23 00:44:39 +01:00
Stein Magnus Jodal
9462071e0c Merge pull request #1074 from adamcik/fix/1069-handle-broken-backends
core: Protect against old clients that implement backend.play
2015-03-23 00:05:05 +01:00
Thomas Adamcik
a74bc24bdc core: Protect against old clients that implement backend.play 2015-03-22 23:54:37 +01:00
Thomas Adamcik
7ec2342921 core: Normalize search queries
This is needed as otherwise each and every backend needs to handle the fact
that some "bad" clients might send {'field': 'value'} instead of
{'field': ['value']} Though the real problem isn't the clients but our
organically grown query API.
2015-03-22 23:33:49 +01:00
Thomas Adamcik
28f8a99090 review: Fixed mock use and docstring 2015-03-22 23:14:29 +01:00
Thomas Adamcik
efe9430c7a core: Update playback code to take change track into account.
This change has us checking the return value of change_track when deciding if
the play call was a success or if the track is unplayable. Which ensures that
the following can no longer happen: 1) play stream 2) play stream that fails
change_track 3) stream 1) continues playing. Correct behavior being the next
stream playing instead.
2015-03-22 22:12:51 +01:00
Thomas Kemmer
67d4dac862 m3u: Store by URI internally
Based upon tkem's PR #1053
2015-03-22 21:54:29 +01:00
Stein Magnus Jodal
12649265b1 Bump version to 1.0.0
So that the development version of extensions can start depending on
1.0.0 and test that they work with the changed APIs.
2015-03-22 09:25:04 +01:00
Stein Magnus Jodal
56dca0e931 Merge pull request #1064 from adamcik/fix/1052-break-backend-play
backend: Change playback API (breaking change!)
2015-03-22 09:19:39 +01:00
Stein Magnus Jodal
b2f60bc338 m3u: Extract new M3U backend from local
Fixes #1054
2015-03-21 08:13:45 +01:00
Thomas Adamcik
31d12c7e1d Merge pull request #1065 from jodal/fix/1060-tracklist-add-uris
core: Add uris kwarg to tracklist.add()
2015-03-21 00:42:22 +01:00
Stein Magnus Jodal
2bc3db0d0e core: Add uris kwarg to tracklist.core()
Fixes #1060
2015-03-21 00:16:24 +01:00
Stein Magnus Jodal
f67e55618c core: Make lookup(uris=...) return dict with all uris
All uris given to lookup should be in the result even if there is no
backend to handle the uri, and the lookup result thus is an empty list.

As a side effect, future.get() is now called in the order of the URIs
in the `uris` list, making it easier to mock out
backend.library.lookup() in core layer tests.
2015-03-21 00:11:15 +01:00
Thomas Adamcik
bbf52eede9 backend: Change playback API (breaking change!)
While trying to remove traces of stop calls in core to get gapless working I
found we had no way to switch to switch tracks without triggering a play. This
change fixes this by changing the backends playback provider API.

- play() now _only_ starts playback and does not take any arguments.
- prepare_change() has been added, this could have been avoided with a kwarg to
  change_track(track), but that would break more backends.
- core has been updated to call prepare_change+change_track+play as needed.
- tests have been updated to handle this change.

Longer term I hope to completely rework the playback API in backends, as 99% of
our backends only use change_track(track) to translate URIs. So we should make
simple case simple, and handle mopidy-spotify / appsrc in some other way.

Cherry picked from the WIP gapless branch.
2015-03-21 00:05:00 +01:00
Stein Magnus Jodal
861f60e6f1 core: Make history.add() private
Instead of changing the signature to add(uri, name) I opted for
renaming it to _add_track(track).

Since it's internal we may change it whenever we like to. Since you need
different logic for extracting an interesting name from a track and from
a ref or a stream title, it makes sense to add another method for adding
refs/stream titles to the history when that time comes.

Fixes #1056
2015-03-20 22:41:56 +01:00
Stein Magnus Jodal
dc982cd880 Merge pull request #1047 from adamcik/fix/1008-add-uris-to-lookup
core: Add uris argument to library.lookup (Fixes #1008)
2015-03-18 23:24:29 +01:00
Stein Magnus Jodal
65c5242b14 backend: Remove default impl of PlaylistProvider.playlists
The default was insane. For one, because overriding e.g. just the
getter would make the property have a pair of working getter and
setter that are entirely disconnected.
2015-03-18 00:25:26 +01:00
Thomas Adamcik
fdc84c3905 core: Add uris argument to library.lookup (Fixes #1008)
For now this doesn't add any corresponding APIs to backends, or for that matter
tracklist.add(uris). This is just to get the API in for clients in 0.20.
2015-03-17 23:49:21 +01:00
Stein Magnus Jodal
5240b50f8b Merge pull request #1040 from adamcik/fix/only-update-stream-title-for-streams
core: Only emit stream title changed for streams
2015-03-15 21:27:50 +01:00
Stein Magnus Jodal
0f21e7425e Merge pull request #1039 from adamcik/bug/923/duration-as-int-or-none
core: Correctly handle missing duration in seek.
2015-03-15 21:26:16 +01:00
Thomas Adamcik
28d047e1d2 core: Only emit stream title changed for streams
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.
2015-03-15 11:42:01 +01:00
Thomas Adamcik
6adeea6009 core: Correctly handle missing duration in seek.
Seeks will now fail when the duration is None, this is an approximation to if
the track is seekable or not. This check is need as otherwise seeking a radio
stream will trigger the next track.

If the track truly isn't seekable despite having a duration we should still
fail as GStreamer will reject the seek.
2015-03-15 11:29:07 +01:00
Stein Magnus Jodal
aed91008a3 deps: Add executable path to 'mopidy deps' output 2015-03-14 23:07:59 +01:00
Stein Magnus Jodal
336ef4534a tests: Use assertEqual instead of assertEquals 2015-03-14 23:01:49 +01:00
Thomas Kemmer
29b4a2075a local: Fix get_images() for local libraries returning single track from lookup(). 2015-03-14 16:12:46 +01:00
Thomas Adamcik
6260ba00be core: Test stream_title_changed listener 2015-03-14 00:30:46 +01:00
Thomas Adamcik
67f9bd73bf Merge branch 'develop' into feature/stream-reference
Conflicts:
	docs/changelog.rst
2015-03-14 00:28:51 +01:00
Thomas Adamcik
ea97047607 flake8: Fix bad import 2015-03-14 00:10:21 +01:00
Thomas Adamcik
4db4b4d63b core: Reduce stream metadata to just the title
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.
2015-03-13 23:56:51 +01:00
Thomas Adamcik
980e04537b Merge pull request #1035 from jodal/feature/none-mixer-adjustments
core/mpd: None-mixer adjustments
2015-03-13 23:31:20 +01:00
Stein Magnus Jodal
30badf60b9 Merge pull request #1033 from adamcik/feature/scanner-with-typefind
Add typefinding / MIME guess to scan code.
2015-03-13 23:22:12 +01:00
Stein Magnus Jodal
b29f9e10c4 core: get_mute() with no mixer returns None
...and not False, because the mute state is unknown (None) and not
unmuted (False) when there is no mixer.

Note that this change does not affect the MPD responses.
2015-03-13 21:19:56 +01:00
Thomas Adamcik
083ec130f9 Merge pull request #1015 from ZenithDK/feature/mixer_none
core/mpd: Allow empty or 'none' as audio.mixer value
2015-03-13 17:57:51 +01:00
Thomas Adamcik
cee73b5501 audio: Add support for checking seekable state in scanner
Return type of scanner changed to a named tuple with (uri, tags, duration,
seekable). This should help with #872 and the related "live" issues.

Tests, local scan and stream metadata lookup have been updated to account for
the changes.
2015-03-12 22:11:50 +01:00
Thomas Kemmer
e655d39384 Fix #1031: Add get_images() to local library. 2015-03-12 11:43:27 +01:00
Thomas Adamcik
6fcd43891e core: Switch to reference based stream info.
- 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.
2015-03-10 21:55:51 +01:00
Lasse Bigum
cb19b2c48c Allow 'none' as audio.mixer value
To disable mixing altogether, you can now set the configuration value
 audio/mixer to 'none'.
2015-03-10 00:26:22 +01:00
Thomas Adamcik
e639b2b18b tests: Add method for emitting fake tags changed in tests 2015-03-09 21:55:23 +01:00
Thomas Adamcik
29b00cabf9 Merge pull request #1028 from tkem/fix/1026
Fix #1026: Sort local playlists by name.
2015-03-08 23:53:04 +01:00
Lasse Bigum
cf0b666a0a Add tests for PlaybackController get_current_(tl_)track
Add some more test cases for PlaybackController
2015-03-08 04:10:02 +01:00
Thomas Kemmer
94c418d5e6 Fix #1026: Sort local playlists by name. 2015-03-07 22:42:22 +01:00
Thomas Kemmer
9150c34053 Fix #1023: Remove support for local album images from coverartarchive.org 2015-03-06 10:02:08 +01:00
Stein Magnus Jodal
2280a533c0 Use py.test as test runner 2015-03-05 00:35:20 +01:00
Thomas Adamcik
319c1fc1e3 local: Readd support for search without limit for get_distinct support 2015-03-02 23:39:06 +01:00
Thomas Adamcik
7c2c4c1c45 Merge branch 'fix/local-json-limit-offset' of https://github.com/ali/mopidy into develop 2015-03-02 23:18:39 +01:00