Skip to content

Commit

Permalink
Merge branch 'master' into spectral_music
Browse files Browse the repository at this point in the history
* master: (246 commits)
  Fix beetbox#1896 (bungled fix to beetbox#1895)
  Minor docs refinements for beetbox#1894
  Human-readable message in non-pretend mode (beetbox#1894)
  changelog entry for new convert.album_art_maxwidth option
  tweaks for style, option name
  Fix beetbox#1895: don't assume SC data is bytes
  Slightly more logical instruction placement
  Update ISSUE_TEMPLATE.md
  doc note for new copy_album_art_maxwidth option
  revert a chunk of the work to be the way it was
  better text for artwork resize/copy logs
  fix indentation
  add copy_album_art_maxwidth config option to convert plugin
  move and split fetchart valid_image
  Fix beetbox#1891: Missing `syspath` in `beet stats -e`
  Suggest ways to describe problems
  Start an issue template
  beet import: there is no such option: -M
  Grammar/formatting refinement for beetbox#1878
  fix documentation error
  ...
  • Loading branch information
shamangeorge committed Mar 1, 2016
2 parents cb1d817 + 48659c5 commit b8ef5bc
Show file tree
Hide file tree
Showing 166 changed files with 2,803 additions and 609 deletions.
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
### Problem

(Describe your problem, feature request, or discussion topic here. If you're reporting a bug, please fill out this and the "Setup" section below. Otherwise, you can delete them.)

Running this command in verbose (`-vv`) mode:

```sh
$ beet -vv (... paste here ...)
```

Led to this problem:

```
(paste here)
```

Here's a link to the music files that trigger the bug (if relevant):


### Setup

* OS:
* Python version:
* beets version:
* Turning off plugins made problem go away (yes/no):

My configuration (output of `beet config`) is:

```yaml
(paste here)
```
7 changes: 0 additions & 7 deletions .hgignore

This file was deleted.

29 changes: 0 additions & 29 deletions .hgtags

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2010-2015 Adrian Sampson
Copyright (c) 2010-2016 Adrian Sampson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Include tests (but avoid including *.pyc, etc.)
prune test
recursive-include test/rsrc *
recursive-exclude test/rsrc *.pyc
recursive-exclude test/rsrc *.pyo
include test/*.py

# Include relevant text files.
Expand Down
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. image:: https://travis-ci.org/sampsyo/beets.svg?branch=master
:target: https://travis-ci.org/sampsyo/beets
.. image:: https://travis-ci.org/beetbox/beets.svg?branch=master
:target: https://travis-ci.org/beetbox/beets

.. image:: http://img.shields.io/codecov/c/github/sampsyo/beets.svg
:target: https://codecov.io/github/sampsyo/beets
.. image:: http://img.shields.io/codecov/c/github/beetbox/beets.svg
:target: https://codecov.io/github/beetbox/beets

.. image:: http://img.shields.io/pypi/v/beets.svg
:target: https://pypi.python.org/pypi/beets
Expand Down Expand Up @@ -79,7 +79,7 @@ news and updates.
You can install beets by typing ``pip install beets``. Then check out the
`Getting Started`_ guide.

.. _its Web site: http://beets.radbox.org/
.. _its Web site: http://beets.io/
.. _Getting Started: http://beets.readthedocs.org/page/guides/main.html
.. _@b33ts: http://twitter.com/b33ts/

Expand Down
2 changes: 1 addition & 1 deletion beet
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

# This file is part of beets.
# Copyright 2015, Adrian Sampson.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
Expand Down
4 changes: 2 additions & 2 deletions beets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
Expand All @@ -20,7 +20,7 @@
import beets.library
from beets.util import confit

__version__ = '1.3.16'
__version__ = '1.3.18'
__author__ = 'Adrian Sampson <adrian@radbox.org>'

Library = beets.library.Library
Expand Down
2 changes: 1 addition & 1 deletion beets/art.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
Expand Down
2 changes: 1 addition & 1 deletion beets/autotag/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
Expand Down
2 changes: 1 addition & 1 deletion beets/autotag/hooks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
Expand Down
54 changes: 31 additions & 23 deletions beets/autotag/match.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
Expand Down Expand Up @@ -370,7 +370,7 @@ def _add_candidate(items, results, info):


def tag_album(items, search_artist=None, search_album=None,
search_id=None):
search_ids=[]):
"""Return a tuple of a artist name, an album name, a list of
`AlbumMatch` candidates from the metadata backend, and a
`Recommendation`.
Expand All @@ -380,8 +380,11 @@ def tag_album(items, search_artist=None, search_album=None,
The `AlbumMatch` objects are generated by searching the metadata
backends. By default, the metadata of the items is used for the
search. This can be customized by setting the parameters. The
`mapping` field of the album has the matched `items` as keys.
search. This can be customized by setting the parameters.
`search_ids` is a list of metadata backend IDs: if specified,
it will restrict the candidates to those IDs, ignoring
`search_artist` and `search album`. The `mapping` field of the
album has the matched `items` as keys.
The recommendation is calculated from the match quality of the
candidates.
Expand All @@ -397,9 +400,11 @@ def tag_album(items, search_artist=None, search_album=None,
candidates = {}

# Search by explicit ID.
if search_id is not None:
log.debug(u'Searching for album ID: {0}', search_id)
search_cands = hooks.albums_for_id(search_id)
if search_ids:
search_cands = []
for search_id in search_ids:
log.debug(u'Searching for album ID: {0}', search_id)
search_cands.extend(hooks.albums_for_id(search_id))

# Use existing metadata or text search.
else:
Expand Down Expand Up @@ -444,35 +449,38 @@ def tag_album(items, search_artist=None, search_album=None,


def tag_item(item, search_artist=None, search_title=None,
search_id=None):
search_ids=[]):
"""Attempts to find metadata for a single track. Returns a
`(candidates, recommendation)` pair where `candidates` is a list of
TrackMatch objects. `search_artist` and `search_title` may be used
to override the current metadata for the purposes of the MusicBrainz
title; likewise `search_id`.
title. `search_ids` may be used for restricting the search to a list
of metadata backend IDs.
"""
# Holds candidates found so far: keys are MBIDs; values are
# (distance, TrackInfo) pairs.
candidates = {}

# First, try matching by MusicBrainz ID.
trackid = search_id or item.mb_trackid
if trackid:
log.debug(u'Searching for track ID: {0}', trackid)
for track_info in hooks.tracks_for_id(trackid):
dist = track_distance(item, track_info, incl_artist=True)
candidates[track_info.track_id] = \
hooks.TrackMatch(dist, track_info)
# If this is a good match, then don't keep searching.
rec = _recommendation(candidates.values())
if rec == Recommendation.strong and not config['import']['timid']:
log.debug(u'Track ID match.')
return candidates.values(), rec
trackids = search_ids or filter(None, [item.mb_trackid])
if trackids:
for trackid in trackids:
log.debug(u'Searching for track ID: {0}', trackid)
for track_info in hooks.tracks_for_id(trackid):
dist = track_distance(item, track_info, incl_artist=True)
candidates[track_info.track_id] = \
hooks.TrackMatch(dist, track_info)
# If this is a good match, then don't keep searching.
rec = _recommendation(sorted(candidates.itervalues()))
if rec == Recommendation.strong and \
not config['import']['timid']:
log.debug(u'Track ID match.')
return sorted(candidates.itervalues()), rec

# If we're searching by ID, don't proceed.
if search_id is not None:
if search_ids:
if candidates:
return candidates.values(), rec
return sorted(candidates.itervalues()), rec
else:
return [], Recommendation.none

Expand Down
4 changes: 2 additions & 2 deletions beets/autotag/mb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
Expand Down Expand Up @@ -33,7 +33,7 @@
BASE_URL = 'http://musicbrainz.org/'

musicbrainzngs.set_useragent('beets', beets.__version__,
'http://beets.radbox.org/')
'http://beets.io/')


class MusicBrainzAPIError(util.HumanReadableException):
Expand Down
1 change: 1 addition & 0 deletions beets/config_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import:
flat: no
group_albums: no
pretend: false
search_ids: []

clutter: ["Thumbs.DB", ".DS_Store"]
ignore: [".*", "*~", "System Volume Information"]
Expand Down
2 changes: 1 addition & 1 deletion beets/dbcore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
Expand Down
2 changes: 1 addition & 1 deletion beets/dbcore/db.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
Expand Down
2 changes: 1 addition & 1 deletion beets/dbcore/query.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
Expand Down
Loading

0 comments on commit b8ef5bc

Please sign in to comment.