Commit Graph
65 Commits
Author SHA1 Message Date
Šarūnas Nejus 9611a23a87 typing: fix annotations in thumbnails 2026-08-31 10:55:33 +01:00
Šarūnas Nejus 6b4f8fa25b typing: add annotations to thumbnails 2026-08-31 10:55:33 +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
Šarūnas Nejus 648f24cbc2 Enable and fix flake8-builtins 2026-06-09 00:14:06 +01: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 d6b6ac3387 Replace logging f-strings with arguments 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 1c16b2b308 Replace string concatenation (' + ')
- Join hardcoded strings
- Replace concatenated variables with f-strings
2025-08-30 23:10:15 +01:00
Šarūnas Nejus 4a361bd501 Replace format calls with f-strings 2025-08-30 18:42:26 +01:00
Šarūnas Nejus 7cada1c9f8 Remove no-op decargs 2025-07-08 11:37:33 +01:00
Šarūnas Nejus c490ac5810 Fix formatting 2025-05-07 10:41:01 +01:00
Šarūnas Nejus 179ed13e09 Say bye to util._fsencoding 2025-04-21 12:41:57 +01:00
Skia 225c21b90f plugins/thumbnails: fix FFI with GIO on s390x
Using the correct function signature for g_file_new_for_path fixes the
tests on s390x.
I do not have the full story on why this failed consistently only on
s390x, but I guess the big endian might have something to play with
this.

Here is how the tests were failing:
```
169s ___________________________ ThumbnailsTest.test_uri ____________________________
169s
169s self = <test.plugins.test_thumbnails.ThumbnailsTest testMethod=test_uri>
169s
169s     def test_uri(self):
169s         gio = GioURI()
169s         if not gio.available:
169s             self.skipTest("GIO library not found")
169s
169s >       assert gio.uri("/foo") == "file:///"  # silent fail
169s E       AssertionError: assert '' == 'file:///'
169s E
169s E         - file:///
169s
169s test/plugins/test_thumbnails.py:268: AssertionError
```
You can see a full log here [1] and a history of consistent failure
here [2]. Both links are bound to expire at some point, sorry future
archeologist 🤷.

