Commit Graph

6493 Commits

Author SHA1 Message Date
Thomas Adamcik
dd0c86faa0 Merge pull request #1075 from jodal/feature/new-playlists-api
core/backend: Add new playlists API
2015-03-23 22:37:11 +01:00
Stein Magnus Jodal
07cf962434 Merge branch 'develop' into feature/new-playlists-api
Conflicts:
	docs/changelog.rst
2015-03-23 21:45:32 +01:00
Stein Magnus Jodal
dad46df748 Merge pull request #1076 from adamcik/fix/1070-shrink-core-api
Remove a bunch of API surface from core
2015-03-23 21:26:38 +01:00
Thomas Adamcik
f4452b22db core: Minor readability improvement 2015-03-23 15:02:37 +01:00
Thomas Adamcik
97fd102fa2 docs: Add core API cleanup to changelog 2015-03-23 15:02:25 +01:00
Stein Magnus Jodal
c0f99466c3 m3u: Remove playlists property 2015-03-23 13:31:42 +01:00
Stein Magnus Jodal
dbe4165a0f m3u: Only test through core actor 2015-03-23 13:31:25 +01:00
Stein Magnus Jodal
6815868e24 core: Doc Playlist.last_modified not being set
...if get_playlists() is called with include_tracks=False
2015-03-23 13:22:52 +01:00
Thomas Adamcik
6d22c4fd59 core: Remove set_current_tl_track 2015-03-23 00:50:05 +01:00
Thomas Adamcik
07f0453c6e core: Make event triggers internal 2015-03-23 00:50:05 +01:00
Thomas Adamcik
fd04cd918f core: Remove on_error_step from play arguments 2015-03-23 00:50:05 +01:00
Thomas Adamcik
ca02dbb676 core: Make change_track internal as it going away in 1.x 2015-03-23 00:50:05 +01:00
Stein Magnus Jodal
df604bb3e5 core: Deprecated playlists.filter() 2015-03-23 00:49:56 +01:00
Stein Magnus Jodal
d37bd62bb1 backend: Remove playlists.playlists property 2015-03-23 00:44:39 +01:00
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
Stein Magnus Jodal
ca3c40b8bb docs: Add PR #1073 to changelog 2015-03-23 00:01:45 +01:00
Thomas Adamcik
a74bc24bdc core: Protect against old clients that implement backend.play 2015-03-22 23:54:37 +01:00
Stein Magnus Jodal
44033359b0 Merge pull request #1073 from adamcik/fix/1067-normalize-search-queries
core: Normalize search queries
2015-03-22 23:45:24 +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
Stein Magnus Jodal
5eebab6e18 Merge pull request #1071 from adamcik/fix/change-track-failure-should-fail-playback
core: Update playback code to take change track into account.
2015-03-22 23:18:13 +01:00
Thomas Adamcik
28f8a99090 review: Fixed mock use and docstring 2015-03-22 23:14:29 +01:00
Thomas Adamcik
a3e295026a docs: Add changelog for core play behaviour change 2015-03-22 22:37:47 +01:00
Nick Steel
08f729de76 docs: fix translate_uri method reference 2015-03-22 21:30:50 +00:00
Stein Magnus Jodal
b8130f03cd Fix flake8 warning 2015-03-22 22:18:57 +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
fe8d6aa4e8 core: Use 'must' instead of 'should' where appropriate 2015-03-22 21:28:35 +01:00
Stein Magnus Jodal
15872ca02a travis: Don't build the debian branch 2015-03-22 20:26:11 +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
f361109832 setup: Explicitly close file
Instead of relying on GC.
2015-03-22 09:23:12 +01:00
Stein Magnus Jodal
9129955592 backend: Minor docstring adjustments
Did it myself rather than holding off PR #1064 any longer.
2015-03-22 09:21:12 +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
Thomas Adamcik
c620e3a00f docs: Add changelog for backend API breakage 2015-03-22 01:27:07 +01:00
Thomas Adamcik
ebba3a3d14 backend: Allow None as return from translate_uri() 2015-03-21 23:17:40 +01:00
Thomas Adamcik
87ba52f124 review: Docstring updates 2015-03-21 23:12:44 +01:00
Thomas Adamcik
29f8ee0da0 Merge pull request #1066 from jodal/feature/add-m3u-backend
m3u: Extract new M3U backend from local
2015-03-21 11:59:30 +01:00
Thomas Adamcik
a6ef1bb8d9 backend: Add translate_uri for simpler API for the simple case.
change_track(track) simply calls translate_uri(uri) by default now so that 90%
of clients with custom URIs should be able to just implement this one method on
the backend any ignore everything else.
2015-03-21 11:43:46 +01:00
Stein Magnus Jodal
b2f60bc338 m3u: Extract new M3U backend from local
Fixes #1054
2015-03-21 08:13:45 +01:00
Stein Magnus Jodal
8977f71411 docs: Fix syntax errors in changelog 2015-03-21 00:59:54 +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
Thomas Adamcik
a4c39f5bf9 Merge pull request #1063 from jodal/fix/1056-private-history-add
core: Make history.add() private
2015-03-20 23:19:54 +01:00