Commit graph

64 commits

Author SHA1 Message Date
Jérémie Detrey
3b03372502 mbsync: Use release-track-id to construct track mapping.
Fixes #1234 by following recording MBIDs changes.
2018-05-08 16:30:07 +02:00
Ivan Shapovalov
4d40b058d3 treewide: add u to instances of 'singleton:true'
Fixes #1901.
2016-03-06 02:12:43 +03:00
Adrian Sampson
e54c7eec3d Standardize __future__ imports without parentheses
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Peter Kessen
48098c3741 Removed import of unicode_literals from plugins
* lastgenere
* mbcollection
* mbsubmit
* mbsync
* missing
2016-02-20 14:08:05 +01:00
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Peter Kessen
3eb8008b11 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
Adrian Sampson
34e6e39fe5 mbsync: Debug logging
Log *something* for each album, so you can tell that it's doing something even
when there are no changes. To help diagnose #1707.
2015-11-07 15:37:13 -08:00
Adrian Sampson
80bfd186ae Use should_write for modify, update, and mbsync
This should address the surprising situation in #1697, where `import` went
fine but then `update` unexpectedly changed filenames.
2015-11-07 13:34:47 -08:00
Adrian Sampson
9f7aa866bd Use ui.should_write everywhere
There sure are a lot of plugins that want to write metadata!
2015-11-07 13:20:09 -08:00
Bruno Cauet
650305c9a1 All suitable plugins use CommonOptionsParser features 2015-03-05 17:03:02 +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
Bruno Cauet
4e904c78af Simplify LibModel format management
Delete `ui.format_` and then `ui.print_obj`. Simply ensure that when
there is no format it defaults to '' = default format = config option.
2015-01-26 23:09:56 +01:00
Bruno Cauet
62cd6e37aa Update ui.print_obj_(), add ui.format_()
Code now relies on `format()` for items and albums displaying/logging.
`ui.print_()` calls `unicode()` or `str()` on the strings so for most
usages calling `ui.print_(obj)` replaces `ui.print_(obj, lib, None)`.

Where there is a special format `ui.print_(format(obj, fmt))` is fine,
but when `fmt` can be None then one has to call
`ui.print_(ui.format_(obj, fmt))` -- which is what `ui.print_obj` now
does.
2015-01-25 21:07:03 +01:00
Bruno Cauet
c2f8cb9983 Merge branch 'master' into future
Conflicts:
	test/test_plugins.py
2015-01-21 10:04:33 +01:00
David Logie
99e89a29e2 mbsync: Don't overwrite the format built-in. 2015-01-21 08:05:27 +00:00
David Logie
7db3e1d80c mbsync: Fix bug where singletons always used the album format. 2015-01-21 08:05:27 +00:00
David Logie
2fae94a93a Make the Template object an attribute. 2015-01-21 08:05:26 +00:00
David Logie
3317580296 mbsync: Support custom output format. 2015-01-21 08:05:26 +00: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
Bruno Cauet
b27c5304d1 Merge branch 'master' into logging
Conflicts:
	beetsplug/fetchart.py
	beetsplug/mpdstats.py
2015-01-09 15:15:27 +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
Bruno Cauet
203b325ee7 Convert mbsync logging: big funcs → methods 2015-01-06 21:42:09 +01:00
Bruno Cauet
b8211a3c4c Every plugin uses its own logger
logging.getLogger(__name__) everywhere!
Several loggers prefixed every log message with [logername], which we
delete here.
2015-01-06 10:35:44 +01:00
Bruno Cauet
30f158a95e Move "from beets import logging" statements
Move the import next to other beets-related imports
2015-01-05 10:05:21 +01:00
Bruno Cauet
7df8bef8b7 Update logging imports: logging → beets.logging 2015-01-04 17:02:27 +01:00
Bruno Cauet
8cac47af2a Convert beets plugins to lazy logging 2015-01-04 17:02:27 +01:00
Adrian Sampson
e52ca41456 Changelog and style for #908
Use a defaultdict for more idiomatic collection.
2014-08-21 23:11:23 -07:00
Rui Gonçalves
7c196799e5 Add support for releases with multiple versions of the same recording 2014-08-21 23:35:27 +01:00
Adrian Sampson
de1247c7bc query-based fix for #693
This is @geigerzaehler's fix from b868799, just with the typo fixed
(singletons -> singleton).