[1]: https://autopkgtest.ubuntu.com/results/autopkgtest-plucky/plucky/s390x/b/beets/20250403_162414_5d1da@/log.gz#S5
[2]: https://autopkgtest.ubuntu.com/packages/beets/plucky/s390x
2025-04-14 02:19:10 +01:00
Šarūnas Nejus 85a17ee503 Reformat the codebase 2024-09-21 11:57:48 +01:00
Šarūnas Nejus f388ff6ec1 Replace py3_path with builtin os.fsdecode
`os.fsdecode` has only been available since Python 3.2.
2024-06-16 00:52:37 +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
luzpaz 8419149c7a Fix various typos 2023-08-09 21:26:15 -04:00
wisp3rwind 29c21860a9 add missing syspath conversions (2/3, beetsplug) 2023-07-16 10:17:40 +02:00
wisp3rwind b76a3fcaa4 artresizer: move ImageMagick/PIL code from thumbnails plugin to ArtResizer
Makes the dispatch to the chosen backend simpler in the thumbnails
plugin. Given that ArtResizer is not only about resizing art anymore,
these methods fit there quite nicely.
2022-03-12 23:34:46 +01:00
wisp3rwind 8a969e3041 artresizer: backend classes part 1: stub classes, version checks 2022-03-12 19:48:45 +01:00
Andrew Rogl ee4268dabb Remove unused imports
Fix imports
Fix formatting
2021-08-26 20:59:48 +10: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
José AlbornozandJacob Pavlock dc7e433768 Fix thumbnail plugin pathlib bug (#3360)
PathlibURI.uri() would fail if given a path as bytes instead of as string.

Co-authored-by: Jacob Pavlock <jtpavlock@gmail.com>
2020-07-15 21:00:50 -05:00
FichteFoll aa31fea037 Update a lot of URLs to use HTTPS
*All* URLs were checked manually, but only once per domain!

I mostly concerned myself with URLs in documentation rather than source
code because the latter may or may not have impactful changes, while the
former should be straight forward.

Changes in addition to simply adding an s:

- changed pip and pypi references as their location has changed
- MPoD (iOS app) url redirects to Regelian, so I replaced those
- updated homebrew references

Notable observations:

- beets.io does have HTTPS set up properly (via gh-pages)
- beatport.py uses the old HTTP url for beatport
- as does lyrics.py for lyrics.wikia.com
- https://tomahawk-player.org/ expired long ago, but the http page
  redirects to https regardless
- none of the sourceforge subdomains have https (in 2019!)
2019-06-05 03:11:49 +02:00
wordofglass bb5629ea1d Remove untyped except statements 2017-04-29 00:05:20 +02:00
Adrian Sampson d356356111 Fix #2466: GIO returns bytes, so decode them 2017-03-03 11:59:50 -06:00
Johnny Robeson e8afcbe7ec replace unicode with six.text_type 2016-06-24 05:53:49 -04:00
Johnny Robeson b602faabb8 more bytestringification in thumbnails plugin 2016-06-16 23:11:16 -04:00
Johnny Robeson 15c07613bf decode the filename written to .desktop file 2016-06-16 23:04:52 -04:00
Johnny Robeson 52f2ab2547 encode uri passed to hashlib in thumbnails plugin 2016-06-16 23:00:45 -04:00
Johnny Robeson 3112a18463 treat ctypes .value as bytes in thumbnails plugin 2016-06-14 00:51:12 -04:00
Jack Wilsdon 79d602b2a0 Use correct methods for ImageMagick and PIL info 2016-04-27 20:41:09 +01:00
Jack Wilsdon 8317a20bcd Use correct methods from art resizer 2016-04-27 20:34:28 +01: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 7155999d00 Removed import of unicode_literals from plugins
* thumbnails
* types
2016-02-20 14:34:49 +01:00
Jack Wilsdon 12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Adrian Sampson 6c0f43cf1c Thumbnails: Fix string memory management
Should fix #1433. The problem now was that we were freeing the string memory
that Python expected to be managing in a string object held by the `uri`
variable. Now, we do a silly dance to copy the memory out of the buffer
returned by the library and return that instead.
2015-11-20 11:26:35 -08:00
Adrian Sampson 530b42156b Thumbnails: Declare more interface types
Seems to address a segfault indicated in #1433, but there are still crashes
lurking.
2015-11-20 10:55:25 -08:00
Adrian Sampson a18506f471 Fix #1686: thumbnails using unicode paths 2015-11-02 11:03:43 -08:00
David 36bf49aa8d typo: thumnails -> thumbnails 2015-05-11 14:26:49 -04:00
Tom Jaspers c95b89ebc1 Thumbnails: add None check on lib_name
`find_library` could return None, which would not cause an OSError
from `loadLibrary`, making the plugin (falsely) think the library is available

Also fixed  wrong method call to skip test in that case

See #1277
2015-03-30 19:56:22 +02:00
Bruno Cauet e707342bf9 Add call to g_type_init() for glib < 2.36 2015-03-27 16:33:51 +01:00
Bruno Cauet 2e5803cfad Thumbnails: unicode → bytes filename 2015-03-27 14:00:22 +01:00
Bruno Cauet f41ec9bbf6 ctpyes: set argtypes & restype 2015-03-27 14:00:13 +01:00
Bruno Cauet 07ee934352 Thumbnails: improve log readability 2015-03-25 20:14:23 +01:00
Bruno Cauet 4b349771ff thumbnails plugin setup: log tools chosen 2015-03-25 20:14:19 +01:00
Bruno Cauet 11a4777219 URI: use gio/gio.h's g_file_get_uri if available 2015-03-25 20:14:16 +01:00