Skip to content

Commit

Permalink
Merge master back in to fork
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwilsdon committed Apr 18, 2016
2 parents 55bd513 + 30bca5c commit dd949a9
Show file tree
Hide file tree
Showing 202 changed files with 8,321 additions and 3,198 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.

4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
language: python
sudo: false

branches:
only:
- master

matrix:
include:
- python: 2.7
Expand Down
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-2014 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
5 changes: 4 additions & 1 deletion beet
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python
# -*- 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 @@ -14,6 +15,8 @@
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.

from __future__ import division, absolute_import, print_function

import beets.ui

if __name__ == '__main__':
Expand Down
30 changes: 25 additions & 5 deletions beets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +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 @@ -12,14 +13,33 @@
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.

from __future__ import absolute_import, unicode_literals
from __future__ import division, absolute_import, print_function

import os

import beets.library
from beets.util import confit

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

Library = beets.library.Library

config = confit.LazyConfig('beets', __name__)

class IncludeLazyConfig(confit.LazyConfig):
"""A version of Confit's LazyConfig that also merges in data from
YAML files specified in an `include` setting.
"""
def read(self, user=True, defaults=True):
super(IncludeLazyConfig, self).read(user, defaults)

try:
for view in self['include']:
filename = view.as_filename()
if os.path.isfile(filename):
self.set_file(filename)
except confit.NotFoundError:
pass


config = IncludeLazyConfig('beets', __name__)
5 changes: 4 additions & 1 deletion beets/art.py
Original file line number Diff line number Diff line change
@@ -1,5 +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 @@ -16,6 +17,8 @@
music and items' embedded album art.
"""

from __future__ import division, absolute_import, print_function

import subprocess
import platform
from tempfile import NamedTemporaryFile
Expand Down
6 changes: 3 additions & 3 deletions beets/autotag/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +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 @@ -15,8 +16,7 @@
"""Facilities for automatically determining files' correct metadata.
"""

from __future__ import (division, absolute_import, print_function,
unicode_literals)
from __future__ import division, absolute_import, print_function

from beets import logging
from beets import config
Expand Down
38 changes: 29 additions & 9 deletions beets/autotag/hooks.py
Original file line number Diff line number Diff line change
@@ -1,5 +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 @@ -13,8 +14,7 @@
# included in all copies or substantial portions of the Software.

"""Glue between metadata sources and the matching logic."""
from __future__ import (division, absolute_import, print_function,
unicode_literals)
from __future__ import division, absolute_import, print_function

from collections import namedtuple
import re
Expand Down Expand Up @@ -393,7 +393,7 @@ def update(self, dist):
"""
if not isinstance(dist, Distance):
raise ValueError(
'`dist` must be a Distance object, not {0}'.format(type(dist))
u'`dist` must be a Distance object, not {0}'.format(type(dist))
)
for key, penalties in dist._penalties.iteritems():
self._penalties.setdefault(key, []).extend(penalties)
Expand All @@ -417,7 +417,7 @@ def add(self, key, dist):
"""
if not 0.0 <= dist <= 1.0:
raise ValueError(
'`dist` must be between 0.0 and 1.0, not {0}'.format(dist)
u'`dist` must be between 0.0 and 1.0, not {0}'.format(dist)
)
self._penalties.setdefault(key, []).append(dist)

Expand Down Expand Up @@ -511,7 +511,10 @@ def album_for_mbid(release_id):
if the ID is not found.
"""
try:
return mb.album_for_id(release_id)
album = mb.album_for_id(release_id)
if album:
plugins.send(u'albuminfo_received', info=album)
return album
except mb.MusicBrainzAPIError as exc:
exc.log(log)

Expand All @@ -521,22 +524,31 @@ def track_for_mbid(recording_id):
if the ID is not found.
"""
try:
return mb.track_for_id(recording_id)
track = mb.track_for_id(recording_id)
if track:
plugins.send(u'trackinfo_received', info=track)
return track
except mb.MusicBrainzAPIError as exc:
exc.log(log)


def albums_for_id(album_id):
"""Get a list of albums for an ID."""
candidates = [album_for_mbid(album_id)]
candidates.extend(plugins.album_for_id(album_id))
plugin_albums = plugins.album_for_id(album_id)
for a in plugin_albums:
plugins.send(u'albuminfo_received', info=a)
candidates.extend(plugin_albums)
return filter(None, candidates)


def tracks_for_id(track_id):
"""Get a list of tracks for an ID."""
candidates = [track_for_mbid(track_id)]
candidates.extend(plugins.track_for_id(track_id))
plugin_tracks = plugins.track_for_id(track_id)
for t in plugin_tracks:
plugins.send(u'trackinfo_received', info=t)
candidates.extend(plugin_tracks)
return filter(None, candidates)


Expand Down Expand Up @@ -566,6 +578,10 @@ def album_candidates(items, artist, album, va_likely):
# Candidates from plugins.
out.extend(plugins.candidates(items, artist, album, va_likely))

# Notify subscribed plugins about fetched album info
for a in out:
plugins.send(u'albuminfo_received', info=a)

return out


Expand All @@ -586,4 +602,8 @@ def item_candidates(item, artist, title):
# Plugin candidates.
out.extend(plugins.item_candidates(item, artist, title))

# Notify subscribed plugins about fetched track info
for i in out:
plugins.send(u'trackinfo_received', info=i)

return out
Loading

0 comments on commit dd949a9

Please sign in to comment.