Commit graph

98 commits

Author SHA1 Message Date
Bruno Cauet
f06c33cb71 Smartplaylist: update only if item changed 2015-03-16 15:16:40 +01:00
Bruno Cauet
4bfa439ee1 database_change: send model that changed 2015-03-16 14:32:37 +01:00
Adrian Sampson
b8dab9cf9f Merge pull request #1247 from brunal/future
Use all __future__ imports in beets core

Conflicts:
	beetsplug/web/__init__.py
	test/test_embedart.py
2015-01-26 17:02:07 -08:00
David Logie
29de697a8d Fix bug where playlists were not created in subdirs.
Playlist names containing path separators would cause beets to crash if
the parent directories for the playlist didn't already exist.
2015-01-24 13:00:25 +00:00
Bruno Cauet
1e0185188a Smartplaylist: fix song path writing (str → bytes) 2015-01-21 10:36:45 +01:00
Bruno Cauet
a5026100a3 All plugins use unicode_literals
Given that part of them has no test I may have broke them
2015-01-20 16:22:27 +01:00
Bruno Cauet
90b388b775 Use __future__ imports but unicode_literals everywhere
Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.

Goal is smoothing the transition to python 3.
2015-01-19 12:25:16 +01:00
Adrian Sampson
c1ce71f35c smartplaylist: Fix album_query (fix #1225)
This is far less elegant and functional, but at least it is correct.
2015-01-14 22:00:30 -08:00
Adrian Sampson
38c5bb3666 Fix a docstring 2015-01-14 21:53:13 -08:00
Bruno Cauet
0d1fa80651 Smartplaylist: don't utf8-encode the name
A Template expression expects an unicode, not an utf8-encoded string.
Add a test for that.
2015-01-14 12:32:00 +01:00
Bruno Cauet
6408904a8c Smartplaylit: fix log format string
{0.name} → {0[name]} since the argument is a dict.
2015-01-14 12:15:44 +01:00
Bruno Cauet
9a2a9b0144 smartplaylist: fix docstring 2015-01-13 18:53:47 +01:00
Bruno Cauet
a7beaa6d6e Clean & shorten smartplaylist code
- better log messages
- more idiomatic code: "X not in Y" instead of "not (X in Y)"
- shorten _items_for_query:
    - pre-detect whether it's album_query or query, hiding conf. spec to
      the function.
    - Let library.{items,album} parse the query string, therefore
      falling back to beets-level sort spec. if none is given in the
      query
2015-01-13 12:11:52 +01:00
Bruno Cauet
7c4496c110 Smartplaylist: log messages instead of printing
ui.print_ → self._log.info

Also change config['smartplaylist'] into self.config
2015-01-13 11:42:23 +01:00
Bruno Cauet
fdb768c9db Simplify smartplaylist flow
Suppress the global variable, register listeners if it's needed only.
2015-01-13 11:31:42 +01:00
Frederik “Freso” S. Olesen
4b1f0cbf48 Happy 2015. ;)
See 7a410f636b

Command used:

    git grep -l 'Copyright 201'|xargs sed -i -E 's/Copyright 201./Copyright 2015/'`
2015-01-08 21:37:09 +01:00
Adrian Sampson
9ce956d648 Accuracy in variable naming (#1138)
That's a Query object, not a string.
2014-12-12 15:41:49 -08:00
David Logie
c09745f75c Remove unused dbcore import. 2014-12-12 23:06:15 +00:00
David Logie
11c60ce101 smartplaylist: Respect sort terms in queries. 2014-12-12 14:38:35 +00:00
Adrian Sampson
80116ccc9e Introduce parse_query_string for the common case
Most clients other than Library._fetch know what type they have!
2014-09-15 18:21:22 -07:00
PierreRust
3130a6add9 Minor changes from review (mostly style) 2014-07-24 12:51:21 +02:00
Pierre Rust
1303a915c1 Sort implementation
* sort can be sepcified using the 'field_name'(+|-) syntax
 * supports fixed fields and flexible attributes
 * includes plugins fix for API changes (might have missed some)
2014-06-15 22:32:25 +02:00
Adrian Sampson
e5a9db1cac fix up some indentation warnings in plugins 2014-04-13 17:55:49 -07:00
Fabrice Laporte
3ead936fe5 flake8 cleaning beetsplug/*
Remaining warnings are related to visual indentation.
2014-04-13 23:24:57 +02:00
Bruno Tournay
865ea40eab Simplified config access 2014-03-10 22:44:38 +01:00
Bruno Tournay
33632e0caf We can now disable auto regeneration of smartplaylist 2014-03-09 22:57:07 +01:00
Adrian Sampson
fb038ecc30 changelog & style tweaks for album_query (#595) 2014-03-09 13:22:34 -07:00
Bruno Tournay
8a73a173df Attempt to factorize duplicate code 2014-03-09 20:15:51 +01:00
Bruno Tournay
05d54b4f23 Added ability to also include in playlist result from query based on albums (album_query parameter). 2014-03-08 21:24:56 +01:00
Adrian Sampson
ab8d008049 use OrQuery for smartplaylist (#575) 2014-03-07 14:38:40 -08:00
Adrian Sampson
f06a16819f spl mutli-query (#575): remove option, changelog 2014-03-07 14:26:49 -08:00
Bruno Tournay
ab513f7bc2 Add the ability to gather the result of ^Cveral queries into a smartplaylist 2014-03-05 21:40:24 +01:00
Adrian Sampson
9ee4adc5e1 move remaining generic Query types to dbcore.query
NumericQuery is still broken. This, of course, is the whole reason for the
change.
2014-01-20 16:40:50 -08:00
Adrian Sampson
04c0bd50fd smartplaylist: use new evaluate_template signature 2013-12-29 12:30:44 -08:00
Adrian Sampson
f82d466b77 eliminate lib argument to Item.evaluate_template 2013-09-17 08:44:26 -07:00
Adrian Sampson
bf904187e2 smartplaylist: split query w/ shlex (fixes #256) 2013-04-21 20:55:07 -07:00
Dang Mai
3be24110d7 Sanitize template evaluation for smartplaylist 2013-02-11 21:37:14 -05:00
Dang Mai
7de2727572 Fix smartplaylist to use lib param from cli_exit 2013-01-31 18:09:17 -05:00
Adrian Sampson
bba0051ee7 changelog & doc tweaks for smartplaylist (#80) 2013-01-31 10:07:18 -08:00
Dang Mai
397ad441a8 Remove debugging statement
Silly me for forgetting to check the pdb statement I just put in ...
2013-01-30 21:28:54 -05:00
Dang Mai
f5838692d7 Add default for playlist_dir 2013-01-30 21:27:00 -05:00
Dang Mai
6bc0202354 Add ability to use tag in m3u names 2013-01-30 12:45:56 -05:00
Dang Mai
895ee7de3f Fix playlist_dir not resolving relative path 2013-01-30 09:50:27 -05:00
Dang Mai
5a7d7e1bb5 Change command to splupdate 2013-01-30 09:28:50 -05:00
Dang Mai
d134e9c461 Add comments 2013-01-30 08:42:29 -05:00
Dang Mai
480d51443c Add print statements 2013-01-30 08:31:39 -05:00
Dang Mai
70240bf4b1 Fix optional relative_to 2013-01-30 08:25:18 -05:00
Dang Mai
4312fd3914 Working smart playlist plugin 2013-01-30 08:12:22 -05:00