Commit graph

62 commits

Author SHA1 Message Date
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
7d00ab3b50 Removed unicode_literals from plugins
* fetchart
* freedesktop
* fromfilename
* ftintitle
2016-02-20 13:44:45 +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
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
Adrian Sampson
90178ab380 Always log a template literal (fix #1481)
Otherwise, we risk the user-provided string looking like a format string! If
it contains curly braces, it can behave unexpectedly.
2015-05-28 23:44:41 -04:00
Amish Bhadeshia
9a38b07ed4 Housekeeping and styling changes 2015-03-28 11:20:28 +00:00
Amish Bhadeshia
6365a9b538 Added indice into curly brackets, for py26 compatabiity 2015-03-27 20:54:42 +00:00
Amish Bhadeshia
232ff05766 Added tests and simplified implementation method 2015-03-27 17:59:35 +00:00
Amish Bhadeshia
d2a95158f2 Updated ftintitle plugin to follow a format 2015-03-21 15:36:39 +00:00
Adrian Sampson
14ce6a557e Merge pull request #1183 from marcaddeo/refactor-ftintitle
Refactor ftintitle

Conflicts:
	beetsplug/ftintitle.py
2015-01-31 12:51:15 -08: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
Adrian Sampson
24317fd4c7 Rename BeetsPlugin._import_stages to import_stages
For #1208. Restores backwards-compatibility and matches the development docs.
2015-01-11 14:27:59 -08: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
1afe82fb41 Make 2 plugins rely on auto log level mgmt
ftintitle and title don't do manual management anymore.
2015-01-06 21:27:15 +01:00
Bruno Cauet
427f7e7035 Automatic logger level changes on import
Breaking changes: plugins should set set _import_stages instead of
import_stages. From outside the latter is replaced by import_stages().
This is because it is now wrapped with log level-getting & -setting
statements.
2015-01-06 21:27:15 +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
Marc Addeo
8cd3d0059f Remove ArtistNotFoundException in favor of returning None for simplicity 2014-12-29 11:10:43 -05:00
Marc Addeo
e71c464c14 Initialize feat_part as None 2014-12-28 21:27:58 -05:00
Marc Addeo
8f41818434 Fix formatting to pass flake8 tests 2014-12-28 20:58:59 -05:00
Marc Addeo
a70820d8a1 Fix a bug in ftintitle with the order of album artist
There was a bug in the find_feat_part function that would cause it to
fail if the album artist was the second part of the featured string.

For example, if the Artist field was Alice & Bob, and the Album Artist
field was Bob it would return None due to the order.

This fixes that and adds test cases to ensure it doesn't return.
2014-12-28 20:23:17 -05:00
Marc Addeo
4d4113e3a4 Refactor ftintitle to extract the code to find the featured artist
This removes the code that extracts the featured artist from the
original artist field from the ft_in_title function and puts it into its
own.

It also adds a custom ArtistNotFoundException that find_feat_part will
throw if the album artist is not in the artist field.

This allows us to easily test the results of finding a featured artist
in the artist sting, and thus adds tests for the usual test cases that
the split_on_feat gets tested for.
2014-12-28 20:15:09 -05:00
Adrian Sampson
d0dcc74c7e Merge pull request #1181 from marcaddeo/fix-ftintitle-duplicate-album-artist
Fix handling of duplicate album artists in ftintitle
2014-12-28 18:58:36 -04:00
Marc Addeo
8c484a273c Fix handling of duplicate album artists in ftintitle
The code that determines the featured artist part of the artist only
handles two element lists. When the album artist is duplicated, it
splits into a three element list causing no featured artist to be found.

This ensures the albumartist_split can ever only have 2 elements.

Fixes #1179
2014-12-28 17:51:48 -05:00
Frederik "Freso" S. Olesen
0ec3396d3f ftintitle: Use log.log() instead of ui.print_().
Fixes #1172.
2014-12-28 20:33:56 +01:00
Frederik "Freso" S. Olesen
6182ef1b1e ftintitle: Remove empty ui.print_() call. 2014-12-28 20:33:15 +01:00
Fabrice Laporte
474adffe63 move helper functions from utils to plugins 2014-12-17 22:00:00 +01:00
Fabrice Laporte
829b623665 remove capturing parentheses 2014-12-15 22:48:01 +01:00
Fabrice Laporte
b62f15d9d9 feat_tokens: change argument name, fix regex flag 2014-12-14 22:46:51 +01:00
Fabrice Laporte
91a998df3c fix #1060 2014-12-13 23:34:50 +01:00
Adrian Sampson
a2d763b745 Fix ftintitle auto permanence (#485)
Oops. Plugins need to store to the database.
2014-11-09 19:21:09 -08:00
Adrian Sampson
05d5edcd0e Quiet down logging in #1070
This looks mostly helpful for debugging but redundant with the ordinary
logging.
2014-11-09 18:41:54 -08:00
David
edbb97bd09 Dropping unused argument 2014-10-25 16:16:32 -04:00
Fabrice Laporte
343972f5d0 move metadata management in command function 2014-10-18 11:04:10 +02:00
Fabrice Laporte
ac57ef0e67 restore write argument for ft_in_title 2014-10-14 20:58:36 +02:00
Fabrice Laporte
4884ae3c46 register import hook only if needed 2014-10-13 22:25:09 +02:00
Fabrice Laporte
740b510ed7 restoring ft_in_title implementation 2014-10-13 21:21:28 +02:00
Fabrice Laporte
cc6080fa21 ftintitle: add 'auto' option 2014-10-12 22:44:34 +02:00
Adrian Sampson
80bec3935e config name change, changelog for #692 2014-04-22 14:50:54 -07:00
SUTJael
4d616ceb93 Fix styling 2014-04-21 16:13:43 +02:00
SUTJael
345d47b40d Fix indent 2014-04-21 16:06:34 +02:00
SUTJael
974e3128a6 Fix formatting issues.
Drop parameter sticky
2014-04-21 13:07:26 +02:00
SUTJael
2b7538ee82 Add drop option to FtInTitlePlugin 2014-04-15 23:04:41 +02:00
Fabrice Laporte
3ead936fe5 flake8 cleaning beetsplug/*
Remaining warnings are related to visual indentation.
2014-04-13 23:24:57 +02:00