Commit Graph

2954 Commits

Author SHA1 Message Date
Stein Magnus Jodal
f244d94b52 main: Split main() function in two
By separating the teardown procedures for errors that happens before and after
actors are started, we get a lot less output when failing on config errors.
This makes the config errors the last lines printed by the `mopidy` command,
making them easier to spot.

Related to #467
2013-09-16 23:22:11 +02:00
Stein Magnus Jodal
7cd7216b94 Create empty config file if none found (see #467)
We already had code in place for this, but it was run after the config
validation, so on a new installation Mopidy would fail because of missing
config values before the config file was created.
2013-09-16 22:27:54 +02:00
Stein Magnus Jodal
1a02b4d17f Remove support for running Python on the mopidy/ dir
It doesn't make sense to run Mopidy without extensions registered, thus you'll
need to use setuptools and to run `python setup.py develop` anyway. Doing so
makes running `mopidy` from anywhere in the development virtualenv work,
removing any need for running `python mopidy/`.
2013-09-16 22:13:36 +02:00
Stein Magnus Jodal
e830f31480 Fix too broad truthness test (fix #501)
This caused TlTracks with tlid=0 to be sent to HTTP clients without the tlid
field.
2013-09-16 21:58:23 +02:00
Stein Magnus Jodal
05d4fa846f config: Deserialize Secret to unicode (fix #473)
MPD, Scrobbler, and Spotify extensions have been reviewed for need for changes
due to this, without anything being found.
2013-09-15 23:51:41 +02:00
Javier Domingo Cansino
7ae4adddeb Merge branch 'develop' into tidy-up-core 2013-09-12 11:41:01 +02:00
Javier Domingo
a443348d4b mpd: Don't decide the remove action
Those three lines shouldn't be there. That is tracklist/playback logic, not frontend logic. Indeed, care is already taken in core =)
2013-09-06 16:54:36 +02:00
Stein Magnus Jodal
9af4290f45 mpd: Accept listall and listallinfo without the URI argument 2013-09-01 23:14:30 +02:00
Javier Domingo Cansino
fa20214bbe Merge branch 'develop' into tidy-up-core 2013-08-19 15:20:26 +02:00
Pavol Babincak
0098e76dc7 Properly encode localised mixer names before log 2013-08-15 20:54:10 +02:00
Javier Domingo Cansino
157556a001 docs: Documenting further the TracklistController functions 2013-08-13 09:17:50 +02:00
Javier Domingo Cansino
21f3a8784a mpris: Correcting get_CanGoPrevious to get() the future instead of passing it.
The failure was invisible to testcases
2013-08-12 15:42:23 +02:00
Javier Domingo Cansino
7af86d65ac Merge branch 'develop' into tidy-up-core
Git was not correctly identifying the merge and threw a conflict
2013-08-12 13:41:15 +02:00
Javier Domingo Cansino
11d82056a9 core: Merged tracklist_position to index inside TracklistController
docs: Updated changelog.rst
2013-08-09 09:15:54 +02:00
Javier Domingo Cansino
fac2c8af7d format: Correcting flake8 messages 2013-08-09 08:32:01 +02:00
Stein Magnus Jodal
404fb00235 Remove pylint remnants 2013-08-08 21:12:42 +02:00
Stein Magnus Jodal
5c7a496dc2 Fix flake8 warnings 2013-08-08 21:09:01 +02:00
Javier Domingo Cansino
782a6a7d1f Renamed tl_track_at_* to more readable names 2013-08-08 17:01:24 +02:00
Javier Domingo Cansino
cb4130c2a7 core: Moving the trigger activation from one playback to tracklist 2013-08-08 13:45:36 +02:00
Javier Domingo Cansino
694db515e4 Merge branch 'develop' into tidy-up-core 2013-08-08 13:19:01 +02:00
Javier Domingo Cansino
2cb64b365d docs: Documenting changed and created functions 2013-08-08 13:13:52 +02:00
Javier Domingo Cansino
ab85dd9d62 Changed mark_consumed to a flexible mark() function that currently allows to mark songs as consumed (that have been played full time), played (that have been played for some time) and unplayable 2013-08-08 12:12:37 +02:00
Javier Domingo Cansino
2c83225a1e Created a TracklistController to let it control wether if a track must be consumed or not 2013-08-08 11:56:35 +02:00
Javier Domingo Cansino
6e61f2ef85 Refactoring code to convert tl_track_at_previous() in a function, also recoded
tests.
2013-08-07 21:53:46 +02:00
Javier Domingo Cansino
6abcad3e55 Converting tl_track_at_next into a function that takes the track argument.
Rewrote tests too.
2013-08-07 21:38:16 +02:00
Javier Domingo Cansino
ec716fba82 Converting tl_track_at_eot property in function with the track having to be
given as an argument
2013-08-07 19:44:00 +02:00
Javier Domingo Cansino
5a87d219ff Correcting some self-arounds that were innecesary. 2013-08-07 18:00:33 +02:00
Javier Domingo Cansino
68ea483c7b Converted tracklist_position() to be called with the track one wants to have information of,
/mopidy/frontends/mpd/protocol/status.py@189 should be checked for gathering a value before
the rest.
2013-08-07 17:50:22 +02:00
Stein Magnus Jodal
74ab07cc6c mpris: Frontend setup failure should only yield a warning 2013-08-07 13:09:44 +02:00
Javier Domingo Cansino
4db3999371 Cleanup of PlaybackController to be more specific on the current track and
moved those functions to TracklistController, which may control all related
to the tracks. Updated tests too.
2013-08-07 10:44:22 +02:00
Stein Magnus Jodal
091f8ffdf0 Merge pull request #486 from alzeih/develop
Strip invalid characters from playlist names sent through MPD frontend

Fix #474
Fix #480
2013-08-06 03:52:21 -07:00
alzeih
7182f98843 cleanup tests and code
- move tests to tests/frontends/mpd/stored_playlists_test.py

stored_playlists_test.py:
- rename test methods names to remove _config
- remove unnecessary imports, setup, teardown, variables
- sort remaining imports

mopidy/frontends/mpd/dispatcher.py:
- remove regex comment
2013-08-06 21:14:23 +12:00
Stein Magnus Jodal
80d122ff92 Merge branch 'develop' of github.com:mopidy/mopidy into develop
Conflicts:
	docs/changelog.rst
2013-08-05 23:33:08 +02:00
Stein Magnus Jodal
7973acf076 Merge branch 'feature/scanner_fix_deadlock' into develop
Fixes #476, #483
2013-08-05 23:31:27 +02:00
Stein Magnus Jodal
f35b45bf57 scanner: Fix time unit in log message. Formatting 2013-08-05 23:24:43 +02:00
Stein Magnus Jodal
e2bec79220 scanner: Reorder config values 2013-08-05 23:19:39 +02:00
Stein Magnus Jodal
022bcd089f scanner: Fix unregistering of the timeout callback 2013-08-05 23:18:37 +02:00
Stein Magnus Jodal
a5d8f02454 scanner: Fix local/scan_timeout value check 2013-08-05 23:18:07 +02:00
Thomas Adamcik
0ce791f215 Merge branch 'develop' into feature/local-uris 2013-08-05 22:41:37 +02:00
Stein Magnus Jodal
f0b69c3394 Merge remote-tracking branch 'adamcik/feature/visualization' into develop
Conflicts:
	docs/changelog.rst
2013-08-05 22:41:09 +02:00
alzeih
3f1192e95b Match MPD implementation and add tests 2013-08-02 13:38:52 +12:00
alzeih
ac9acaabf0 typo in regex 2013-08-02 01:32:07 +12:00
Tobias Sauerwein
dee0d01e20 Throw an error when scan_timeout config is not loaded. 2013-08-01 09:31:44 +02:00
Thomas Adamcik
20729eabe3 audio: Add visualiser support and adjust playbin flags
Sets up playbin to use just audio, soft_volume and downloading.
2013-07-31 23:55:59 +02:00
Tobias Sauerwein
3c6a0543f5 Scanner: Fix deadlock on incorrectly identified files 2013-07-31 23:52:24 +02:00
Alexandre Petitjean
97848bc1a2 String config value can be optionnal AND have a choices list
Integer value can be optionnal
2013-07-31 10:05:20 +02:00
Thomas Adamcik
6ac62c6869 local: Review fixes. 2013-07-30 22:59:22 +02:00
Alexandre Petitjean
bb3242d15a correct default port config for proxy and deserialize function 2013-07-30 08:37:24 +02:00
Alexandre Petitjean
f9da3fe3e9 implement remarks for #481, also add scheme as requested in #472 2013-07-30 08:17:10 +02:00
alzeih
6c7566a2f3 Strip invalid characters from playlist names for MPD frontend
Fixes mopidy/mopidy$480 and mopidy/mopidy#474
2013-07-30 13:57:29 +12:00
Thomas Adamcik
18ed7c6279 local: Convert mopidy-local extension to local: uris.
- Use local:playlist:<name>, local:track:<path> and local:search uris
- Adds LocalPlaybackProvider which translates to file uris.
- Switches to storing actual uris in playlists - so local: urls and not
  file:// or plain paths.
- Moved file:// to streaming plugin
- Cleaned up tests and imports for these changes.
2013-07-30 00:40:12 +02:00
Thomas Adamcik
6818e20218 utils: Convert path_to_uri to single argument 2013-07-30 00:23:23 +02:00
Thomas Adamcik
af707dfdbb utils: Switch to urlparse for file-uri/path handling 2013-07-30 00:23:23 +02:00
Thomas Adamcik
bc4935bfcb backends: Add change track helper to playback provider 2013-07-30 00:22:57 +02:00
Thomas Adamcik
3cfa6c3bc0 local: Remove updater from backends 2013-07-30 00:21:55 +02:00
Thomas Adamcik
c2cc9f027c local: Switch to using updater from extensions 2013-07-30 00:21:55 +02:00
Thomas Adamcik
dfcb49a8ba ext: Add library updaters to extensionss 2013-07-30 00:21:55 +02:00
Alexandre Petitjean
05733cf844 correct remarks from #481 2013-07-29 22:22:28 +02:00
Alexandre Petitjean
de80c33753 Add proxy/port to configuration 2013-07-29 09:57:32 +02:00
alzeih
47c26acf57 spotify folders not necessary as a positional arg
- rename to folders
- remove confusing None for starred playlists
2013-07-28 23:53:47 +12:00
alzeih
c4dcef81b4 - use path separators instead of square brackets
- use generator expression instead of list comprehension
- fix bug for empty but not None list of folders
2013-07-28 22:42:15 +12:00
alzeih
c58de5aa75 workaround for mopidy/mopidy#62 - appends folder names to playlist 2013-07-28 16:42:16 +12:00
Stein Magnus Jodal
2f94b5d219 mpd: Remove remnants of Python 2.6 support 2013-07-26 12:45:10 +02:00
Tobias Sauerwein
a372df8333 Scanner: Add disc number to album and track models (fixes #318) 2013-07-26 12:20:29 +02:00
Stein Magnus Jodal
579a93437f mpd: Allow full MPD queries to 'count'
Fix hechtus/mopidy-gmusic#1
2013-07-09 11:48:11 +02:00
Stein Magnus Jodal
99eed0e6b8 mpd: Allow 'count' without quotes around the 'tag' param
Fix hechtus/mopidy-gmusic#1
2013-07-09 11:22:45 +02:00
Thomas Adamcik
6e942a92b3 audio: Post an error if an urilist expands to another urilist 2013-07-04 17:49:10 +02:00
Stein Magnus Jodal
0a61b4642e Merge branch 'master' into develop
Conflicts:
	docs/changelog.rst
2013-07-01 11:53:45 +02:00
Stein Magnus Jodal
cb561519db Bump version number to 0.14.2 2013-07-01 11:50:06 +02:00
Stein Magnus Jodal
2ad1bb8bb3 config: Raise ValueError if Path is asked to serialize unicode
If we accept unicode and try to encode using sys.getfilesystemencoding() then
it may work most of the time, but will fail if we get non-ASCII chars in the
unicode string and the file system encoding is e.g. ANSI-something because the
locale is C. Thus, I figure it is better to always fail if we try to serialize
Path from unicode strings. Paths should be maintained as bytes all the time.
2013-06-27 00:08:05 +02:00
Stein Magnus Jodal
59e3b9aec3 config: Formatting 2013-06-27 00:07:57 +02:00
Thomas Adamcik
f3051c9dd3 audio: Only install icysrc when nothing is already supporting the scheme 2013-06-26 23:34:55 +02:00
Thomas Adamcik
0bcb805cf5 audio: Improve xml playlist handling 2013-06-26 23:31:53 +02:00
Thomas Adamcik
f67aa95c2e audio: add basic .asx support 2013-06-26 22:29:13 +02:00
Thomas Adamcik
d3f97c128c audio: Review cleanups 2013-06-02 16:03:29 +02:00
Thomas Adamcik
a112275c25 audio: Add IcySrc.
Quick hack that wraps a regular HTTP src in a custom bin that converts icy://
to http:// - this is needed to get for instance http://somafm.com/m3u/groovesalad.m3u
to work.
2013-05-29 00:18:23 +02:00
Thomas Adamcik
a2b95c3a3a audio: Cleanup playlists elements docs and interace. 2013-05-28 23:54:23 +02:00
Thomas Adamcik
acbaab59e5 audio: A uri list element.
This element "simply" takes the list of uris that our other elements have
already converted to simpler format, picks the first uri and play it. This
is done by ensuring that we block the right EOS messages, and all new segment
messages from the original sources. With these events blocked we can inject
our own nested uridecodebin to play the uri and push our own data. The nested
uridecodebin is setup with caps('any') to ensure that we don't suddenly demux
and end up with multiple streams by accident.
2013-05-28 23:35:47 +02:00
Thomas Adamcik
e2f9a3bad6 audio: Add playlist decoders.
These elements convert their respective formats to an urilist that we can
handle in a genric way.
2013-05-28 23:35:47 +02:00
Thomas Adamcik
1138ff8793 audui: Add BasePlaylistElement
This element is the building block for the "decoders" that will convert
the m3u, pls and xspf files to urilists and also the urilist player.
2013-05-28 23:35:47 +02:00
Thomas Adamcik
0f749702c4 audio: Add simple parsers for m3u, pls, xspf and uri lists.
These parsers, and the detectors should probably be moved out at some point,
but for now the simple version of these will do.
2013-05-28 23:35:47 +02:00
Thomas Adamcik
c376ac4183 audio: Start adding playlist typefinder code.
This allows gstreamer pipelines to determine when they are getting m3u, pls or
xspf files and distinguish them from text/plain content.
2013-05-28 23:06:12 +02:00
Thomas Adamcik
71618f840f scanner: Fixing review comments. 2013-05-22 20:36:39 +02:00
Thomas Adamcik
98bb35d4d1 scanner: Convert to using library updater.
This version of the scanner switches to using the updater API, in other words
we are now fairly close to being able to plug in alternate libraries for local
files and populate them with mopidy-scan.
2013-05-20 23:54:48 +02:00
Thomas Adamcik
00e88361f3 local: Add library update provider for tag caches.
This adds the basic interface implemenations for supporting tag caches using
the new update APIs.
2013-05-20 23:53:38 +02:00
Thomas Adamcik
7f80a188c9 core: Add library updater.
Idea behind this class is to have a clear sub-set of our library API that is
only used for updating libraries. This makes it very clear what methods are
needed for just libaries and additionally updatable libraries.

Next couple of commits will build on this idea taking us closer to plugable
local libraries.
2013-05-20 23:50:46 +02:00
Thomas Adamcik
5961a1f5c8 scanner: Write tag cache to tmp file.
Tag cache is now output to a tmp file residing in the same folder as the real
one. Once generated the tmpfile is moved over the original file for an atomic
updated.
2013-05-20 22:56:09 +02:00
Thomas Adamcik
351589c6c8 path: Add find_uris version of find_files 2013-05-20 22:42:31 +02:00
Thomas Adamcik
b4411ec877 scanner: Update based on review comments. 2013-05-20 15:28:41 +02:00
Thomas Adamcik
afb46b23de scanner: Respect mtime when picking files to scan.
Speedup scanning by checking what files exist, and which have been updated.
2013-05-20 01:45:52 +02:00
Thomas Adamcik
cb6634db8c scanner: Load existing tracks from local library. 2013-05-20 01:42:54 +02:00
Thomas Adamcik
c59f488b11 scanner: Pass in files to scan 2013-05-20 01:42:48 +02:00
Thomas Adamcik
802e6ad5ed scanner: Add last_modified to scanner data 2013-05-20 01:10:11 +02:00
Thomas Adamcik
855d03c81e local: start reading mtime from tag caches 2013-05-20 00:58:43 +02:00
Thomas Adamcik
b3b41240a1 core: Add last_modified to track model 2013-05-19 23:47:53 +02:00
Thomas Adamcik
cdbe1c9cd1 config: Review fixes. 2013-05-14 21:24:37 +02:00
Thomas Adamcik
9bd4d90e41 config: Keyring debug logging cleanup 2013-05-14 00:21:05 +02:00
Thomas Adamcik
b88cf4a8b2 config: Integrate keyring values with overrides. 2013-05-13 23:51:17 +02:00
Thomas Adamcik
474600cf2a config: Add keyring module with fetch and set.
New config submodule for fetching secrets from a secrets service over dbus. To
facilitate this we add a section and key to the stored attributes, allowing us
to fetch all mopidy values from the keyring and map them to the correct config
values.

A helper for setting values is also added. Due to differences in in the secrets
dbus API across versions of the APIs and various states of support in the
secrets service we try and open the default, login and finally session
keyrings for storage.

Locked keyrings will be dismissed for all operations.
2013-05-13 23:14:49 +02:00
Stein Magnus Jodal
f7234a6128 commands: Fix verbose mode
argparse and optparse differs in how action='count', default=1 is interpreted.
2013-05-04 15:55:25 +02:00