Commit graph

64 commits

Author SHA1 Message Date
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
Tom Jaspers
12ecb2ce35 Fix formatting to new PEP8 version (1.6.2)
PEP8 1.6.2 (2015-02-15):
- added check for breaking around a binary operator

This caused Travis to fail on "W503 line break before binary operator"
2015-02-16 18:21:56 +01: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
d2726e1c25 Fix mpdstats plugin config management
Fix #1228:
- remove erroneous calls to `self.config`
- always use `config['mpd']` and not `self.config` (which is
  config['mpdstats']) to match the doc
2015-01-16 11:08:24 +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
Adrian Sampson
558d1f9639 Merge pull request #1212 from brunal/mpdstats-react-only-once
mpdstats: don't register a natural song change twice
2015-01-08 13:43:46 -08: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
b7735bd3bf Don't register a natural song change twice
mpd responds twice to an 'idle' command upon a 'natural' song change
(i.e. not a skip). Checking the reason for mpd response avoids
registering twice the song change.

Fix issue #773
2015-01-08 12:39:28 +01:00
Bruno Cauet
32673b87e7 Update multiple plugins: pass the logger around 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
f5c5666729 Attain pep8-cleanliness
No more E12 or E501
2015-01-04 17:29:31 +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
Zach Denton
606d47a315 Update type of last_played to library.DateType(). 2014-09-18 17:13:09 -04:00
Thomas Scholtes
5dec867ab3 mpdstats: set types for flexible fields 2014-09-14 12:34:46 +02:00
Johann Klähn
b590cfebf2 mpdstats: update rating on 'stop' (e.g. last song in playlist)
Fixes #772
2014-06-04 15:41:15 +02:00
Adrian Sampson
e5a9db1cac fix up some indentation warnings in plugins 2014-04-13 17:55:49 -07:00
Adrian Sampson
fb37be44db restore some comments from #684
I wanted to leave a few of these as comments -- they serve more as separators
than as internal documentation.
2014-04-13 17:43:43 -07:00
Fabrice Laporte
3ead936fe5 flake8 cleaning beetsplug/*
Remaining warnings are related to visual indentation.
2014-04-13 23:24:57 +02:00
Johann Klähn
73a43b56a0 mpdstats: update last_played
This fixes #529 and brings back the old behaviour of setting last_played
on every song change regardless of whether it is played to the end or skipped.
2014-02-10 20:55:42 +01:00
Johann Klähn
e78b0928b2 fix mpdstats plugin after query restructuring
BytesQuery does not handle unicode strings correctly at the moment
and PathQuery seems like a reasonable query to use.
2014-01-31 20:16:22 +01:00
Adrian Sampson
9ee4adc5e1 move remaining generic Query types to dbcore.query
NumericQuery is still broken. This, of course, is the whole reason for the
change.
2014-01-20 16:40:50 -08:00
Adrian Sampson
cbbb38c417 new BytesQuery factors out MatchQuery's path logic 2014-01-13 16:17:30 -08:00
Johann Klähn
0bb395fa8c mpdstats: fix typo/bug 2013-12-14 12:11:18 +01:00
Adrian Sampson
19868946d5 mpdstats refactor: comments/credit 2013-12-12 15:47:26 -08:00
Johann Klähn
159a67e30f mpdstats: reload item before calculations
As mpdstats is a long running process the value of one of the attributes
may have changed since the song started to play (f.ex. through a manual
update using `modify`).
2013-12-12 08:29:01 +01:00