Commit Graph
66 Commits
Author SHA1 Message Date
Šarūnas Nejus 11d41aee7d typing: add missing types to plugins 2026-08-31 11:27:12 +01:00
Šarūnas Nejus 6241139600 typing: define explicit optparse.Values for each command 2026-08-19 23:57:05 +01:00
Šarūnas Nejus 14eabc6060 typing: add types to command handlers 2026-08-19 23:57:01 +01:00
Šarūnas Nejus 5039c8f6cf typing: add types to event handlers 2026-08-18 10:46:33 +01:00
Sebastian Mohr 54a2bd20e1 Removed This file is part of beets... headers. 2026-06-29 11:20:15 +02:00
Sebastian Mohr adfb73b66d Run ruff format 2026-05-20 16:53:06 +02:00
Šarūnas Nejus b3d434f58f Delegate attribute access to logging 2025-08-30 23:10:21 +01:00
Šarūnas Nejus e334e81d40 Use item.filepath instead of displayable_path in logging 2025-08-30 23:10:21 +01:00
Šarūnas Nejus d93ddf8dd4 Do not use explicit indices for logging args when not needed 2025-08-30 23:10:21 +01:00
Šarūnas Nejus 7cada1c9f8 Remove no-op decargs 2025-07-08 11:37:33 +01:00
Šarūnas Nejus 85a17ee503 Reformat the codebase 2024-09-21 11:57:48 +01:00
Serene-Arc a6e5201ff3 Apply formatting tools to all files
This is 'the big one', which touches every file so that it all conforms
to the given standard.
2023-10-22 09:53:18 +10:00
Arno Hautala d8eba458bd use ui.should_write() to control restore during import 2023-09-06 18:50:01 -04:00
Andrew Rogl 1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Carl Suster 546bf3af7e mediafile: import from standalone module 2019-05-29 09:35:14 +10:00
Adrian Sampson 14476e2f8a scrub: Handle MutagenError (fix #2716)
In older versions of Mutagen, an IOError indicated things like
permissions errors. Now, a custom MutagenError is raised. Now we handle
both.
2017-10-20 14:49:53 -04:00
Adrian Sampson ac41b6d6e5 Fix #2339: scrub resets art type
We now use the richer `images` field instead of the more basic `art` field.
2016-12-29 13:30:17 -05:00
Adrian Sampson 413666a825 Fix #2351: crash in scrub on MediaFile errors 2016-12-28 16:36:51 -05:00
Christoph Reiter 629241efd3 mediafile: Cleanup mutagen error handling
Instead of the individial mutagen format exceptions use the
mutagen.MutagenError exception introduced in 1.25.

Since 1.33 mutagen will only raise MutagenError for load/save/delete
and no longer raise IOError. Translate both errors to UnreadableFileError
to support older and newer mutagen versions. Unify error handling
in __init__(), save() and delete().

Since it's no longer possible to get an IOError from MediaFile, adjust
all callers and tests accordingly.

This was tested with mutagen 1.27 and current mutagen master.
2016-06-28 16:43:34 +02:00
Johnny Robeson 330306bbe2 remove bytes casts from object/method resolution code 2016-05-30 23:21:24 -04:00
Adrian Sampson 8a0b18c960 Fix #1903: scrub sometimes ignored id3v23 2016-03-15 23:06:10 -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 30cf407074 Removed import of unicode_literals from plugins
* rewrite
* scrub
* smartplaylist
* spotify
* the
2016-02-20 14:31:27 +01:00
Jack Wilsdon 12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Adrian Sampson 7749cba00e scrub: Demote a log message to debug
This seems unnecessary in the `beet scrub` output.
2015-12-12 18:29:49 -08:00
Adrian Sampson d5c51dd816 scrub: Restore tags & art in auto mode (#1657) 2015-12-12 18:28:58 -08:00
Adrian Sampson f5448d1531 scrub: Run on import in auto mode (#1657) 2015-12-12 18:20:05 -08: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
Bruno Cauet 65a88e2bf4 Fix StrubPlugin.write_item() expected arguments
Fix #1338.
2015-02-24 19:30:51 +01:00
Adrian Sampson 313c3807aa scrub: Use syspath in beet scrub (#1297) 2015-02-02 10:42:31 -08:00
Adrian Sampson 465719a208 scrub: Catch IOErrors in command (fix #1297) 2015-02-02 10:13:48 -08:00
Adrian Sampson ac3ea16656 Fix for unicode_literals in scrub
Here's an example where unicode_literals may not be a great idea: these should
probably be "native" strings, i.e., bytes on 2.x and unicode on 3.x.
2015-01-27 13:48:13 -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
Bruno Cauet 4babc40fd8 Delete useless "config['mypluginname']" mentions
Replace with self.config where this is painless.
More plugins would benefit from this update but that requires turning
functions into methods.
2015-01-12 10:55:59 +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 860e7e1483 Update 3 plugins: func → methods, listeners
- functions turn into method in order to have the logger object
- registering the listener has to be updated too
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
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6 65de93941d flake8 cleanup
Cleanup after cleanup
2014-09-09 11:28:43 +10: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 7de6259c1d MediaFile: make id3v23 a constructor parameter
For #899, we need to change MediaFile's behavior (pre-write) based on whether
we're doing ID3v2.3 or not. So we need a field on the object, not a parameter
to `save()`.
2014-08-15 12:09:18 -07:00
Adrian Sampson 4940958148 Fix #822: scrub/convert plugin conflict
We now correctly scrub the destination of a conversion, not the source.
2014-06-14 16:08:49 +01:00
Thomas Scholtes c3ea1ded30 Add item.try_write() to log errors
Many commands and plugins use `item.write()` to update tags. Since the success
of the call is not critical to the functionality of most consumers we want to
catch any exceptions, log an error and continue with our task. The new method
encapsulates this logic.

This fixes #675.
2014-04-10 15:26:05 +02:00
Adrian Sampson 8a105b0cb9 Merged in yevgenybezman/beets/scrub-add-mp4 (BB pull request 1)
scrub: Added MP4 support to scrub plugin
2013-12-22 12:47:34 -08:00
Yevgeny Bezman 7310f0a371 scrub: Added MP4 support to scrub plugin
--HG--
branch : scrub-add-mp4
2013-12-22 22:04:47 +02:00
Adrian Sampson 3ccd231765 id3v23: remove one redundant case; changelog/thanks 2013-11-05 19:59:45 -08:00