Commit Graph

834 Commits

Author SHA1 Message Date
Thomas Adamcik
3a4a9e60e0 Fix use of threading.Event for Python 2.6 and clear connected state.
threading.Event's wait method returns None on python pre 2.7, which means all
searches would fail. This also corrects that fact that we weren't clearing the
connected threading event on disconnects. I did not add any tests for this at
this time as I just want to get the fix out.
2012-12-24 13:55:46 +01:00
Stein Magnus Jodal
5f1a750504 Merge pull request #289 from jodal/feature/spotify-to-use-gst-time
Make Spotify backend use GStreamer for time position and seek
2012-12-24 03:08:55 -08:00
Stein Magnus Jodal
5842eabf87 Merge remote-tracking branch 'trygveaa/lookup-not-unavailable' into develop 2012-12-24 02:17:35 +01:00
Trygve Aaberge
31ddbbc017 spotify: Use TRACK_AVAILABLE constant 2012-12-24 02:07:34 +01:00
Stein Magnus Jodal
cde29d9946 Merge pull request #292 from trygveaa/lookup-not-unavailable
spotify: Only return available tracks from lookups
2012-12-23 16:45:24 -08:00
Trygve Aaberge
75279721fb spotify: Return [] instead of None in _lookup_track 2012-12-24 01:41:08 +01:00
Trygve Aaberge
2a487ecd30 spotify: Fix flake8 warnings 2012-12-24 01:40:41 +01:00
Stein Magnus Jodal
c218375100 audio: Move Spotify appsrc caps out of audio 2012-12-24 01:40:35 +01:00
Stein Magnus Jodal
fdd4ac19ae spotify: Fix wrong search return type 2012-12-24 01:21:08 +01:00
Trygve Aaberge
8da2495e83 spotify: Only return available tracks from lookups 2012-12-24 00:29:37 +01:00
Stein Magnus Jodal
58cbbe8cb3 Merge pull request #287 from jodal/feature/search-result-model
Add SearchResult model
2012-12-23 09:47:11 -08:00
Stein Magnus Jodal
eec6c271c2 spotify: Refactor URI lookup 2012-12-23 18:41:07 +01:00
Stein Magnus Jodal
524bfc9317 local: Use 'file:search' as uri for search results for now 2012-12-23 18:32:52 +01:00
Stein Magnus Jodal
c7656cdc15 spotify: Replace wall clock timer with GStreamer timer 2012-12-23 12:34:24 +01:00
Stein Magnus Jodal
8fcc7966b2 spotify: Create SpotifyTrack with uri if lookup track isn't loaded 2012-12-23 12:25:20 +01:00
Stein Magnus Jodal
357a26d7f9 spotify: Fix improper search() return value 2012-12-22 01:40:19 +01:00
Stein Magnus Jodal
a8c0f6baa8 spotify: Make query a bytestring before urlencoding it 2012-12-21 22:25:21 +01:00
Stein Magnus Jodal
e804333897 spotify: Add uri to SearchResult 2012-12-21 22:05:20 +01:00
Stein Magnus Jodal
71f27d5625 local: Add uri to SearchResults 2012-12-21 22:05:20 +01:00
Stein Magnus Jodal
b0ba2040df Return SearchResult objects from find_exact() and search()
This applies to both backends and core.
2012-12-21 22:05:20 +01:00
Stein Magnus Jodal
4b94a5a8ef spotify: Increase max search results from 100 to 200 2012-12-20 22:15:46 +01:00
Stein Magnus Jodal
02c8ea53d7 local: Add search-by-date support 2012-12-20 21:30:09 +01:00
Stein Magnus Jodal
53f3ef488c local: Reorder search filters and tests 2012-12-20 21:30:08 +01:00
Stein Magnus Jodal
147bb5e983 local: Read track date from tag cache 2012-12-20 21:30:08 +01:00
Stein Magnus Jodal
30ac1896b3 Merge branch 'develop' into feature/improved-lookup 2012-12-20 19:15:39 +01:00
Stein Magnus Jodal
a3ab956733 spotify: Block track lookups until we get data
This makes track lookup behave consistently with lookup of artists, albums and
playlists. I consider this "safe", since track lookup is only used for lookup
of single tracks by URI. If you're e.g. loading a playlist full of unloaded
tracks, you should still use SpotifyTrack to avoid blocking on track loading.
2012-12-20 19:08:01 +01:00
Stein Magnus Jodal
e118c73aa3 spotify: Refactor loading timeout logic 2012-12-20 19:01:04 +01:00
Stein Magnus Jodal
42faec8a3c spotify: SpotifyTrack fails when both uri and track is provided 2012-12-20 18:59:01 +01:00
Stein Magnus Jodal
cb78dc6341 spotify: Spotify wants 'track', not 'title' (#272) 2012-12-20 00:26:54 +01:00
Stein Magnus Jodal
30edba0a3e spotify: Unbreak search by URI 2012-12-20 00:25:47 +01:00
Stein Magnus Jodal
4d67dd1353 spotify: Use SPOTIFY_TIMEOUT when waiting for objects to load 2012-12-19 23:37:43 +01:00
Stein Magnus Jodal
4a29e2549a Merge branch 'develop' into feature/improved-lookup
Conflicts:
	docs/changes.rst
	mopidy/backends/spotify/library.py
2012-12-19 23:32:32 +01:00
Stein Magnus Jodal
8baf813fb6 spotify: Use SPOTIFY_TIMEOUT in search 2012-12-19 23:31:33 +01:00
Stein Magnus Jodal
d1b2641b86 spotify: Gather the search functionality in one place 2012-12-19 23:16:45 +01:00
Stein Magnus Jodal
699588b525 spotify: Refactor lookup code, add playlist support 2012-12-19 21:54:36 +01:00
Stein Magnus Jodal
d5c401bd07 spotify: Fix flake8 warnings in lookup method 2012-12-19 21:54:27 +01:00
Wouter van Wijk
524f22eff4 Added lookup for artists, albums 2012-12-19 12:48:33 +01:00
Stein Magnus Jodal
a084105898 docs: Use requirement files as single source of dependencies 2012-12-15 23:07:29 +01:00
Stein Magnus Jodal
24ace415a0 spotify: pyspotify 1.9 and 1.10 are both supported 2012-12-13 00:19:43 +01:00
Thomas Adamcik
8ee4b431ac Merge pull request #276 from jodal/feature/scanner-encoding-support
Scanner encoding support
2012-12-12 15:11:10 -08:00
Stein Magnus Jodal
0f603c3ede Use urllib.{quote,unquote} instead of {pathname2url,url2pathname} 2012-12-12 23:13:52 +01:00
Stein Magnus Jodal
ac4411ec83 spotify: Make session manager work with pyspotify 1.9 _and_ 1.10 2012-12-12 16:08:16 +01:00
Stein Magnus Jodal
1707d6ae6e local: Fix typo 2012-12-12 15:43:16 +01:00
Stein Magnus Jodal
c8a068b02c local: Support tag caches with urlencoded paths
This adds support for loading tag caches where the "file:" field has urlencoded
paths. For old tag caches without the urlencoding, this is a noop. Thus, old
tag caches continues to work.
2012-12-12 15:10:29 +01:00
Matt Bray
30a5fd06c2 Fix for updates to pyspotify
Pyspotify now creates the session in
`pyspotify.SpotifySessionManager.__init__` (rather than in `.connect`) -
see [here][1].  Therefore it seems best not to set `self.session = None`
in `mopidy.SpotifySessionManager.__init__` or `self.session = session`
in `logged_in`.

[1]: 483f757430 (L1R39)
2012-12-10 00:07:27 +00:00
Stein Magnus Jodal
ac6cecd2f8 backends: Add BackendListener.on_event() 2012-12-01 11:21:06 +01:00
Stein Magnus Jodal
0b9ee92edb local: Change log level from error to warning 2012-11-28 21:14:44 +01:00
Stein Magnus Jodal
6a0e9aa69c spotify: Playlist refresh hack should not be active after first run 2012-11-26 15:22:31 +01:00
Stein Magnus Jodal
6403e3e3d1 spotify: Reuse artist, album, and track models
This adds a module-level cache of artist, album, and track models, whose
content is almost entirely static. This cache is used when we convert from
pyspotify to Mopidy objects.

Previously, an album with 15 tracks would create 15 track objects, 15 artists
objects on the tracks, 15 album objects on the tracks, and 15 artist objects on
the 15 album objects, in total 60 objects. With this change, we only create 15
track objects, 1 album object, and 1 artist object, in total 17 objects.

Measurements with 90 playlists containing about 6500 tracks in total shows that
this reduces the number of Artist objects from 13600 to 3800, and the number of
Album objects from 6500 to 4500 objects.

An unscientific measurement of memory usage using ps(1) indicated a reduction
in RSS from 71MB to 65MB, measured right after the Spotify playlists was loaded
the first time.
2012-11-23 12:48:41 +01:00
Stein Magnus Jodal
5fbb6328d6 mpd: list shouldn't return blank artist names, album names, or dates 2012-11-21 00:48:08 +01:00