An alternate (more verbose) fix would have been:

    singletons_query.subqueries.append(
        dbcore.query.BooleanQuery('singleton', True, False)
    )

i.e., pass `False` for the `fast` parameter to indicate that this is not a
fixed-field query.
2014-04-16 10:18:38 -07:00
Thomas Scholtes
0751c560e3 Check for singleton directly 2014-04-16 14:42:19 +02:00
Thomas Scholtes
b8687999e2 Query string for computed fields. Fixes #693 2014-04-16 14:18:07 +02:00
Thomas Scholtes
4e2828668c Refactor mbsync 2014-04-16 14:02:51 +02:00
Adrian Sampson
fb37be44db restore some comments from #684
I wanted to leave a few of these as comments -- they serve more as separators
than as internal documentation.
2014-04-13 17:43:43 -07:00
Fabrice Laporte
3ead936fe5 flake8 cleaning beetsplug/*
Remaining warnings are related to visual indentation.
2014-04-13 23:24:57 +02:00
Adrian Sampson
2ec140edbc fix import path to BooleanQuery (#680) 2014-04-12 13:48:37 -07:00
Kyle Konrad
d044e1773a Replace SingletonQuery with BooleanQuery on computed singleton field.
Updated use in command parsing and mbsync plugin.
2014-04-11 22:20:04 -07:00
Adrian Sampson
271a1627a5 mbsync: call album.save()
This must have been broken as long as album.save() was a necessary call (i.e.,
since the introduction of the dbcore base classes).
2014-04-11 19:50:13 -07:00
Adrian Sampson
4c9daa12cc Merge pull request #676 from geigerzaehler/item-try-write
Add item.try_write() to log errors
2014-04-10 11:33:06 -07:00
Thomas Scholtes
5d753b4f38 Remove ALBUM_* constants. Closes #650 2014-04-10 17:44:39 +02:00
Thomas Scholtes
c3ea1ded30 Add item.try_write() to log errors
Many commands and plugins use `item.write()` to update tags. Since the success
of the call is not critical to the functionality of most consumers we want to
catch any exceptions, log an error and continue with our task. The new method
encapsulates this logic.

This fixes #675.
2014-04-10 15:26:05 +02:00
Adrian Sampson
1253cb695d move show_model_changes to ui package
This makes it more naturally reusable for plugins.
2014-02-22 15:06:16 -08:00
Adrian Sampson
58dd5f47f5 use _show_model_changes in mbsync 2014-02-22 14:37:04 -08:00
Adrian Sampson
22d5e564c6 move move method to model objects 2013-09-16 22:12:26 -07:00
Adrian Sampson
4ee4169349 simplify get_query using class attributes 2013-09-09 20:20:22 -07:00
Adrian Sampson
d80576fec1 get rid of dictionary comprehensions
for Python 2.6 compatibility
2013-08-29 17:07:04 -07:00
Adrian Sampson
343a85d482 mbsync: use separate structure for old_data
Assigning an attribute on Items doesn't really work here since we try to store
that value to the DB as a flexattr.
2013-08-23 14:01:31 -07:00
Adrian Sampson
c7fe017752 remove Library.{move,store} methods
These methods are now provided by LibModel, which makes dealing with items and
albums symmetric.
2013-08-21 15:34:45 -07:00
Adrian Sampson
6677cea036 fix uses of item.dirty and item.record 2013-08-21 10:57:52 -07:00
Adrian Sampson
4624f65ce3 fix interface to ID matching
As outlined in #299, we broke many places in the code that were expecting
_album_for_id and _track_for_id to return a single item rather than a list. I
took this opportunity to divide up the interface: there's now one function for
MBIDs (returning a single object or None) and one for generic IDs (returning a
list).
2013-06-01 17:22:39 -07:00