Commit graph

50 commits

Author SHA1 Message Date
Aksh Gupta
79858975a9 chore: refactor code quality issues 2021-03-11 08:45:42 +05:30
Quentin Young
bf87cab1d8 beetsplug: implement missing -a -t
Produces a count of missing albums without listing them

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
2017-03-18 19:05:46 -04:00
Quentin Young
b013abae6b beetsplug: cleanup for 'missing -a' code
* Use full name for musicbrainzngs import
* Use beets internal logging facilities
* Match releases by release id
* Convert some strings to Unicode
* Remove unnecessary MB rate-limiting
* Remove unnecessary imports
* Follow beets convention for `--album` option
* Follow beets convention for imperative docstrings
* Simplify method signatures
* Use defaultdict(list) where appropriate
* Clarify missing MBID log message

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
2017-03-18 18:58:41 -04:00
Quentin Young
339a1ef671 beetsplug: add '-a' to show missing albums to 'missing' plugin
Passing -a to 'beet missing' shows albums missing by all artists
in the library.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
2017-03-18 17:52:01 -04:00
root
f37df2dbd4 Whitespace for flake8. 2016-11-08 16:56:13 -08:00
root
acd5c6404f missing plugin, modify "missing" attribute by modifying album_types,
making it of type INTEGER. also changelog for above.
2016-11-08 16:23:57 -08:00
Johnny Robeson
790b1b5153 replace some filter/map calls with list comps
These are places where the surrounding/calling code needs a list, not an iter.
2016-06-08 00:17:18 -04: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
Pedro Silva
13d65f9c37 fix default format from config
The (automated?) change to add_format_option had broken the existing
formating logic
2015-03-28 17:23:11 +01:00
David Logie
ee6fba1e82 Fix call to add_format_option() missing plugin. 2015-03-08 12:59:00 +00: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
060c275fd3 Merge branch 'master' into libmodels-formatting
Conflicts:
	beetsplug/embedart.py
2015-01-26 10:17:15 +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
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
Heinz Wiesinger
c86a5f9d97 Make tracktotal an item-level field.
This fixes tracktotal being stored incorrectly for multi-disc releases
where the individual discs have a different number of tracks and
per_disc_numbering is enabled.
2015-01-19 13:02:21 +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
32673b87e7 Update multiple plugins: pass the logger around 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
Heinz Wiesinger
ec56f2bbd4 Make 'media' an item level field.
Releases can consist of discs of various media types, most typically
CD/DVD combo releases. Having the media value an album level field
forces all discs to be of the same type. Making it an item level
field instead seems to be the proper thing to do here.

Fixes #161
2014-10-12 12:21:13 +02:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
66aee8094f Clean up of logging messages as described here
All logging now prefers the ' (single quote) over the " (double quote)

https://github.com/sampsyo/beets/wiki/Hacking
2014-09-09 11:28:43 +10:00
Adrian Sampson
e21c04e912 flake8-cleanliness in missing
This is a little bit dumb, but one way to get the style checker to accept the
nice alignment in this plugin is to make it a dict.
2014-04-13 17:59:17 -07:00
Adrian Sampson
fac13a041e missing: tolerate disctotal == None
This problem:
http://pastebin.ca/2466454
is likely indicative of a bug elsewhere, but defensive coding seems like a
good idea here.
2013-10-13 18:22:43 -07:00
Adrian Sampson
2e2e0b2919 get_album (and evalute_template) with non-DB items
Alternative fix for #403.
2013-10-05 11:06:08 -07:00
Pedro Silva
89c0e2c8b7 Fix issue #403
hack around items needing library and id references since 238e743
2013-10-05 15:55:44 +02:00
Adrian Sampson
38f1e6aec2 new FlexModel base class
I intend to use this for both Item and Album to avoid code duplication and
simplify code that uses both entities.
2013-08-16 17:22:17 -07:00
Pedro Silva
13dc28b349 Fix zero length field error under Python 2.6
* missing.py (_missing): add field indexes to format spec
* duplicates.py (commands): add field indexes to format spec
2013-06-14 13:59:14 +01: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
Tai Lee
ee0c00708b Quick fix for a couple other places that were expecting hooks._album_for_id()` to return a single result.
It's possible that these plugins might require a little more thought
into how they should work (or not work) with potentially multiple albums
matching an idea, and potentially those those albums being an incorrect
match (e.g. if two data source plugins share a simple numerical ID
format).
2013-05-31 00:05:24 +10:00
Adrian Sampson
a0cb31956d distinguish Album and Item template fields
An earlier change (due to @pedros) added the ability for plugins to define
template fields that work with Albums as well as Items. This enables some
cool new use cases but required that every template field definition check the
type of its arguments. Instead, this iteration on the idea distinguishes
between fields meant for Items and those meant for Albums.

In addition to simplifying the implementation of these functions, this also
enables the creation of album fields with identical names to item fields.
(For example, a user contacted me recently about adding a $bitrate field for
albums, which would be the average bitrate of the items. They can do this now
using a plugin.)

I also changed the docs to stop using the decorator approach to registering
template fields. We're moving toward removing those.
2013-05-28 22:30:23 -07:00
Adrian Sampson
1ffc56b85a doc correction and refactoring for #275
Plugin-provided template fields are not available for queries. (Perhaps they
should be, though!)
2013-05-17 12:07:53 -07:00
Pedro Silva
a48fde9f2c Use newly defined '$missing' template field instead of hardcoded format (-c) 2013-05-15 15:09:00 +01:00
Adrian Sampson
f086fb6fd7 changelog, little style tweak for #272
Changed single-triple quotes to double-triple quotes, just for consistency
with the rest of the codebase.
2013-05-10 22:23:24 -07:00
Pedro Silva
b2d8f04f05 Modify "not part of beets" to "part of beets" 2013-05-10 16:50:34 +01:00
Pedro Silva
763cfa06b4 Don't check for item.paths == None as that can't happen 2013-05-10 16:43:17 +01:00
Pedro Silva
d32a3ef9b5 Implement logic for displaying missing track counts 2013-05-10 16:42:45 +01:00
Pedro Silva
69877f2013 Add 'count' and 'total' parameters
- count: count missing tracks per album
- total: count total missing tracks
2013-05-10 16:42:10 +01:00
Pedro Silva
bed7c5ae88 Add _missing_count function 2013-05-10 16:41:04 +01:00
Pedro Silva
abe12be4b2 Remove unneeded Library argument from _missing 2013-05-10 16:06:30 +01:00
Pedro Silva
18e2704ffb Remove unnecessary _format function 2013-05-10 14:23:32 +01:00
Pedro Silva
6ae73bc921 Initial import of missing tracks plugin
This plugin adds a new command, ``missing`` or ``miss``, which finds
and lists, for every album in your collection, which tracks are
missing.
2013-05-10 14:13:53 +01:00