Commit graph

75 commits

Author SHA1 Message Date
Andrew Rogl
1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Aksh Gupta
79858975a9 chore: refactor code quality issues 2021-03-11 08:45:42 +05:30
Rahul Ahuja
ce90b2aae5 Improve documentation 2019-10-05 15:07:20 -07:00
Rahul Ahuja
14b8f30ead Appease flake8 2019-10-03 19:13:40 -07:00
Rahul Ahuja
f14137fcc2 Add BPSyncPlugin 2019-10-03 18:04:12 -07:00
Adrian Sampson
8b59b20ef8 Tiny style fix for #3028 2018-09-16 20:56:06 -04:00
Andrew Rogl
865940746c More clean up requests 2018-09-11 18:52:55 +10:00
Andrew Rogl
308dccab95 Address requested changes from Adrian 2018-09-10 20:47:58 +10:00
Andrew Rogl
c43a957f46 Clean up flake errors 2018-09-09 15:48:07 +10:00
Andrew Rogl
919f3f9c34 mbsync no longer queries MusicBrainz when the either the mb_albumid or mb_trackid field is invalid 2018-09-09 15:20:26 +10:00
Bin Jin
69d6dfe097 mbsync: fix updating album with invalid first track MBID
MBID of recording could become invalid after merging. The existing
code always copies metadata from first track after updating. But for
albums with invalid track MBID that happens to be the first track,
MusicBrainz changes won't be applied to whole album, only whose
tracks with valid MBID. This is particularly annoying since those
changes are actually displayed for every `beet mbsync` run, but never
get applied.

Fix this issue by finding any track that get MusicBrainz updates, and
apply it to whole album.
2018-05-10 16:38:30 +08:00
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