Commit Graph
92 Commits
Author SHA1 Message Date
Šarūnas Nejus b64c693252 typing: fix annotations in mpdstats 2026-08-31 10:55:33 +01:00
Šarūnas Nejus 4f0ac15b99 typing: add annotations to mpdstats 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
Sebastian Mohr 54a2bd20e1 Removed This file is part of beets... headers. 2026-06-29 11:20:15 +02:00
Zixuan Cui 42d3fe0038 Merge branch 'master' into fix-mpdstats-cli-host 2026-06-09 15:24:12 +08:00
Šarūnas Nejus d53ee774a9 Enable and fix flake8-return 2026-06-09 00:14:06 +01:00
Tsuizxgo cf7c5e4eb2 Fix mpdstats CLI option overrides 2026-06-01 23:57:07 +08:00
Šarūnas Nejus 30ab81eb5b Extract UserError from beets.ui to a new beets.exceptions module.
Update all references in core, plugins, and tests to import UserError
from the new location. This centralizes exception handling and improves
code organization.
2026-05-16 11:18:51 +01:00
Šarūnas Nejus 1c20e4bd4e Address RUF012 2026-01-13 20:55:40 +00: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 1c16b2b308 Replace string concatenation (' + ')
- Join hardcoded strings
- Replace concatenated variables with f-strings
2025-08-30 23:10:15 +01:00
54562474 48d45b4df7 feat: mpdstats: add config option for played ratio threshold to determine if a
track was played or skipped.
2025-07-09 14:16:23 -06:00
Šarūnas Nejus 1a045c9166 Copy paste query, types from library to dbcore 2025-07-06 16:03:46 +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
Andrew Rogl 237bd07508 Address feedback from @sampsyo 2021-09-28 18:05:44 +10: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
Andrea Mistrali 1a65501cee Clean up strip_path and logging 2021-02-23 10:40:59 +01:00
Andrea Mistrali 48e7d2964e Style changes 2021-02-23 05:45:53 +01:00
Andrea Mistrali 0e67b6801c ARGH! Wrong variable 2021-02-22 14:50:30 +01:00
Andrea Mistrali 921bc424cd Better handling of strip_path 2021-02-22 14:47:58 +01:00
Andrea Mistrali 99de85b5c2 Only leftmost subpath is replaced 2021-02-22 14:33:01 +01:00
Andrea Mistrali ce974d4fc7 One line :) 2021-02-22 14:30:50 +01:00
Andrea Mistrali 414b682123 Add strip_path to mpdstats 2021-02-22 11:19:23 +01:00
Andrew Simmons 73a7723a15 Add python version check 2021-01-06 10:33:50 -05:00
Aidan Epstein fce27e6fa9 mpdstats: Don't record a skip when stopping MPD.
MPD keeps the current track in the queue when stopping, so it's not
really like a skip, and I use it so that I can stop the music, and later
start at the beginning of a track.

I do this by keeping track of the current song id, and then comparing
them when we receive a stop signal.
2020-08-10 07:07:17 -07:00
Carl Suster dc5f110844 mpdstats: use MPD_PORT env variable 2019-04-19 17:35:42 +10:00
gdtwst c41197cc5c Re-add fixes from #2707 2019-04-07 10:07:38 +07:00
Rainer Unseld ce5981b885 mpdstats: use currentsong instead of playlist
Improved the method to get the path of the current song. Before, the complete playlist was fetched from the server. Now, the command "currentsong" is used for this purpose. This improves performance when a huge playlist is active.
2019-04-06 15:23:34 +11:00
gdtwst e5afc5e0b3 Remove whitespaces from empty line 2017-10-07 19:00:08 +07:00
gdtwst c2770a5f6b Enable play counts for repeated plays of the same song. 2017-10-04 19:10:59 +07:00
gdtwst eb338d208b Register song changes when switching from song to stream URL 2017-10-04 16:35:22 +07:00
Artem Utin 40eef2056c Add changelog entry, wrap long comment lines. 2017-01-24 11:41:55 +10:00
Artem Utin 2ab1f3ae89 More general approach to multiple on_play calls for the same song - now it ignores such calls, if time between calls was below threshold 2017-01-23 23:15:14 +10:00
Adrian Sampson 44963598e8 Remove unused import 2017-01-21 23:32:36 -08:00
Adrian Sampson ca904a9d0c mpdstats: Fix Python 3 compatibility (fix #2405)
We previously needed a hack to get the client to consume and produce Unicode strings. The library has since added Unicode support, behind a constructor flag. We can remove the hack now, which was causing a crash on Python 3 because the library uses Unicode by default there, and instead use its built-in support.
2017-01-21 23:21:11 -08:00
Johnny Robeson 7a2bdf502f s/utf8/utf-8/ in all encoding/decoding contexts
This matches up with the python documentation.
2016-09-06 23:10:24 -04:00
nathdwek@laptop 3acd44260a Apply #2175 to mpdstats to keep consistency 2016-08-26 18:17:37 +02:00
Adrian Sampson 5efd5b21c5 Use new as_str method
Instead of `get(six.text_type)`, which was a surprisingly large portion of our
uses of six.
2016-06-25 19:16:14 -07:00
Johnny Robeson e8afcbe7ec replace unicode with six.text_type 2016-06-24 05:53:49 -04:00
Johnny Robeson fff0439b06 add missing blank line in mpdstats 2016-06-17 00:09:22 -04:00
Johnny Robeson 12136e1d32 adapt is_url checking for bytestring paths 2016-06-17 00:00:08 -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 feab3df910 Removed import of unicode_literals from plugins
* mpdstats
* mpdupdate
* permissions
* zero
2016-02-20 14:12:37 +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
Cody Reichert b776a71a8c handle mpdstats update_rating when item is None / add appropriate tests 2015-04-28 23:23:27 -05:00
Adrian Sampson 07516b2bca Redact some passwords in plugins 2015-03-27 22:42:28 -04:00